Debugger reports Segmentation fault
Debugger reports Segmentation fault
Hello,
I am encountering an issue while debugging a TrustZone program on the EK-RA6M5 device using the e2 studio. During the debugging session, GDB crashes with a segmentation fault. The error message indicates that the issue might be related to a bug in GDB itself. The detailed GDB output is as follows:
595,220 2-gdb-version
595,222 ~”GNU gdb (GDB) 12.1-20240924-4314a72b\n”
595,222 ~”Copyright (C) 2022 Free Software Foundation, Inc.\n”
595,222 ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is fre\
e software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitt\
ed by law.”
595,222 ~”\nType \”show copying\” and \”show warranty\” for details.\n”
595,222 ~”This GDB was configured as \”–host=x86_64-pc-linux-gnu –target=arm-none-eabi\”.\n”
595,222 ~”Type \”show configuration\” for configuration details.\n”
595,222 ~”For bug reporting instructions, please see:\n”
595,222 ~”<https://llvm-gcc-renesas.com>.\n”
595,222 ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/\
software/gdb/documentation/>.”
595,222 ~”\n\n”
595,222 ~”For help, type \”help\”.\n”
595,222 ~”Type \”apropos word\” to search for commands related to \”word\”.\n”
595,222 2^done
595,222 (gdb)
595,224 3-environment-cd /home/linux/e2_studio/workspace/mbed_crypto_ns
595,224 3^done
595,225 4-gdb-set breakpoint pending on
595,225 (gdb)
595,225 4^done
595,225 5-gdb-set detach-on-fork on
595,225 (gdb)
595,225 5^done
595,225 (gdb)
595,225 6-enable-pretty-printing
595,225 6^done
595,225 (gdb)
595,226 7-gdb-set python print-stack none
595,226 7^done
595,226 (gdb)
595,226 8-gdb-set print object on
595,226 8^done
595,226 (gdb)
595,226 9-gdb-set print sevenbit-strings on
595,226 9^done
595,226 (gdb)
595,226 10-gdb-set host-charset UTF-8
595,227 10^done
595,227 11-gdb-set target-charset UTF-8
595,227 (gdb)
595,227 11^done
595,227 12-gdb-set target-wide-charset UTF-32
595,227 (gdb)
595,227 12^done
595,227 13source .gdbinit
595,227 (gdb)
595,230 &”source .gdbinit\n”
595,230 &”.gdbinit: No such file or directory.\n”
595,231 13^error,msg=”.gdbinit: No such file or directory.”
595,231 (gdb)
595,231 14-gdb-set non-stop on
595,231 14^done
595,231 (gdb)
595,231 15-gdb-set target-async on
595,232 ~”Warning: ‘set target-async’, an alias for the command ‘set mi-async’, is deprecated.\n”
595,232 ~”Use ‘set mi-async’.\n\n”
595,232 15^done
595,232 (gdb)
595,232 16-gdb-set auto-solib-add on
595,232 16^done
595,232 (gdb)
595,245 17set step-mode off
595,245 &”set step-mode off\n”
595,245 17^done
595,245 (gdb)
595,246 18set breakpoint always-inserted on
595,247 &”set breakpoint always-inserted on\n”
595,247 =cmd-param-changed,param=”breakpoint always-inserted”,value=”on”
595,247 18^done
595,247 (gdb)
595,255 19symbol-file /home/linux/e2_studio/workspace/mbed_crypto_s/Debug/mbed_crypto_s.elf
595,255 &”symbol-file /home/linux/e2_studio/workspace/mbed_crypto_s/Debug/mbed_crypto_s.elf\n”
595,256 20add-sym /home/linux/e2_studio/workspace/mbed_crypto_ns/Debug/mbed_crypto_ns.elf all+0x0
595,263 ~”Reading symbols from /home/linux/e2_studio/workspace/mbed_crypto_s/Debug/mbed_crypto_s.elf\
…\n”
595,269 19^done
595,269 (gdb)
595,272 &”add-sym /home/linux/e2_studio/workspace/mbed_crypto_ns/Debug/mbed_crypto_ns.elf all+0x0\n”\595,276 ~”add symbol table from file \”/home/linux/e2_studio/workspace/mbed_crypto_ns/Debug/mbed_cry\
pto_ns.elf\” at\n”
595,277 &”\n\n”
595,277 &”Fatal signal: ”
595,277 &”Segmentation fault”
595,277 &”\n”
595,277 &”—– Backtrace —–\n”
595,277 &”Backtrace unavailable\n”
595,277 &”———————\n”
595,278 &”A fatal error internal to GDB has been detected, further\ndebugging is not possible. GDB \
will now terminate.\n\n”
595,278 &”This is a bug, please report it.”
595,293 &” For instructions, see:\n”
595,293 &”<https://llvm-gcc-renesas.com>”
595,293 &”.”
595,293 &”\n\n”
595,432 21-list-thread-groups
Are there any suggestions for resolving it? Would it be helpful for your team to debug GDB to pinpoint the cause, or is this more likely related to my program or configuration?
Thank you!
Hello,
Thank you for reaching out to us!
We will try to reproduce the issue, however it would help us if you could provide
– the operating system and toolchain versions
– example project(s) to reproduce the issue
Thank you in advance!
Best regards,
The Open Source Tools Team
Hello,
The operating system version is
– Ubuntu 22.04.3 LTS, running Linux kernel 6.8.0-51-generic
I am using a custom LLVM toolchain to compile the non-secure world project for research needs. So unfortunately, I am unable to provide the toolchain at this time. However, this custom LLVM toolchain has been tested with other programs without encountering similar issues.
I provide an example project as follows, which includes a precompiled .elf file from the non-secure world project that failed to debug.
– https://github.com/LizzyHP/example-project
Please let me know if this is sufficient for reproducing the issue or if you need any further information.
Thank you!
Hello,
Thank you for the example, we managed to reproduce the issue.
We are investigating the cause and we will try to offer a workaround in a couple of days.
Best regards,
The Open Source Tools Team