Hi,
I’ve run into a crash. By examining the log, I narrowed it down to a specific ofLogNotice line, here’s the crash log:
10-18 10:57:43.910: I/DEBUG(13362): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-18 10:57:43.910: I/DEBUG(13362): Build fingerprint: 'htc/htc_europe/htc_m8:5.0.1/LRX22C/448934.10:user/release-keys'
10-18 10:57:43.910: I/DEBUG(13362): Revision: '0'
10-18 10:57:43.910: I/DEBUG(13362): ABI: 'arm'
10-18 10:57:43.910: I/DEBUG(13362): pid: 4961, tid: 6383, name: Thread-39082 >>> com.trailze.client <<<
10-18 10:57:43.910: I/DEBUG(13362): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x94b91000
10-18 10:57:44.160: I/DEBUG(13362): r0 00000000 r1 94b91003 r2 94b91000 r3 00000000
10-18 10:57:44.160: I/DEBUG(13362): r4 94b8fe1c r5 ffffffff r6 0000011d r7 94b8fe4c
10-18 10:57:44.160: I/DEBUG(13362): r8 94b8fea0 r9 94b91008 sl 00000000 fp 00000041
10-18 10:57:44.170: I/DEBUG(13362): ip 00000001 sp 94b8fd90 lr 0000011d pc b6f6b4de cpsr 600f0030
10-18 10:57:44.170: I/DEBUG(13362): backtrace:
10-18 10:57:44.170: I/DEBUG(13362): #00 pc 000344de /system/lib/libc.so (__vfprintf+1733)
10-18 10:57:44.170: I/DEBUG(13362): #01 pc 00037dc5 /system/lib/libc.so (vsnprintf+88)
10-18 10:57:44.170: I/DEBUG(13362): #02 pc 00002001 /system/lib/liblog.so (__android_log_print+44)
10-18 10:57:44.170: I/DEBUG(13362): #03 pc 003c82b8 /mnt/asec/com.trailze.client-1/lib/arm/libOFAndroidApp.so (ofxAndroidLogChannel::log(ofLogLevel, std::string const&, std::string const&)+176)
10-18 10:57:44.170: I/DEBUG(13362): #04 pc 00520c6c /mnt/asec/com.trailze.client-1/lib/arm/libOFAndroidApp.so (ofLog::_log(ofLogLevel, std::string const&, std::string const&)+112)
10-18 10:57:44.170: I/DEBUG(13362): #05 pc 00520a88 /mnt/asec/com.trailze.client-1/lib/arm/libOFAndroidApp.so (ofLog::~ofLog()+124)
10-18 10:57:44.170: I/DEBUG(13362): #06 pc 002d2844 /mnt/asec/com.trailze.client-1/lib/arm/libOFAndroidApp.so (ofLogNotice::~ofLogNotice()+52)
I tried to see if there is any foul play in how I’m writing the log, but couldn’t find it. It’s basically like this:
{
MyStruct myStruct = fillTheStruct();
ofLogNotice(“someTag”) << “the value is: “ << myStruct.value;
}
The crash happens about 1 in 10 times. Removing the log line rectified the problem, but I guess the root cause is still present. There are two things that are special in this call. One is that I’m streaming “myStruct.value”, and not a precompiled value. It’s an std::string. Second, that string is quite large (a few thousand characters). But it doesn’t explain the issue, does it?
I couldn’t extract the line numbers (gdb stuff still doesn’t work for some reason), but it’s pretty clear that it crashes in ofxAndroidLogChannel.cpp, line #38:
__android_log_print(androidPrio,module.c_str(),msg.c_str());
I just can’t figure it out. Any ideas?
Thanks,
Tal