This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: objc: SIGSEGV (in gdb only) during module loading
- To: "Michael Scheibler" <michael dot scheibler at onevision dot de>
- Subject: Re: objc: SIGSEGV (in gdb only) during module loading
- From: Ovidiu Predescu <ovidiu at cup dot hp dot com>
- Date: Fri, 11 May 2001 11:20:20 -0700
- Cc: gcc-bugs at gcc dot gnu dot org
On Mon, 7 May 2001 08:42:13 +0200, "Michael Scheibler" <michael.scheibler@onevision.de> wrote:
>
> 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...
Oh, I didn't realize you're on Windows. There might be a problem with
the way libobjc is built on this platform. I'm not familiar with
Windows systems, but what I suggest you is to post your question on
the GNUstep mailing list. Helge Hess <helge.hess@skyrix.com> has a lot
of experience with this, you may also contact him.
Ovidiu