Open Bug 882329 Opened 9 years ago Updated 9 years ago

Segfault in ElfLoader::DebuggerHelper::Add

Categories

(Core :: mozglue, defect)

ARM
Android
defect
Not set
normal

Tracking

()

People

(Reporter: jseward, Unassigned)

Details

The new linker segfaults when connected to GDB(JimDB).  This makes it 
difficult to use JimDB to investigate other segfaults in Fennec.

m-c 134766:ec0b9531dda9

built using mobile/android/config/mozconfigs/android/nightly with
diffs as shown below.

JimDB recently "git pull"ed

Android 4.0 on Xoom

Start JimDB.  Select

2. Debug Fennec with env vars and args

give it path to objdir

give it the following for "Enter environmental variables and arguments"

MOZ_PROFILER_INTERVAL=50 MOZ_PROFILER_MODE=native MOZ_PROFILER_NEW=1 MOZ_PROFILER_VERBOSE=1 MOZ_PROFILER_STARTUP=1 MOZ_LINKER_ONDEMAND=0 MOZ_LINKER_EXTRACT=1

continue

[New Thread 7178]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 7178]
0xb00055f2 in ?? () from /home/sewardj/MOZ/JimDB/jimdb/lib/0288504044c06217/system/bin/linker
(gdb) where
#0  0xb00055f2 in ?? () from /home/sewardj/MOZ/JimDB/jimdb/lib/0288504044c06217/system/bin/linker
#1  0xb000593e in ?? () from /home/sewardj/MOZ/JimDB/jimdb/lib/0288504044c06217/system/bin/linker
#2  0x5b6e2024 in ElfLoader::DebuggerHelper::Add (this=0x5b716374 <ElfLoader::Singleton+68>, map=0x6556d014)
    at /home/sewardj/MOZ/MC-12-06-2013/mozglue/linker/ElfLoader.cpp:767
#3  0x5b6e2d96 in ElfLoader::Register (this=0x5b716330 <ElfLoader::Singleton>, handle=0x6556d000)
    at /home/sewardj/MOZ/MC-12-06-2013/mozglue/linker/ElfLoader.cpp:410
#4  0x5b6e1836 in CustomElf::Load (mappable=0x64a3c3f0, path=<optimized out>, flags=<optimized out>)
    at /home/sewardj/MOZ/MC-12-06-2013/mozglue/linker/CustomElf.cpp:216
#5  0x5b6e2fb2 in ElfLoader::Load (this=<optimized out>, path=0x64a36440 "/data/app/org.mozilla.fennec-2.apk!/libsoftokn3.so", flags=0, parent=0x0)
    at /home/sewardj/MOZ/MC-12-06-2013/mozglue/linker/ElfLoader.cpp:339
#6  0x5b6e30a4 in __wrap_dlopen (path=<optimized out>, flags=<optimized out>) at /home/sewardj/MOZ/MC-12-06-2013/mozglue/linker/ElfLoader.cpp:52
#7  0x5e1034c4 in pr_LoadLibraryByPathname (name=0x64a36440 "/data/app/org.mozilla.fennec-2.apk!/libsoftokn3.so", flags=<optimized out>)
    at /home/sewardj/MOZ/MC-12-06-2013/nsprpub/pr/src/linking/prlink.c:803
#8  0x5e103800 in PR_LoadLibraryWithFlags (libSpec=..., flags=<optimized out>) at /home/sewardj/MOZ/MC-12-06-2013/nsprpub/pr/src/linking/prlink.c:418
#9  0x5e04fb66 in loader_LoadLibInReferenceDir (referencePath=0x653853d0 "/data/app/org.mozilla.fennec-2.apk!/libnss3.so", 
    name=0x5e17c338 "libsoftokn3.so") at secload.c:84
#10 0x5e04fb98 in PORT_LoadLibraryFromOrigin (existingShLibName=<optimized out>, staticShLibFunc=<optimized out>, 
    newShLibName=0x5e17c338 "libsoftokn3.so") at secload.c:150
#11 0x5e063bae in softoken_LoadDSO () at pk11load.c:342
#12 0x5e101fa6 in PR_CallOnce (once=0x5e1a778c <loadSoftokenOnce>, func=0x5e063b9d <softoken_LoadDSO>)
    at /home/sewardj/MOZ/MC-12-06-2013/nsprpub/pr/src/misc/prinit.c:775
#13 0x5e06a6e2 in secmod_LoadPKCS11Module (mod=0x657f1210, oldModule=0x5c18bc24) at pk11load.c:374
#14 0x5e07166e in SECMOD_LoadModule (
    modulespec=0x64ac3c00 "name=\"PSM Internal Crypto Services\" parameters=\"configdir='/data/data/org.mozilla.fennec/files/mozilla/q7yvs4g9.default' certPrefix='' keyPrefix='' secmod='secmod.db' flags=optimizeSpace updatedir='' "..., parent=0x0, recurse=1) at pk11pars.c:1010
