Protobuf shared library loading hangs

311 views
Skip to first unread message

vikta

unread,
Nov 17, 2011, 1:42:41 AM11/17/11
to android-ndk
Hello, everybody

I have faced with next issue:
System.loadLibrary() hangs on device and emulator with SDK 2.1 and
SDK 2.2, but works fine on SDK 2.3.3 and higher
when i try to load shared library that includes google protobuf
sources.

I tried to load library that contains only sources of google protobuf
(I tried both 2.3.0 and 2.4.1), the issue is same.
Above is "strace" log for protobuf library 2.3.0 on emulator with SDK
2.2, and on all my tries the last call in strace log is always
"recv(-1345054140," after that loading hangs

access("/system/lib/libprotobuf-cpp-2.3.0-full.so", F_OK) = -1 ENOENT
(No such file or directory)
access("/data/data/com.google.protobuf/lib/libprotobuf-cpp-2.3.0-
full.so", F_OK) = 0
writev(3, [{"\3", 1}, {"dalvikvm\0", 9}, {"Trying to load lib /data/
data/co"..., 96}], 3) = 106
stat64("/data/data/com.google.protobuf/lib/libprotobuf-cpp-2.3.0-
full.so", {st_mode=S_IFREG|0755, st_size=853480, ...}) = 0
open("/data/data/com.google.protobuf/lib/libprotobuf-cpp-2.3.0-
full.so", O_RDONLY|O_LARGEFILE) = 29
lseek(29, 0, SEEK_SET) = 0
read(29, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0?
\211\4\000"..., 4096) = 4096
lseek(29, -8, SEEK_END) = 853472
read(29, "\1\0\0\0\0\0\0\0", 8) = 8
mmap2(0x80900000, 909312, PROT_READ|PROT_EXEC, MAP_PRIVATE|
MAP_ANONYMOUS, -1, 0) = 0x80900000
mmap2(0x80900000, 837672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
29, 0) = 0x80900000
mprotect(0x80900000, 839680, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mmap2(0x809d5000, 12728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
29, 0xcd) = 0x809d5000
mmap2(0x809d9000, 19696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANONYMOUS, -1, 0) = 0x809d9000
close(29) = 0
mprotect(0x80900000, 839680, PROT_READ|PROT_EXEC) = 0
getuid32() = 10037
geteuid32() = 10037
getgid32() = 10037
getegid32() = 10037
mprotect(0x40008000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0x40008000, 4096, PROT_READ) = 0
mprotect(0x40008000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0x40008000, 4096, PROT_READ) = 0
recv(-1345054140, <unfinished ...>

It seems that exactly same issue is described here:
http://groups.google.com/group/android-ndk/browse_thread/thread/0a85ba023ecefc3d
and here:
http://code.google.com/p/protobuf/issues/detail?id=325&q=loadLibrary&colspec=ID%20Type%20Status%20Priority%20FixedIn%20Owner%20Summary
and here:
http://code.google.com/p/protobuf/issues/detail?id=326&q=loadLibrary&colspec=ID%20Type%20Status%20Priority%20FixedIn%20Owner%20Summary

And I confirm as it is described in other's posts that on device/
emulator with SDK version lower then 2.3.3 I can successfully load
only "lite" version of protobuf, but not "full" version.

Has anybody successfully loaded "full" version of protobuf library on
device/emulator with SDK version lower then 2.3.3?

I will be very obliged for any help

Reply all
Reply to author
Forward
0 new messages