This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcj, gdb warnings & jni method signatures


Saturday, September 18, 2004, 7:38:24 PM, you wrote:

RO> I've tried doing as you've suggested, but I don't immediately notice
RO> anything wrong.  The warning comes up as soon as the ltdl.c call to
RO> GetProcAddress() is made (in sys_wll_sym()).

Here is my last update on this (using gcj on windows):

The problem was that gdb reported that my gcj created .exe was doing
some sort of illegal free whenever looking up a symbol with
GetProcAddress of exactly 62 characters (not more, not less). I still
don't know what is magical about 62 characters.

But, this only happened when it was looked up in a specific module. By
default the gcj created executable seems to load itself as as module
and therefore each call to _Jv_FindSymbolInExecutable in jni.cc tries
to find symbols in itself. (ie: if your output .exe is "a.exe", it
loads "a.exe" as a module). This is the module where GetProcAddress was
causing problems (with 62 character symnames for some reason).

ltdl.c/sys_wll_open():

  if (!filename) {
     // this block here loads itself as an executable
  }

I'm not sure if it is supposed to be doing this (do .exe's normally
export symbols? -- someone else probably knows more about this than
me), but by removing the loading of 'self' as a module my app no
longer has the problem and only looks up symbols in the .dlls I choose
to loadLibrary().

Regards,
Rutger Ovidius


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]