Hi,
I installed and tried to compile with Blackhole on OS X yesterday, but got a bus error during the compile. I'm at a loss as to how to proceed with this. If anyone would like further details, I'll be happy to provide them, but I'm not sure what to provide.
Thank you, Benjohn
Afficher les réponses par date
On 2 Jun 2011, at 08:06, Benjohn Barnes wrote:
I installed and tried to compile with Blackhole on OS X yesterday, but got a bus error during the compile. I'm at a loss as to how to proceed with this. If anyone would like further details, I'll be happy to provide them, but I'm not sure what to provide.
To slightly clarify my horribly ambiguous post, black hole installed and built fine. The bus error occurred while trying to compile a small project that used black hole for managing modules (which was able to compile without black hole).
Thank you.
On 2011-06-02, at 3:06 AM, Benjohn Barnes wrote:
Hi,
I installed and tried to compile with Blackhole on OS X yesterday, but got a bus error during the compile. I'm at a loss as to how to proceed with this. If anyone would like further details, I'll be happy to provide them, but I'm not sure what to provide.
Thank you, Benjohn
Could you please give a little more context for your crash:
1) operating system version (uname -a) 2) version of Gambit (gsc -v) 3) version of your C compiler (gcc -v if you are using gcc) 4) a transcript of the commands that lead to the crash 5) the content of the file whose compilation lead to the crash
Marc
It is a possibility that the compiler crashes because Blackhole feeds it with invalid input. If I remember correctly the compiler crashes for instance when it is given s-expressions that don't have Gambit's internal source location annotations. This makes perfect sense and is consistent with the rest of the system; Gambit doesn't guarantee safety when messing around with the internals (in this case a REPL and compilation hook).
If you're using the master branch, you could add (pp ret) after the comment "Useful when debugging" in build.scm. This makes black hole print out all the code that it gives to Gambit.
On 2 Jun 2011, at 14:55, Marc Feeley wrote:
Could you please give a little more context for your crash:
- operating system version (uname -a)
- version of Gambit (gsc -v)
- version of your C compiler (gcc -v if you are using gcc)
Answers (I'll use quoting in this email for command line output):
OpenGLTest # uname -a Darwin Benjs-MacBook.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
OpenGLTest # gsc -v v4.6.1 20110325124526 i386-apple-darwin9 "./configure --build=i386-apple-darwin9 --prefix=/Library/Gambit-C --enable-multiple-versions --enable-symlinks --enable-single-host"
OpenGLTest # gcc -v Using built-in specs. Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5666.3~123/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
Marc Feeley wrote:
- a transcript of the commands that lead to the crash
The bus error occurs when I try to build a moderately large OpenGL and Glut test project (attached as a zip). I can build a much smaller test project that I've just put together hoping to reproduce the issue with smaller files.
Here's what happens if I try to build the openGL test project from the command line:
gl-test # bsc -exe gl-test.scm Loaded Black Hole. /Users/benjohn/Code/gambit/gl-test/gl-binding is being compiled... gl-binding.c: In function ‘___H__20_gl_2d_binding_2e_o1’: gl-binding.c:38378: warning: passing argument 4 of ‘glMultiDrawElements’ from incompatible pointer type gl-binding.c:43439: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type /Users/benjohn/Code/gambit/gl-test/glut-binding is being compiled... Bus error gl-test #
At this point, I've got these files (slightly trimmed to remove gumpf):
gl-test # ls -l total 3336 -rwxr-xr-x 1 benjohn benjohn 432396 7 Jun 16:14 gl-binding.o1 -rw-r--r--@ 1 benjohn benjohn 151443 7 Jun 15:24 gl-binding.scm -rw-r--r--@ 1 benjohn benjohn 1990 7 Jun 15:43 gl-test.scm -rwxr-xr-x 1 benjohn benjohn 18588 7 Jun 16:14 glut-binding.o1 -rw-r--r--@ 1 benjohn benjohn 1351 7 Jun 15:24 glut-binding.scm gl-test #
If I issue the command again, then it builds some more and creates an executable:
gl-test # bsc -exe gl-test.scm Loaded Black Hole. *** WARNING -- "gl-binding#GL_COLOR_BUFFER_BIT" is not defined, *** referenced in: ("/Users/benjohn/Code/gambit/gl-test/gl-test.c") *** WARNING -- "gl-binding#GL_MODELVIEW" is not defined, *** referenced in: ("/Users/benjohn/Code/gambit/gl-test/gl-test.c") *** WARNING -- "gl-binding#GL_PROJECTION" is not defined, *** referenced in: ("/Users/benjohn/Code/gambit/gl-test/gl-test.c") *** WARNING -- "gl-binding#GL_QUADS" is not defined, *** referenced in: ("/Users/benjohn/Code/gambit/gl-test/gl-test.c") *** WARNING -- "gl-binding#glBegin" is not defined, *** referenced in: ("/Users/benjohn/Code/gambit/gl-test/gl-test.c")
(another 20 odd lines of this follow).
…but when I try to run the executable, this happens:
gl-test # ls -l gl-test -rwxr-xr-x 1 benjohn benjohn 3792732 7 Jun 16:16 gl-test gl-test # ./gl-test *** ERROR IN | gl-test| -- Operator is not a PROCEDURE (#!unbound) gl-test #
Here's what happens, in contrast, if I try to build gl-test from inside "bsc":
OpenGLTest # bsc Loaded Black Hole. Gambit v4.6.1
(module-compile-to-standalone "a.out" 'gl-test)
*** ERROR IN module#module-compile-bunch -- Permission denied (create-directory "~~/lib/modules/") 1>
(I'll have a look at that error in a moment, I think it's because I've black hole in my home directory to avoid it being in a root owned place).
And now, the simple test project from the command line:
SimpleTest # bsc -exe test.scm Loaded Black Hole. Hello World SimpleTest # ./test All Done! SimpleTest #
The output here seems to make sense (after a bit of puzzling). The "Hello\nWorld\n" is being output during compilation by (print ...) statements in two included modules that don't do anything else. The "All Done!\n" is a (print ...) statement in the source of the actual executable? Anyway…
From within the bsc shell I get the same error as before:
*** ERROR IN module#module-compile-bunch -- Permission denied (create-directory "~~/lib/modules/")
Marc Feeley wrote:
- the content of the file whose compilation lead to the crash
Both the GL project and the simple project are attached.
For the GL project that causes the bus error, I took the advice from Per Eckerdal and added in "(pp ret)" to the blackhole buld.scm file (neat!). The two transcripts from that session are also in the zip.
Thanks very much, Benjohn