mm linker's soinfo::call_constructors: don't assume that soname_ is available.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libhybris (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I'm porting Ubuntu Touch to Samsung Galaxy Tab 2 7.0. As I investigate unity-system-
My current workaround is applying this patch so that it checks whether soname_ is NULL:
--- a/hybris/
+++ b/hybris/
@@ -2177,7 +2177,7 @@
return;
}
- if (strcmp(soname_, "libc.so") == 0) {
+ if (soname_ && strcmp(soname_, "libc.so") == 0) {
DEBUG("HYBRIS: =============> Skipping libc.so\n");
return;
}
Although I'm not sure if this is the correct fix. So, I open this bug so that the people familiar with the codebase can put in the correct fix.
Channel: ubuntu-
Ubuntu build description: 20160715.1
Result from a gdb session:
phablet@
GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://
Find the GDB manual and other documentation resources online at:
<http://
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from unity-system-
done.
(gdb) run --disable-
Starting program: /usr/sbin/
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-
WARNING: linker /android/
WARNING: linker /android/
WARNING: linker /android/
Program received signal SIGSEGV, Segmentation fault.
strcmp () at ../sysdeps/
181 ../sysdeps/
(gdb) print soname_
No symbol "soname_" in current context.
(gdb) bt
#0 strcmp () at ../sysdeps/
#1 0x4087c78a in soinfo:
at linker.cpp:2180
#2 0x4087f2aa in do_dlopen (
name=
flags=
#3 0x4087a9a4 in dlopen_ext (
filename=
extinfo=0x0) at dlfcn.cpp:88
#4 0x40781772 in _hybris_
flag=<optimized out>) at hooks.c:2191
#5 0x40c54ad4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) frame 1
#1 0x4087c78a in soinfo:
at linker.cpp:2180
2180 linker.cpp: No such file or directory.
(gdb) print soname_
$1 = 0x0
(gdb) print this
$2 = (soinfo * const) 0x40c59004
(gdb) print *this
$3 = {phdr = 0x41002034, phnum = 7, entry = 0, base = 1090527232,
size = 32768, dynamic = 0x41008dcc, next = 0x40c5911c, flags_ = 1073741825,
strtab_ = 0x410025d4 "", symtab_ = 0x41002114, nbucket_ = 67, nchain_ = 76,
bucket_ = 0x41002b24, chain_ = 0x41002c30, plt_got_ = 0x0,
plt_rel_ = 0x41003048, plt_rel_count_ = 68, rel_ = 0x41002d60,
rel_count_ = 93, preinit_array_ = 0x0, preinit_
init_array_ = 0x41008dbc, init_array_count_ = 3, fini_array_ = 0x41008dc8,
fini_array_count_ = 1, init_func_ = 0x0, fini_func_ = 0x0,
ARM_exidx = 0x41006b08, ARM_exidx_count = 60, ref_count_ = 1,
link_map_head = {l_addr = 1090527232,
l_name = 0x743e4 "/android/
l_ld = 0x41008dcc, l_next = 0x40c59194, l_prev = 0x40038eb4},
constructors_
has_text_
st_dev_ = 1793, st_ino_ = 816, children_ = {head_ = 0x4002649c,
tail_ = 0x400264cc}, parents_ = {head_ = 0x0, tail_ = 0x0},
file_offset_ = 0, rtld_flags_ = 0, dt_flags_1_ = 1, strtab_size_ = 1351,
gnu_nbucket_ = 0, gnu_bucket_ = 0x0, gnu_chain_ = 0x0, gnu_maskwords_ = 0,
gnu_shift2_ = 0, gnu_bloom_filter_ = 0x0, local_group_root_ = 0x40c59004,
android_relocs_ = 0x0, android_
realpath_ = "/android/
versym_ = 0x0, verdef_ptr_ = 0, verdef_cnt_ = 0, verneed_ptr_ = 0,
verneed_cnt_ = 0, target_sdk_version_ = 23}
(gdb) quit
A debugging session is active.
Inferior 1 [process 3209] will be killed.
Quit anyway? (y or n) y
phablet@
Info for gralloc.omap4.so:
ubuntu-
Dynamic section at offset 0x5dcc contains 28 entries:
Tag Type Name/Value
0x00000003 (PLTGOT) 0x6ee4
0x00000002 (PLTRELSZ) 544 (bytes)
0x00000017 (JMPREL) 0x1048
0x00000014 (PLTREL) REL
0x00000011 (REL) 0xd60
0x00000012 (RELSZ) 744 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffa (RELCOUNT) 92
0x00000006 (SYMTAB) 0x114
0x0000000b (SYMENT) 16 (bytes)
0x00000005 (STRTAB) 0x5d4
0x0000000a (STRSZ) 1351 (bytes)
0x00000004 (HASH) 0xb1c
0x00000001 (NEEDED) Shared library: [libc.so]
0x00000001 (NEEDED) Shared library: [libdl.so]
0x00000001 (NEEDED) Shared library: [libcutils.so]
0x00000001 (NEEDED) Shared library: [libsrv_
0x00000001 (NEEDED) Shared library: [libpvr2d_
0x00000001 (NEEDED) Shared library: [libcorkscrew.so]
0x00000019 (INIT_ARRAY) 0x6dbc
0x0000001b (INIT_ARRAYSZ) 12 (bytes)
0x0000001a (FINI_ARRAY) 0x6dc8
0x0000001c (FINI_ARRAYSZ) 4 (bytes)
0x0000000f (RPATH) Library rpath: [/system/lib]
0x00000010 (SYMBOLIC) 0x0
0x0000001e (FLAGS) SYMBOLIC BIND_NOW
0x6ffffffb (FLAGS_1) Flags: NOW
0x00000000 (NULL) 0x0
ubuntu-
The file itself can be got at https:/