#15 0x5e0d7180 in nss_InitModules (isContextInit=0, optimizeSpace=1, forceOpen=0, noModDB=0, noCertDB=0, readOnly=0, pwRequired=<optimized out>, 
    configStrings=0x65789540 " manufacturerID='Mozilla.org' libraryDescription='PSM Internal Crypto Services' cryptoTokenDescription='Generic Crypto Services' dbTokenDescription='Software Security Device' cryptoSlotDescription='PS"..., configName=<optimized out>, updateName=0x5e18a554 "", 
    updateID=0x5e18a554 "", updKeyPrefix=0x5e18a554 "", updCertPrefix=0x5e18a554 "", updateDir=0x5e18a554 "", secmodName=0x5fc0c400 "secmod.db", 
    keyPrefix=0x6557b4f8 "", certPrefix=<optimized out>, configdir=0x5b934a68 "/data/data/org.mozilla.fennec/files/mozilla/q7yvs4g9.default")
    at nssinit.c:435
#16 nss_Init (configdir=0x5b934a68 "/data/data/org.mozilla.fennec/files/mozilla/q7yvs4g9.default", certPrefix=<optimized out>, 
    keyPrefix=0x6557b4f8 "", secmodName=0x5fc0c400 "secmod.db", updateDir=0x5e18a554 "", updCertPrefix=0x5e18a554 "", updKeyPrefix=0x5e18a554 "", 
    updateID=0x5e18a554 "", updateName=0x5e18a554 "", initContextPtr=0x0, initParams=0x0, readOnly=0, noCertDB=0, noModDB=0, forceOpen=0, 
    noRootInit=1, optimizeSpace=1, noSingleThreadedModules=0, allowAlreadyInitializedModules=0, dontFinalizeModules=0) at nssinit.c:639
#17 0x5e0d77c2 in NSS_Initialize (configdir=<optimized out>, certPrefix=<optimized out>, keyPrefix=<optimized out>, secmodName=<optimized out>, 
    flags=48) at nssinit.c:813
#18 0x5ed06a8e in nsNSSComponent::InitializeNSS (this=0x5d70f880, showWarningBox=<optimized out>)
    at /home/sewardj/MOZ/MC-12-06-2013/security/manager/ssl/src/nsNSSComponent.cpp:1730
#19 0x5ed07406 in nsNSSComponent::Init (this=0x5d70f880) at /home/sewardj/MOZ/MC-12-06-2013/security/manager/ssl/src/nsNSSComponent.cpp:1958
#20 0x5ed0c764 in nsNSSComponentConstructor (aOuter=<optimized out>, aIID=..., aResult=0x5c18be58)
    at /home/sewardj/MOZ/MC-12-06-2013/security/manager/ssl/src/nsNSSModule.cpp:162
#21 0x5f141630 in mozilla::GenericFactory::CreateInstance (this=<optimized out>, aOuter=<optimized out>, aIID=..., aResult=<optimized out>)
    at /home/sewardj/MOZ/MC-12-06-2013/obj-x86_64-unknown-linux-gnu/xpcom/build/GenericFactory.cpp:16
#22 0x5f1688f8 in nsComponentManagerImpl::CreateInstanceByContractID (this=<optimized out>, aContractID=<optimized out>, aDelegate=0x0, aIID=..., 
    aResult=0x5c18be58) at /home/sewardj/MOZ/MC-12-06-2013/xpcom/components/nsComponentManager.cpp:1093
#23 0x5f16a51c in nsComponentManagerImpl::GetServiceByContractID (this=0x5b9c1100, aContractID=0x5fc0be70 "@mozilla.org/psm;1", aIID=..., 
    result=0x5c18beb4) at /home/sewardj/MOZ/MC-12-06-2013/xpcom/components/nsComponentManager.cpp:1449


ElfLoader.cpp:767 is the first

  dbg->r_brk();

in ElfLoader::DebuggerHelper::Add

------------------

diff --git a/mobile/android/config/mozconfigs/android/nightly b/mobile/android/config/mozconfigs/android/nightly
--- a/mobile/android/config/mozconfigs/android/nightly
+++ b/mobile/android/config/mozconfigs/android/nightly
@@ -1,30 +1,37 @@
 . "$topsrcdir/mobile/android/config/mozconfigs/common"
 
 # Build Fennec
 ac_add_options --enable-application=mobile/android
 
 # Android
 ac_add_options --target=arm-linux-androideabi
 
-if test `uname -m` = 'x86_64'; then
-  ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
-  ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux/platforms/android-16"
-else
+#if test `uname -m` = 'x86_64'; then
+#  ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
+#  ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux/platforms/android-16"
+#else
   ac_add_options --with-android-ndk="/tools/android-ndk-r8c"
   ac_add_options --with-android-sdk="/tools/android-sdk-r16/platforms/android-16"
-fi
+#fi
 
-ac_add_options --with-android-gnu-compiler-version=4.7
+#ac_add_options --with-android-gnu-compiler-version=4.7
+ac_add_options --with-android-gnu-compiler-version=4.6
 ac_add_options --with-android-version=9
 ac_add_options --with-system-zlib
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-profiling
 
+##
+ac_add_options --enable-valgrind
+ac_add_options --disable-crashreporter
+ac_add_options --enable-optimize="-g -O"
+##
+
 export JAVA_HOME=/tools/jdk6
 export MOZILLA_OFFICIAL=1
 export MOZ_TELEMETRY_REPORTING=1
 
 ac_add_options --with-branding=mobile/android/branding/nightly
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
You need to log in before you can comment on or make changes to this bug.