Closed Bug 887685 Opened 9 years ago Closed 2 years ago

__dl_get_mappable_length(dlopen("", ...)) fails


(Core :: mozglue, defect)

Not set





(Reporter: jseward, Assigned: glandium)


ReadSymbolData_ANDROID() in contains a
kludge that special-cases the path for, when reading
unwind info.  This has an unfortunate side effect of causing the subsequent
dlclose to run finalisers even though the object is already loaded
(presumably under a different path name, though).

Removing the kludge per MH's instructions causes  __dl_get_mappable_length
to fail, though:

E/Profiler(10659): 2013-06-27 07:22:18: INFO: ReadSymbolData_APK: Unable to get size for ELF file ''

hence symbol loading fails for this file.
If this is problematic to fix, another possibility (at least from the
SPS side) is to change the faulty.lib interface, so that the handle
to be given to __dl_get_mappable_length and __dl_mmap is obtained not
from dlopen but from some other function (offered by faulty.lib) that
merely produces a handle but does not process (relocate, run initialisers
and finalisers) the underlying file in any way.  Just treats it as an
uninterpreted bunch of bytes.

That would also make the interface more general, in that it would be
possible to use it to access any file in the apk rather than just 
files that can be dlopened.
That would use more memory. Although in your case you're not mapping things that would be mapped by the linker, and you're unmapping quickly, too.
But I'm sick of doing hacks on top of hacks on top of hacks for the sake of fixing things quickly.

Also, it wouldn't solve the problem with system libraries that you don't know where they are.

This is going to be obsoleted by bug 1648654.

Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.