objc: SIGSEGV (in gdb only) during module loading

Michael Scheibler michael.scheibler@onevision.de
Mon May 7 00:08:00 GMT 2001


From: "Ovidiu Predescu" <ovidiu@cup.hp.com>
Sent: Friday, May 04, 2001 5:30 PM

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

1. My application doesn't even start up.
2. It only happens using gdb.

The next problem is that it doesn't happen always. It's more likely to
happen on Win2K than on WinNT 4.0.
I also have strange debugging problems while the application runs. I can
hardly use gdb at all. To use printfs instead of comfortable gdb can be very
annoying...



More information about the Gcc-bugs mailing list