Unsolved Problem while debugging on iMX6 target
-
Good morning,
I'm using the following setup:- QT Creator 4.1.0
- gdb 7.9.1
- uP iMX6
- Qt Version 5.5.1 on target
When I run a simple code example, I get an error in the subroutine:
_dl_debug_initializeat line:
if (r->r_map == NULL || ldbase != 0)I don't understand what happens.
The same source code, with a different QT version (QT 4.8) and a different toolchain (for kernel version 3 instead of 4), runs fine.I understand it is impossible to provide me big hints, but anyone had similar problems?
Here is the output of debugger windows.--- token barrier --- dNOTE: INFERIOR RUN REQUESTED sRun requested... dState changed from InferiorStopOk(14) to InferiorRunRequested(10) [master] sRunning requested... <2460-exec-continue >2460^running dNOTE: INFERIOR RUN OK sRunning. dState changed from InferiorRunRequested(10) to InferiorRunOk(11) [master] >*running,thread-id="all" dNOTE: INFERIOR STILL RUNNING IN STATE InferiorRunOk. >~"\nProgram received signal " >~"SIGSEGV, Segmentation fault.\n" >~"_dl_debug_initialize (ldbase=4294967292, ns=195720) at dl-debug.c:55\n" >~"55\t if (r->r_map == NULL || ldbase != 0)\n" >*stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",frame={addr="0x76fdfcbc",func="_dl_debug_initialize",args=[{name="ldbase",value="4294967292"},{name="ns",value="195720"}],file="dl-debug.c",fullname="/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/usr/src/debug/glibc/2.22-r0/git/elf/dl-debug.c",line="55"},thread-id="1",stopped-threads="all",core="0" dNOTE: INFERIOR SPONTANEOUS STOP sStopped. dState changed from InferiorRunOk(11) to InferiorStopOk(14) [master] dHANDLING SIGNAL SIGSEGV sStopped: Segmentation fault (Signal SIGSEGV). <2461-thread-info >2461^done,threads=[{id="1",target-id="Thread 1171.1171",frame={level="0",addr="0x76fdfcbc",func="_dl_debug_initialize",args=[{name="ldbase",value="4294967292"},{name="ns",value="195720"}],file="dl-debug.c",fullname="/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/usr/src/debug/glibc/2.22-r0/git/elf/dl-debug.c",line="55"},state="stopped",core="0"}],current-thread-id="1" <2462threadnames 20 <2463python theDumper.fetchStack({"limit":20,"nativemixed":0,"token":2463}) >&"threadnames 20\n" >~"[]\n" >2462^done >&"python theDumper.fetchStack({\"limit\":20,\"nativemixed\":0,\"token\":2463})\n" >~"frames=[frame={level=\"0\",address=\"0x76fdfcbc\",function=\"_dl_debug_initialize\",file=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/usr/src/debug/glibc/2.22-r0/git/elf/dl-debug.c\",line=\"55\",module=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/lib/.debug/ld-2.22.so\",language=\"c\"},frame={level=\"1\",address=\"0x76fd2118\",function=\"dl_main\",file=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/usr/src/debug/glibc/2.22-r0/git/elf/rtld.c\",line=\"1463\",module=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/lib/.debug/ld-2.22.so\",language=\"c\"},frame={level=\"2\",address=\"0x76fe6c24\",function=\"_dl_sysdep_start\",file=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/usr/src/debug/glibc/2.22-r0/git/elf/dl-sysdep.c\",line=\"249\",module=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/lib/.debug/ld-2.22.so\",language=\"c\"},frame={level=\"3\",address=\"0x76fd3fcc\",function=\"_dl_start_final\",file=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/usr/src/debug/glibc/2.22-r0/git/elf/rtld.c\",line=\"309\",module=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/lib/.debug/ld-2.22.so\",language=\"c\"},frame={level=\"4\",address=\"0x76fd3fcc\",function=\"_dl_start\",file=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/usr/src/debug/glibc/2.22-r0/git/elf/rtld.c\",line=\"415\",module=\"/opt/nobuos-x11/4.1.15-1.2.0/sysroots/cortexa9hf-vfp-neon-nobuos-linux-gnueabi/lib/.debug/ld-2.22.so\",language=\"c\"},frame={level=\"5\",address=\"0x76fcfb10\",function=\"_start\",file=\"\",line=\"0\",module=\"\",language=\"c\"}]\n" >2463^done <2464-stack-select-frame 0 <2465python theDumper.fetchVariables({"autoderef":1,"context":"","displaystringlimit":"100","dyntype":1,"expanded":["return","watch","local","inspect"],"fancy":1,"formats":{},"nativemixed":0,"partialvar":"","passexceptions":0,"qobjectnames":0,"resultvarname":"","stringcutoff":"10000","token":2465,"typeformats":{},"watchers":[{"exp":"722d3e725f6d6170","iname":"watch.0"}]}) >2464^done >&"python theDumper.fetchVariables({\"autoderef\":1,\"context\":\"\",\"displaystringlimit\":\"100\",\"dyntype\":1,\"expanded\":[\"return\",\"watch\",\"local\",\"inspect\"],\"fancy\":1,\"formats\":{},\"nativemixed\":0,\"partialvar\":\"\",\"passexceptions\":0,\"qobjectnames\":0,\"resultvarname\":\"\",\"stringcutoff\":\"10000\",\"token\":2465,\"typeformats\":{},\"watchers\":[{\"exp\":\"722d3e725f6d6170\",\"iname\":\"watch.0\"}]})\n" >~"data=[{iname=\"local.ldbase\",name=\"ldbase\",numchild=\"0\",type=\"Elf32_Addr\",value=\"4294967292\",},{iname=\"local.ns\",name=\"ns\",numchild=\"0\",type=\"Lmid_t\",value=\"195720\",},{iname=\"local.r\",name=\"r\",numchild=\"0\",type=\"r_debug *\",value=\"0x77e2e8e8\",address=\"0x77e2e8e8\",},{iname=\"watch.0\",wname=\"722d3e725f6d6170\",numchild=\"0\",type=\" \",value=\"<no such value>\",},],typeinfo=[{name=\"73747275637420725f6465627567202a\",size=\"4\"}],partial=\"0\"\n" >~"\"[{}, [['locals', 377], ['all-local.ldbase', 112], ['all-local.ns', 99], ['all-local.r', 1178], ['watches', 882], ['safePrint', 169]]]\"\n" >2465^done <Rebuild Watchmodel 39 @ 18:51:45.285 [8560ms] > sFinished retrieving data
Furthermore, another SW built with the toolchain and GDB settings works fine.
Best regards.
Giovanni -
@Giox79 said in Problem while debugging on iMX6 target:
r
Looks like dereferencing a NULL or dangling pointer. You should check the value of r in that line: is it NULL?
Is _dl_debug_initialize part of that example? If so you can place aqDebug() << r;
just before the if.
-
Thank you jsulm, it seems tha I'm not able to put a qDebug in this source code line.
I will try in another way.
You are able to use qDebug symbol in this subroutine?
Gio -
Good morning Mr jsulm,
looking at the debugger page, it seems that the symbol has a valid value, not null.r Value is 0x77e2e8e8
while
r->r_map value is <no such value>and
ldbase is
1996288000It seems the camera is r pointer is no longer valid (because of r->r_map is not valid)
Gio