Opened 5 months ago

Last modified 5 months ago

#70235 new defect

opencascade: wrong handling of symbols on older macOS

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: snowleopard, powerpc Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: opencascade

Description

I got weird behavior with opencascade. First of all, it tries to pull symbols for system frameworks from MacPorts prefix:

36-25% /opt/local/libexec/opencascade/bin/draw.sh
Hint: use "pload ALL" command to load standard commands
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/local/lib/libJPEG.dylib

/opt/local/libexec/opencascade/bin/draw.sh: line 10: 50815 Trace/BPT trap          DRAWEXE

dyld: Library not loaded: /opt/local/lib/libjpeg.8.dylib
  Referenced from: /opt/local/lib/libTIFF.dylib
  Reason: image not found
^C/opt/local/libexec/opencascade/bin/draw.sh: line 10: 50914 Trace/BPT trap          DRAWEXE

dyld: Symbol not found: _gll_noop
  Referenced from: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
  Expected in: /opt/local/lib/libGL.dylib

/opt/local/libexec/opencascade/bin/draw.sh: line 10: 50968 Trace/BPT trap          DRAWEXE

This is not linking, it just seems to shade away system libs even for system components.

I have to deactivate libjpeg-turbo, tiff, giflib, mesa and libGLU. Once that is done, no more symbols errors, but the app crashes when I try to do something in it.

36-25% /opt/local/libexec/opencascade/bin/draw.sh
Hint: use "pload ALL" command to load standard commands
Draw[1]> Draw[2]> bgerror failed to handle background error.
    Original error: 
    Error in bgerror: 
XIO:  fatal IO error 0 (Unknown error: 0) on X server "/tmp/launch-GEIw2u/org.macports:0"
      after 1262 requests (1262 known processed) with 4 events remaining.
Assertion failed: (ret != inval_id), function _XAllocID, file xcb_io.c, line 626.
/opt/local/libexec/opencascade/bin/draw.sh: line 10: 51019 Abort trap

(Initially there is a malloc error too, but that I have fixed via adding a path in the wrapper.)

Crash aside, such behavior with libraries I see for the first time, I think.

Change History (5)

comment:1 Changed 5 months ago by barracuda156

Notice, that app itself launches successfully. I get a crash once I try doing something from menus. Trying to run a sample now, I got:

36-25% /opt/local/libexec/opencascade/bin/draw.sh
Hint: use "pload ALL" command to load standard commands
Draw[1]> Draw[2]> bgerror failed to handle background error.
    Original error: An exception was caught 0xb075910 : Aspect_WindowDefinitionError: Cocoa application should be instantiated before window
    Error in bgerror: 
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGBUS 'bus error' detected.

Which seems suggestive. Maybe it assumes Cocoa backend? That should be changed, if so.

comment:2 Changed 5 months ago by barracuda156

I wonder if this is related by the way #59917

comment:3 Changed 5 months ago by barracuda156

It is a mess starting from configure:

-- Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled
-- Info: The directories of 3rdparty headers: 
	/System/Library/Frameworks/Tcl.framework/Headers
	/System/Library/Frameworks/Tk.framework/Headers

comment:4 Changed 5 months ago by barracuda156

I give up for now.

Fixed linking to the right tk/tcl, fixed build against X11, but it is still defunct. I was able to get a step further as compared to Cocoa build, but it is broken anyway.

Gives build times, I may not be willing to fix it via trial and error.

comment:5 in reply to:  description Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to barracuda156:

36-25% /opt/local/libexec/opencascade/bin/draw.sh
Hint: use "pload ALL" command to load standard commands
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/local/lib/libJPEG.dylib

This happens if the environment variable DYLD_LIBRARY_PATH is set to contain /opt/local/lib. I see that draw.sh sources env.sh and that env.sh contains:

if [ "$WOKSTATION" == "mac" ]; then
  if [ "$DYLD_LIBRARY_PATH" != "" ]; then
    export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
  else
    export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
  fi
fi

This is the cause of the problem and has to stop.

Version 0, edited 5 months ago by ryandesign (Ryan Carsten Schmidt) (next)
Note: See TracTickets for help on using tickets.