Closed Bug 887685 Opened 9 years ago Closed 2 years ago

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

Categories

(Core :: mozglue, defect)

ARM
Android
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jseward, Assigned: glandium)

Details

ReadSymbolData_ANDROID() in local_debug_info_symbolizer.cc contains a
kludge that special-cases the path for libmozglue.so, 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: local_debug_info_symbolizer.cc:128: INFO: ReadSymbolData_APK: Unable to get size for ELF file 'libmozglue.so'

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.

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