[Gc] Re: RE: Some help with gc

Hans Boehm Hans.Boehm@hp.com
Wed, 19 Nov 2003 22:17:47 -0800 (PST)


It appears that the error message here is actually reporting the base
address of the object header, which is arguably a GC bug.  I believe
the header is 16 bytes in length, so it's complaining that the word
before the object you allocated (at line 148 in mwcdf.c) was overwritten.
If this is reproducible, I would ask gdb to watch that location,
so you can see what is being written there, assuming gdb is usable in your
environment.  Alternatively, I would look at the value in the overwritten
location, and see if you can determine where it came from.

It's conceivable that this error report is spurious, and not due to your
code.  But assuming that the line number and file name make sense, my
initial assumption would be that this is correct, and the problem is in
your code.  (There is a known chance for a false positive.  But it is
very unlikely that would have resulted in a plausible file name.)

In general, I know essentially nothing about MathLink, or how all of this
interacts with Mathematica.  I assume Mathematica runs as a separate
process?  If Mathematica runs in the same process, there are other
possible issues.

Hans

On Wed, 19 Nov 2003, rana goyal wrote:

> Hi,
>
> Thanks for the prompt reply, but now the problem has changed.
>
> This is what I have done:
>
> - Using redhat linux
> - Using GC 6.2
> - Done the default setup using 'configure' ie /usr/local/lib,
> /usr/local/include/..etc
>
>
> This is what I am doing:
>
> - I am linking C code(with GC_MALLOC..etc) to a Mathematica code using MathLink.
> For a given input to the mathematica code I get the following message in stderr:
>
> GC_check_heap_block: found smashed heap objects:
> 0x80acf0c in object at 0x80acf00(mwcdf.c:148, sz=48)
>
> If I give the same input to the C code(standalone), the output comes fine.
>
> I cant understand that what is the problem when I run the code throught Mathematica.
>
> Regards,
> Rana
>
>
>
> ----- Original Message -----
> From: "Boehm, Hans" <hans_boehm@hp.com>
> Date: Tuesday, November 18, 2003 10:27 am
> Subject: RE: Some help with gc
>
> > I assume "make test" succeeds?  You used the default configuration?
> > I assume this is GC version 6.3alpha2, and a modern version of RedHat?
> >
> > It is impossible to track this down without some more information.
> > Things that would be useful are:
> >
> > 1) A small test program that exhibits the problem.
> > 2) A gdb stack trace.  Make sure that you get it either from the core file,
> > or that it is obtained when the uncaught SIGSEGV occurs.  The collector
> > generatesand catches other signals which will cause gdb to stop.
> >
> > Once you have more details, I would prefer you ask you send a copy to
> > gc@linux.hpl.hp.com,since the resulting discussion is archived and thus
> > available to others with similar
> > problems.  (You may also get a faster answer that way.)
> >
> > Hans
> >
> >
> >
> > > -----Original Message-----
> > > From: rana goyal [rgoyal@usc.edu]
> > > Sent: Monday, November 17, 2003 9:42 PM
> > > To: Hans.Boehm@hp.com; boehm@acm.org
> > > Subject: Some help with gc
> > >
> > >
> > > Hi,
> > >
> > > I am a MS Computer Science student and work at the Nordborg Lab at the
> > > University of Southern California, Los Angeles.
> > >
> > > Can you please help me with this problem in gc:
> > >
> > > - I have ran the 'make test'
> > > - I have included 'gc.h'
> > > - I also link the gc.a
> > >
> > > I work on Red hat linux, and whenever run my C code I get the
> > > following
> > > error:
> > >
> > > Segmentation fault (core dumped)
> > >
> > > I would really appreciate your help.
> > >
> > > Regards,
> > > Rana
> > >
> > > rgoyal@usc.edu
> > >
> >
>