Summary
Crash on Mac OS X
Metadata
- Id: d9fa6bdf6f9c61e836272f108aacdf220dc9b63e
- Trac id: 1277
- Type: defect
- Reporter: sjamaan
- Owner:
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty:
- Resolution: fixed
- Priority: critical
- Milestone: 4.11.0
- Version: 4.10.x
- Changetime: 2016-04-16 17:14:03 UTC
- Created: 2016-04-09 10:52:11 UTC
- Keywords:
Description
When running make check on OS X, it was reported that the compiler tests failed with the following error:
======================================== compiler tests ... /Users/joni/Scratch/scheme/chicken-4.11.0rc1/tests/../chicken 'compiler-tests.scm' -output-file 'a.c' -types ../types.db -ignore-repository -verbose -include-path /Users/joni/Scratch/scheme/chicken-4.11.0rc1/tests/.. [panic] `##sys#error-hook' is not defined - the `library' unit was probably not linked with this executable - execution terminated
Changes and comments
[2016-04-11 10:20:49 UTC] sjamaan wrote:
This turns out to be caused by a new "security" feature in OS X El Capitan (System|Integrity Protection]), which breaks backward compatibility by obliterating environment variables like DYLD_LIBRARY_PATH for so-called "system" binaries, like /bin/sh. When csc invokes chicken, it will do so through the shell, which means we lose DYLD_LIBRARY_PATH.
This affects many other projects:
- [[[https://ghc.haskell.org/trac/ghc/ticket/11617|GHC]|]]
- [[[http://www.postgresql.org/message-id/561E73AB.8060800@gmx.net|PostgreSQL]|]]
- [[[https://github.com/CocoaPods/CocoaPods/issues/4121#issue-104721479|CocoaPods]|]]
- NodeJS|OracleDB bindings]
- Probably many, many more
See also this|Stack Overflow post] for one possible workaround.
[2016-04-11 10:20:49 UTC] sjamaan wrote:
1460407192086028
[2016-04-12 22:19:48 UTC] zbigniew wrote:
I am getting a similar but different error with both 4.10.1 and 4.11.0rc1 snapshots on OS X 10.11.4 with Xcode 7.2.1
$ make PLATFORM=macosx PREFIX=$PWD/inst check cd tests; sh runtests.sh ======================================== version tests ... Checking major and minor version numbers against chicken-version... ok Checking the registered feature chicken-<major>.<minor>... ok ======================================== compiler tests ... /Users/jim/Downloads/chicken-4.11.0rc1/tests/../chicken 'compiler-tests.scm' -output-file 'a.c' -types ../types.db -ignore-repository -verbose -include-path /Users/jim/Downloads/chicken-4.11.0rc1/tests/.. dyld: Library not loaded: libchicken.dylib Referenced from: /Users/jim/Downloads/chicken-4.11.0rc1/tests/../chicken Reason: image not found Error: shell command terminated with non-zero exit status 5: /Users/jim/Downloads/chicken-4.11.0rc1/tests/../chicken 'compiler-tests.scm' -output-file 'a.c' -types ../types.db -ignore-repository -verbose -include-path /Users/jim/Downloads/chicken-4.11.0rc1/tests/.. make: *** [check] Error 1
But, the installed binary starts fine (the libchicken.dylib path is hardcoded into the binary). DYLD_LIBRARY_PATH being clobbered may well be the issue, as the uninstalled binary in `tests/../chicken` does not have a hardcoded path.
[2016-04-12 23:39:10 UTC] zbigniew wrote:
I am positive this is caused by the stripping of DYLD_LIBRARY_PATH. Symlinking the library into the current working directory makes the tests work:
ln -sf $PWD/libchicken.dylib tests/ ln -sf $PWD/libchicken.dylib tests/reverser/tags/1.0 ln -sf $PWD/libchicken.dylib tests/reverser/tags/1.1
After this all tests pass except for the last test (deployment), which still fails with a nursery error; unsure if related.
/Users/jim/Downloads/chicken-4.11.0rc1/tests/../chicken 'rev-app.scm' -output-file 'rev-app.c' -verbose -include-path /Users/jim/Downloads/chicken-4.11.0rc1/tests/.. -verbose -include-path /Users/jim/Downloads/chicken-4.11.0rc1/tests/.. [panic] nursery is too small - try higher setting using the `-:s' option - execution terminated
Note I am unable to reproduce the panic message in the ticket. I merely get an error at dynamic link time.
[panic] `##sys#error-hook' is not defined - the `library' unit was probably not linked with this executable - execution terminated
[2016-04-12 23:39:10 UTC] zbigniew wrote:
1460497226183043
[2016-04-16 17:14:03 UTC] sjamaan changed status from new to closed
[2016-04-16 17:14:03 UTC] sjamaan set resolution to fixed
[2016-04-16 17:14:03 UTC] sjamaan wrote:
Fixed with a minimally invasive change: a606eb8 / 87c1bab / 9d21c95