[gambit-list] Bus error with Blackhole

Benjohn Barnes benjohn at fysh.org
Tue Jun 7 10:39:29 EDT 2011


On 2 Jun 2011, at 14:55, Marc Feeley wrote:

> 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)

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:
> 4) 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:
> 5) 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gl-test.zip
Type: application/zip
Size: 97994 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20110607/8ae25651/attachment.zip>
-------------- next part --------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple-test.zip
Type: application/zip
Size: 570 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20110607/8ae25651/attachment-0001.zip>
-------------- next part --------------


-- 
benjohn at fysh.org - Twitter @benjohnbarnes - Skype benjohnbarnes - Mobile +44 (0) 7968 851 636



More information about the Gambit-list mailing list