[kaffe] JVMPI status?

Dalibor Topic robilad@kaffe.org
Thu Mar 11 10:27:01 2004


Hi Jon,

Jon Nall wrote:
> Dalibor Topic wrote:
> 
>> yep, I get the same problem with jprofiler-1.1.1. It seems to be some 
>> weird memory allocation issue. I haven;t tried tracking it down.
> 
> 
> 
> i figured out why it's happening, though i'm not familiar enough with 
> the project (yet) to suggest the proper fix. the issue is that in 
> function argz_create_sep() at libltdl/ltdl.c:627 argz is LT_DLMALLOC'ed. 
> and in foreach_dirinpath() at libltdl/ltdl.c:2705 is LT_DLFREE'ed. 
> however, configure found argz_create_sep() on my system defined in 
> /usr/include/argz.h and set the following in libltdl/config.h: #define 
> HAVE_ARGZ_CREATE_SEP 1.

wow, that was quick. Thanks a lot for looking into it.

> this, i assume, causes the external argz_create_sep call which just uses 
> plain old malloc(). send that to LT_DLFREE and chaos ensues.
> 
> i hand-modified libltdl/config.h to say #undef HAVE_ARGZ_CREATE_SEP, 
> recompiled and can now run ejp without error.

sounds reasonable.

> i've tried both of the following successfully:
> 1. never use the external argz_create_sep() call
> 2. add an ifdef in foreach_dirinpath() that calls normal free() for argz.
> 
> with either of these fixes, i still get a core dump:
> kaffe-bin: jvmpi_kaffe.c:55: jvmpiPostEvent: Assertion `ev->event_type < 
> JVMPI_EVENT_COUNT' failed.
> 
> 
> if someone can tell me which of 1 or 2 above to pursue, i'll create a 
> patch and get that assert debugged.

since there is no way to guarantee that the external argz_create_sep() 
will use malloc/free (afaik), it may be better to do 1, in my opinion. 
And since it's a bug in libtool, please send a bug report upstream to 
the libtool developers, as well.

cheers,
dalibor topic