discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile for StepTalk


From: Richard Frith-Macdonald
Subject: Re: Guile for StepTalk
Date: Fri, 18 Jan 2002 09:24:51 +0000

On Sunday, January 13, 2002, at 12:28 PM, Stefan Urbanek wrote:

Hi,

I was trying to create Guile language bundle for StepTalk. But I am getting
segfaults when initialising gnustep-guile.

Backtrace is:

#0  0x404b186f in scm_igc () from /usr/lib/libguile.so.6
#1  0x404b17a2 in scm_gc_for_alloc () from /usr/lib/libguile.so.6
#2  0x404b1835 in scm_gc_for_newcell () from /usr/lib/libguile.so.6
#3  0x404cc396 in scm_make_subr_opt () from /usr/lib/libguile.so.6
#4  0x404cc4db in scm_make_subr () from /usr/lib/libguile.so.6
#5  0x404b5dd2 in scm_make_gsubr () from /usr/lib/libguile.so.6
#6  0x40467a05 in gstep_init_id ()
   from
/usr/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-
gnu/libgstep_guile.so.1
#7  0x40462c57 in gstep_init ()
   from
/usr/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-
gnu/libgstep_guile.so.1
#8 0x4045ce39 in +[GuileEngine initialize] (self=0x4045e4c0, _cmd=0x8060048)
    at GuileEngine.m:37
#9  0x4023c28d in __objc_send_initialize ()
   from /usr/GNUstep/System/Libraries/ix86/linux-gnu/libobjc.so.1
#10 0x4023c0c2 in __objc_init_install_dtable ()
   from /usr/GNUstep/System/Libraries/ix86/linux-gnu/libobjc.so.1
#11 0x4023ceb1 in objc_msg_lookup ()
   from /usr/GNUstep/System/Libraries/ix86/linux-gnu/libobjc.so.1
#12 0x4001fc20 in -[STLanguage engine] (self=0x8162310, _cmd=0x4002f9b0)
    at STLanguage.m:188
#13 0x40024a52 in +[STEngine engineForFileType:] (self=0x4002f960,
_cmd=0x804c63Quit) at STEngine.m:63
#14 0x804930a in -[STExecutor executeScript:withArguments:] (self=0x8084928,
    _cmd=0x804c5f0, file=0x808bd70, args=0x815ef08) at STExecutor.m:130
#15 0x80490f0 in -[STExecutor executeScripts] (self=0x8084928, _cmd=0x804c7e8)
    at STExecutor.m:92
#16 0x8049fc4 in -[STExecutor runWithArguments:] (self=0x8084928,
    _cmd=0x804cb48, args=0x808ccb8) at STExecutor.m:361
#17 0x804a681 in gnustep_base_user_main (argc=2, argv=0xbffff04c)
    at stexec.m:134
#18 0x4016ce58 in main ()
   from
/usr/GNUstep/System/Libraries/ix86/linux-gnu/gnu-gnu-
gnu/libgnustep-base.so.1
#19 0x4034aa42 in __libc_start_main () from /lib/libc.so.6


One flaw of guile is that you must call gh_enter(argc, argv, my_main_func) from main(), and the function 'my_main_func' is where you put all the stuff you usually
have in main().

This is to do with stuff that guile does to keep track of stack info for garbage collection - I think the gh_enter() function tags its own stack location and the garbage collection works with everything beyond that point in the stack, so all the code using guile has to be executed within functions called from gh_enter().

Looking at the stacktrace, you haven't done this, so when gstep_init_id() tries to do it's stuff, it's working with an uninitionalised guile environment (which
it has no way to initialise) - I guess this is what causes your crash.

I haven't kept track of guile development for many months, so the latest versions of guile may have fixed this problem (it used to be quite a common complaint on the guile mailing list), but I don't know - from the discussions I remember it seems this was a fairly basic flaw and would need quite a bit of work to fix.

Of course, is this *is* your problem, the workaround is simply to alter your main()
function to call gh_enter().




reply via email to

[Prev in Thread] Current Thread [Next in Thread]