Re: [Gc] Debugging Help (X10i on OctoPOS)
Ivan Maidanski <ivmai-JGs/[email protected]>
| Newsgroups | gmane.comp.programming.garbage-collection.boehmgc |
|---|---|
| Message-ID | <[email protected]> |
Hi Andreas, My suggestion is set data watch for vptr after it is allocated to find out which code modifies it after deallocation. Regards, Ivan Wed, 15 Jan 2014, 10:31 +01:00 from Andreas Zwinkau <[email protected]>: > > I could use some help/hints for debugging a GC problem. > > First some context: We use a modified X10 compiler (X10i) with a custom > backend (libfirm). Compilation target is a custom operating system > (OctoPOS), which in my case is running on top of Linux. We ported bdwgc > (7.3alpha3) to use the corresponding OctoPOS API to stop the world etc. > It works, except of the problem below. > > For a longer running application we sometimes observe some memory > corruption. (We mostly observe a deadlock, which might be symptom of the > same bug or another bug.) > > Using GC_DEBUG I sometimes get: > GC_debug_free: found previously deallocated (?) object at e811eee0 in or > near object at e811eee8(<smashed>, appr. sz = 133) > > Occasionally it crashes on the following assert in malloc.c:270, which > apparently checks that an address from the freelist is within the > correct heap or NULL. > > GC_ASSERT(0 == obj_link(op) > || ((word)obj_link(op) > <= (word)GC_greatest_plausible_heap_addr > && (word)obj_link(op) > >= (word)GC_least_plausible_heap_addr)); > > Using gdb, I can see that "obj_link(op)" points to a vtable, which is > not heap allocated but static data. > > The vtable-pointer is at offset 0 in our objects. Object initialization > follows the usual flow of "allocate;set vptr;call constructor". Hence my > current theory: Either allocate does not remove the object from the > freelist correctly or "set vptr" is performed on unallocated/freed memory. > > Any tips how to proceed? > > I foolishly closed the gdb session, so currently I am rerunning the app > to trigger the assertion again. :-/ > > cheers > -- > Andreas Zwinkau > > Karlsruhe Institute of Technology (KIT) > Phone: +4972160848351 > Email: [email protected] > Web: http://pp.info.uni-karlsruhe.de/personhp/andreas_zwinkau.php > > _______________________________________________ > Gc mailing list > Gc-V9/[email protected] > http://www.hpl.hp.com/hosted/linux/mail-archives/gc/