objc: SIGSEGV (in gdb only) during module loading

Ovidiu Predescu ovidiu@cup.hp.com
Fri May 4 08:31:00 GMT 2001


On Fri, 4 May 2001 10:02:42 +0200, "Michael Scheibler" <michael.scheibler@onevision.de> wrote:

> 
> I am currently working with cygwin (on Win2K), my sources are compiled
> with gcc -mno-cygwin (thats mingw). I wanted to test our huge project with
> objc and gnustep-base linked as a shared DLL. When I run it from my
> console everything seems to be okay, but when I try to debug it using
> cygwin's gdb 5.0, I get a SIGSEGV fault even before main() is invoked.
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x67bc867d in sarray_free ()
> 
> When I use objc_d, I can see, that the error occurs when the Objective-C
> runtime loads and registers all the classes and their methods of our project
> (loading of gnustep-base classes has been successful). By changing the
> compilation order of my source files it happens while loading a different
> module.
> 
> The error always occurs in sarray_free()
> 
>   429 #else /* OBJC_SPARSE2 */
> - 430     struct sbucket* bkt = array->buckets[counter];
> - 431     if ((bkt != array->empty_bucket) &&
>   432  (bkt->version.version == array->version.version))
> 
>        // btk->version.version => Access violation
> 
>   433       {
> - 434  sarray_free_garbage(bkt);
> - 435  nbuckets -= 1;
> - 436       }
>   437 #endif
> 
> 
> Is there a bug in libobjc?

More likely there is a memory allocation bug happening somewhere else
in your application, which just happens to be manifest itself within
the ObjC runtime. I suggest you check the application you wrote for
invalid object management.

Ovidiu



More information about the Gcc-bugs mailing list