Ian D. Stewart wrote:
> Brian Jones wrote:
>
> > No, I've not found a fix. I've also not looked any further since
> > then due to lack of time spent working on Classpath. I've been
> > meaning to send Chris Toshok email asking him if he had an idea where
> > I should look?
>
> Well, I have narrowed down the (likely) cause to HVM_DllFind(). Apparently,
> it is reporting success even when the file it is trying to load doesn't
> exist...now I've just got to figure out why...
Well, as it turns out, this is not the cause of the segfault, but I have
determined the cause of the unusual behaviour. The method lt_dlopen (which
HVM_DllFind() eventually calls) attempts to load a specified shared library.
However, if it cannot find the library, it searches amoung the directories
specified in LTDT_LIBRARY_PATH, and if it finds a library with the same
filename, it loads that file. Unfortunately, japhar never reports that a
different library then the one specified is being loaded.
This has the effect of essentially nullifying the portion of
HVM_DllFindAlongPath which tries to determine a file to load by checking each
directory in LTDT_LIBRARY_PATH for libjaphar_%s, and then lib_%s.
If you comment out the portion of lt_dlopen which searches along
LTDT_LIBRARY_PATH (I'm attatching a diff which does this), HVM_DllFindAlongPath
behaves as expected. Note: this does not resolve the issue of loading
libraries for java.lang.reflect and other triple level packages (this probably
should be handle in initialize_system_libraries, and not the HVM_Dll methods.
Example:
#ifdef CLASSPATH
handle = HVM_DllFind("javalangreflect")
#else
handle = HVM_DllFind("reflect")
#endif
Ian
P.S. Ignore the last message about Address out of bounds. It was a simple case
of IOBK.
1191c1191
< handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
---
> handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
1233c1233
< /* extract the module name from the file name */
---
> /* extract the module name from the file name */
1257c1257
< if (!file)
---
> /* if (!file)
1260c1260
< &dir, 0);
---
> &dir, 0);
1266c1266
< #endif
---
> #endif */
1372c1372
< && !find_file(basename,
---
> /* && !find_file(basename,
1379c1379
< #endif
---
> #endif */