[strongSwan-dev] Android x86 crash
tobias at strongswan.org
Mon Oct 20 19:31:06 CEST 2014
> Just tried to compile client for android and found it is not working
> under x86 emulator.
> As soon as you try to connect to peer it crash inside native code
> loading dynamic symbols.
> I suppose it can be google fault as Qt folks experienced similar kind of
> ARM emulator looks to be immune to this problem but it boringly slow. :(
> My question is it a known problem?
I wasn't aware of this. Which is partially due to problems I had in
getting a 4.4.2 emulator image running at all for a while.
> I/DEBUG ( 924): #00 pc 00006ac8 /system/bin/linker
> I/DEBUG ( 924): #01 pc 00001265 /system/bin/linker (__dl_dlsym+325)
> I/DEBUG ( 924): #02 pc 000510d7
The crash happens when the plugin loader tries to resolve the
constructor function of the first plugin (android_log_plugin_create).
Apparently dlsym() causes a SIGFPE that crashes the process.
I did some experiments and the only way to avoid the crash and to find
the symbol on the 4.4.2 x86 emulator image is by dlopen()-ing the
library and then passing the returned handle to dlsym(). Calling
dlsym() with RTLD_DEFAULT, as we do, does not work, even though the
symbol is resolved properly when called directly. So the loader can
resolve it it's just dlsym() that fails, which seems to indicate that
it's really just a bug in dlsym() (could actually be this bug ).
As is mentioned in the Qt bug report it works on older x86 images (e.g.
the ones for 4.3 or 4.2.2). And fortunately it also works in the new
Android 5.0 x86 image. So it looks like this was just a temporary issue
with the 4.4.2 x86 image.
More information about the Dev