Re: glib / CORBA integration examples ...



Michael Meeks <michael@ximian.com> wrote:
> 	Ah; interesting. Hmm; quite possibly we should add an assertion to
> ensure that we're >2 byte aligned before we allocate.

I did do that, it just made the program crash at the assertion instead
of at CORBA_free() time. :)

> 	Of course, if we could detect NJAMD, we could ensure that the length we
> allocated is always even at little extra cost;

One of the problems here is that many fence-post debuggers like NJAMD
are run-time debuggers. You use them by loading them before libc:

LD_PRELOAD="/usr/lib/libnjamd.so" ./program

So any detection would need to be run-time, and I don't know how to do
that in a cross-debugger compatible way.

Maybe something like a --even-length-allocation argument to configure?
That's pretty nasty, and could mask some off-by-one errors that you'd be
trying to catch with the debugger. Partially defeats the purpose of
using the debugger in the first place.

> 	If you'd like to make patches, they'd be welcome,

My short-term solution was simply to make string allocations use the
smart header instead of the one-byte offset. Obviously that's too much
overhead to use in all situations.
-- 
Sam "Eddie" Couter  |  mailto:sam@topic.com.au
Internet Engineer   |  jabber:sam@jabber.topic.com.au
tSA Consulting      |  http://www.topic.com.au/
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C

PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]