GDB Segmentation fault

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GDB Segmentation fault

4,343 Views
expertsleepers
Contributor III

Just recently I'm getting a lot of crashes from GDB. Using MCUXpressoIDE 11.8.1 with J-Link V7.94a.

Sometimes when I start a debug session, the code downloads OK but then GDB crashes before I can run the code from the initial breakpoint.

The debugger console gives me the below. Any assistance would be appreciated.

 

GNU gdb (Arm GNU Toolchain 12.2 (Build arm-12.24)) 12.1.90.20221210-git

Copyright (C) 2022 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Type "show copying" and "show warranty" for details.

This GDB was configured as "--host=aarch64-apple-darwin20.6.0 --target=arm-none-eabi".

Type "show configuration" for configuration details.

For bug reporting instructions, please see:

<https://bugs.linaro.org/>.

Find the GDB manual and other documentation resources online at:

<http://www.gnu.org/software/gdb/documentation/>.

 

For help, type "help".

Type "apropos word" to search for commands related to "word".

 

 

 

monitor exec SetRestartOnClose=1

 

Temporary breakpoint 1, main () at ../source/MIMXRT1062_eval_0.1.c:1178

1178 BOARD_ConfigMPU();

 

 

Fatal signal: Segmentation fault: 11

----- Backtrace -----

Backtrace unavailable

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

A fatal error internal to GDB has been detected, further

debugging is not possible. GDB will now terminate.

 

0 Kudos
Reply
9 Replies

4,269 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
I hope you are well.

Are you running any specific SDK example? Did you make some changes on the projects you try to execute?
Is it possible to add a breakpoint after the BOARD config functions?

Best regards,
Omar

0 Kudos
Reply

4,260 Views
expertsleepers
Contributor III
This is my own project, not an SDK example.

I can add breakpoints, but it's pointless, because as I said the debugger crashes before the code can even be run.
0 Kudos
Reply

4,236 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Please attach support data - go to Help => MCUXpresso IDE Save Info for Support.

I would be specifically interested on the GDB traces. As far as I can tell, you're using a Mac with the IDE build specific for Apple silicon. Would it be possible to try the same use case on a Windows/Linux machine as well? It would be helpful to know whether the issue is OS-specific. 

On the other hand, not being able to reproduce the problem on our side, makes it difficult to find the root cause and report the issue to GDB project or suggest a workaround. My recommendation would be to report the seg fault directly to GDB project, as MCUXpresso IDE is delivered with an Arm GNU Toolchain package that ships unmodified (by NXP) GDB.

Regards,
MCUXpresso IDE Support

0 Kudos
Reply

4,233 Views
expertsleepers
Contributor III

Support data attached.

How do I find the gdb traces?

I don't use Windows or Linux, I'm afraid.

I did try to report the seg faults directly to GDB, using the link in the crash message above, but was unable to register an account on their bugzilla server. Do you know of another way to report crashes to the GDB project?

Thanks.

 

0 Kudos
Reply

4,216 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Unfortunately, the zip does not contain the GDB traces... It means that you did not issue a debug session prior to obtaining support info. Please make sure that you reproduce the problem and then export support info, without clearing/removing any console from the Console view.

However, I see in the Eclipse's log several messages related to evaluation of various symbols that you might have added in Expressions view, Global Variables view, Memory view or Variables view. I suggest you close these views (or remove any expression) and see if the problem persists. Maybe you can narrow down the problem and see if GDB is having troubles evaluating any of those symbols.

Regarding the Bugzilla account, I've done this a long time ago and don't remember all the steps. But following the steps from https://sourceware.org/bugzilla/ should get you an account.

Regards,
MCUXpresso IDE Support

0 Kudos
Reply

4,210 Views
expertsleepers
Contributor III

I managed to capture the support information including a gdb log. Please see the attached.

 

0 Kudos
Reply

4,187 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Thank you. I had a quick look and it seems that GDB stops after the IDE requests: 

044,728 278-data-disassemble --thread 1 -s 1610644768 -e 1610644868 -- 3

I suspect this is issued by the Disassembly view. Would you please try with this view closed? Also, I'd try to manually disassemble around 0x60007D20 with GDB. You can also disassemble the ELF with the IDE (right-click the ELF => Binary Utilities => Disassemble). I'm wondering what is so special about that code section.

Regards,
MCUXpresso IDE Support

 

0 Kudos
Reply

4,181 Views
expertsleepers
Contributor III

It does seem to be related to disassembly. I just stopped my code with a breakpoint, then clicked the icon to enter Instruction Stepping Mode, which opened the disassembly view and then crashed gdb.

The logs are attached.

The last line before the crash is

812,174 126-data-disassemble --thread 1 -s 1610641434 -e 1610641574 -- 3

The disassembly of that section from Binary Utilities->Disassemble is attached. It seems to have a lot of unexpected ".word" lines.

I set the breakpoint somewhere else, and managed to get the disassembly view to show without crashing. The contents of the same memory section in that view are also attached.

 

0 Kudos
Reply

4,183 Views
expertsleepers
Contributor III
Thanks. If it happens again, I'll try what you suggest.
0 Kudos
Reply