Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDB failing on breakpoint in STM32F7 #9219

Closed
josesimoes opened this issue Apr 21, 2022 · 10 comments
Closed

GDB failing on breakpoint in STM32F7 #9219

josesimoes opened this issue Apr 21, 2022 · 10 comments
Labels
debugger external investigate This issue needs to be investigated/confirmed

Comments

@josesimoes
Copy link

Environment

  • OS and version: Windows 10
  • VS Code: 1.66.2
  • C/C++ extension: 1.9.8
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version: 10.3-2021.10

Bug Summary and Steps to Reproduce

Bug Summary: When setting a breakpoint the debug stops (or doesn't start if the breakpoint has been previously set) with the message:

/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

Debugger Configurations

"name": "ORGPAL_PALTHREE nanoCLR",
      "type": "cppdbg",
      "request": "launch",
      "miDebuggerPath": "E:/nftools/GNU_Tools_ARM_Embedded/10.3-2021.10/bin/arm-none-eabi-gdb.exe",
      "program": "${workspaceRoot}/build/nanoCLR.elf",
      "MIMode": "gdb",
      "debugServerPath": "E:/nftools/openocd-ms-v0.11.0/bin/openocd.exe",
      "debugServerArgs": "-s \"E:/nftools/openocd-ms-v0.11.0/scripts/\" -f board/stm32f7discovery.cfg",
      "serverStarted": "Listening on port .* for gdb connections",
      "filterStderr": true,
      "stopAtConnect": false,
      "stopAtEntry": false,
      "cwd": "${cwd}",
      "hardwareBreakpoints": {
        "require": true,
        "limit": 6
      },
      "setupCommands": [
        {
          "text": "target extended-remote localhost:3333"
        },
        {
          "text": "monitor reset_config none separate"
        },
        {
          "text": "monitor reset halt"
        },
        {
          "text": "monitor flash write_image erase \"E:/GitHub/nf-interpreter/build/nanoCLR.hex\" "
        },
        {
          "text": "file E:/GitHub/nf-interpreter/build/nanoCLR.elf"
        },
        {
          "text": "set output-radix 16",
          "description": "set the default numeric base to 16",
          "ignoreFailures": true
        }
      ],
      "logging": {
        "moduleLoad": false,
        "trace": false,
        "engineLogging": false,
        "programOutput": true,
        "exceptions": true
      },
      "launchCompleteCommand": "exec-continue",

Debugger Logs

1: (66100) ->~"Breakpoint 2, ConfigurationManager_UpdateConfigurationBlock (configurationBlock=configurationBlock@entry=0x200617e0, configuration=configuration@entry=DeviceConfigurationOption_Network, configurationIndex=configurationIndex@entry=0x0) at E:/GitHub/nf-interpreter/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp:454\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (66100) ->~\"454\\t    if (configSectorCopy != NULL)\\n\"\r\n"},"seq":611}
1: (66100) ->~"454\t    if (configSectorCopy != NULL)\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Breakpoint 2, ConfigurationManager_UpdateConfigurationBlock (configurationBlock=configurationBlock@entry=0x200617e0, configuration=configuration@entry=DeviceConfigurationOption_Network, configurationIndex=configurationIndex@entry=0x0) at E:/GitHub/nf-interpreter/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp:454\n"},"seq":613}
Breakpoint 2, ConfigurationManager_UpdateConfigurationBlock (configurationBlock=configurationBlock@entry=0x200617e0, configuration=configuration@entry=DeviceConfigurationOption_Network, configurationIndex=configurationIndex@entry=0x0) at E:/GitHub/nf-interpreter/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp:454
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (66100) ->*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"2\",frame={addr=\"0x00246f4c\",func=\"ConfigurationManager_UpdateConfigurationBlock\",args=[{name=\"configurationBlock\",value=\"0x200617e0\"},{name=\"configurationBlock@entry\",value=\"0x200617e0\"},{name=\"configuration\",value=\"DeviceConfigurationOption_Network\"},{name=\"configuration@entry\",value=\"DeviceConfigurationOption_Network\"},{name=\"configurationIndex\",value=\"0x0\"},{name=\"configurationIndex@entry\",value=\"0x0\"}],file=\"E:/GitHub/nf-interpreter/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp\",fullname=\"E:\\\\GitHub\\\\nf-interpreter\\\\targets\\\\ChibiOS\\\\_common\\\\targetHAL_ConfigurationManager.cpp\",line=\"454\",arch=\"armv7e-m\"},thread-id=\"1\",stopped-threads=\"all\"\r\n"},"seq":614}
1: (66100) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="2",frame={addr="0x00246f4c",func="ConfigurationManager_UpdateConfigurationBlock",args=[{name="configurationBlock",value="0x200617e0"},{name="configurationBlock@entry",value="0x200617e0"},{name="configuration",value="DeviceConfigurationOption_Network"},{name="configuration@entry",value="DeviceConfigurationOption_Network"},{name="configurationIndex",value="0x0"},{name="configurationIndex@entry",value="0x0"}],file="E:/GitHub/nf-interpreter/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp",fullname="E:\\GitHub\\nf-interpreter\\targets\\ChibiOS\\_common\\targetHAL_ConfigurationManager.cpp",line="454",arch="armv7e-m"},thread-id="1",stopped-threads="all"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"454\t    if (configSectorCopy != NULL)\n"},"seq":617}
454	    if (configSectorCopy != NULL)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (66101) <-1024-stack-list-frames 0 1000\r\n"},"seq":619}
1: (66101) <-1024-stack-list-frames 0 1000
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75537) ->~\"/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.\\nA problem internal to GDB has been detected,\\nfurther debugging may prove unreliable.\"\r\n"},"seq":621}
1: (75537) ->~"/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable."
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75538) ->~\"\\nQuit this debugging session? \"\r\n"},"seq":623}
1: (75538) ->~"\nQuit this debugging session? "
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75538) ->~\"(y or n) [answered Y; input not from terminal]\\n\"\r\n"},"seq":625}
1: (75538) ->~"(y or n) [answered Y; input not from terminal]\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75538) ->&\"\\nThis is a bug, please report it.\"\r\n"},"seq":627}
1: (75538) ->&"\nThis is a bug, please report it."
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75538) ->&\"  For instructions, see:\\n\"\r\n"},"seq":630}
1: (75538) ->&"  For instructions, see:\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable."},"seq":629}
/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75538) ->&\"<https://www.gnu.org/software/gdb/bugs/>.\\n\\n\"\r\n"},"seq":633}
1: (75538) ->&"<https://www.gnu.org/software/gdb/bugs/>.\n\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"\nQuit this debugging session? "},"seq":635}

Quit this debugging session?
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75538) ->~\"/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.\\nA problem internal to GDB has been detected,\\nfurther debugging may prove unreliable.\"\r\n"},"seq":637}
1: (75538) ->~"/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable."
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"(y or n) [answered Y; input not from terminal]\n"},"seq":639}
(y or n) [answered Y; input not from terminal]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75538) ->~\"\\nCreate a core file of GDB? \"\r\n"},"seq":641}
1: (75538) ->~"\nCreate a core file of GDB? "
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable."},"seq":643}
/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75538) ->~\"(y or n) [answered Y; input not from terminal]\\n\"\r\n"},"seq":645}
1: (75538) ->~"(y or n) [answered Y; input not from terminal]\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"\nCreate a core file of GDB? "},"seq":647}

Create a core file of GDB?
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"(y or n) [answered Y; input not from terminal]\n"},"seq":649}
(y or n) [answered Y; input not from terminal]
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"openocd: Info : dropped 'gdb' connection\n"},"seq":651}
openocd: Info : dropped 'gdb' connection
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75689) \"E:/nftools/GNU_Tools_ARM_Embedded/10.3-2021.10/bin/arm-none-eabi-gdb.exe\" exited with code 3 (0x3).\r\n"},"seq":653}
1: (75689) "E:/nftools/GNU_Tools_ARM_Embedded/10.3-2021.10/bin/arm-none-eabi-gdb.exe" exited with code 3 (0x3).
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75692) <-logout\r\n"},"seq":655}
1: (75692) <-logout
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75693) <-logout\r\n"},"seq":657}
1: (75693) <-logout
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75695) Send Event AD7MessageEvent\r\n"},"seq":659}
1: (75695) Send Event AD7MessageEvent
--> E (output): {"type":"event","event":"output","body":{"category":"stderr","output":"ERROR: Error while trying to enter break state. Debugging will now stop. GDB exited unexpectedly with exit code 3 (0x3).\r\n"},"seq":661}
ERROR: Error while trying to enter break state. Debugging will now stop. GDB exited unexpectedly with exit code 3 (0x3).
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75696) Send Event AD7ProgramDestroyEvent\r\n"},"seq":663}
1: (75696) Send Event AD7ProgramDestroyEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"The program 'E:\\GitHub\\nf-interpreter/build/nanoCLR.elf' has exited with code 42 (0x0000002a).\r\n\r\n"},"seq":665}
The program 'E:\GitHub\nf-interpreter/build/nanoCLR.elf' has exited with code 42 (0x0000002a).
--> E (exited): {"type":"event","event":"exited","body":{"exitCode":42},"seq":667}
--> E (terminated): {"type":"event","event":"terminated","body":{},"seq":669}
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/DebugCompleted","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"17.1.20405.1","VS.Diagnostics.Debugger.HostVersion":"17.1.20405.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":0}},"seq":671}
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/MIEngine/DebuggerAborted","data":{"VS.Diagnostics.Debugger.MIEngine.DebuggerName":"GDB","VS.Diagnostics.Debugger.MIEngine.LastSentCommandName":"-stack-list-frames","VS.Diagnostics.Debugger.MIEngine.DebuggerExitCode":"3 (0x3)"}},"seq":673}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (75703) Send Event AD7MessageEvent\r\n"},"seq":675}
1: (75703) Send Event AD7MessageEvent
--> E (output): {"type":"event","event":"output","body":{"category":"stderr","output":"ERROR: GDB exited unexpectedly with exit code 3 (0x3). Debugging will now abort.\r\n"},"seq":677}
ERROR: GDB exited unexpectedly with exit code 3 (0x3). Debugging will now abort.
<--   C (disconnect-26): {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":26}
--> R (disconnect-26): {"type":"response","request_seq":26,"success":true,"command":"disconnect","body":{},"seq":680}

Other Extensions

No response

Additional Information

Any hits on how I can get more details or get past this?
Thanks!

@WardenGnaw
Copy link
Member

WardenGnaw commented Apr 21, 2022

It looks like an issue with the version of GDB you are using. My only suggestion is to try upgrading to a later version GDB.

It is requesting stack frames -stack-list-frames 0 1000, but it errors with:

/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected, further debugging may prove unreliable.

If you go through the logs, you can see all the commands we send to GDB.
E.g.

1: (66101) <-1024-stack-list-frames 0 1000

There will be other commands in the log similar to the format <-####-[command] that the gdb maintainers can find useful to reproduce this bug.

You may want to share the steps to https://sourceware.org/bugzilla/

@josesimoes
Copy link
Author

OK... I was afraid that you would say something like this... 😐

I'm on the latest official GCC version so there is no newer one.
I'll report it over there and link it here.

If you have any other suggestions I would really appreciate it!

@josesimoes
Copy link
Author

Seems that there is already a report of this same bug.
Adding it here for reference: https://sourceware.org/bugzilla/show_bug.cgi?id=28219

@josesimoes
Copy link
Author

Worth mentioning that this same code, when compiled and running on a different MCU series (STM32F4 or L4), the issue DOES NOT happen.

@github-actions
Copy link

This issue has been closed automatically because it's labeled as 'external'.

@josesimoes
Copy link
Author

I've updated to the latest GCC 11.2-2022.02 and the exception is the same.
Trying to roll back and went as far as GCC 8-2019-q3-update. Exception is the same.

I've also tried several builds of OpenOCD from the Microsoft one (openocd-ms-v0.11.0) to early versions that I had around.

This feels a bit odd, as despite the underlying tools change the behavior remains. I've debug this code with these several months ago.

@WardenGnaw can I ask you to please reopen this so it can be investigated? Let me know what other details I can provide to help getting to the bottom of this.

@WardenGnaw WardenGnaw reopened this May 4, 2022
@WardenGnaw
Copy link
Member

This issue has been re-opened as requested, but the core issue is in gdb itself.

In the linked bug, it mentions

This issue does not occur with GNU Arm Embedded Toolchain 9-2020-q2-update.

Does this toolchain version not work either?

@WardenGnaw WardenGnaw added the investigate This issue needs to be investigated/confirmed label May 4, 2022
@josesimoes
Copy link
Author

josesimoes commented May 4, 2022

In the linked bug, it mentions

This issue does not occur with GNU Arm Embedded Toolchain 9-2020-q2-update.

Does this toolchain version not work either?

When I've raised the issue, coincidentally, that was the last version I recall using on which I debug successfully.
As I've mentioned above, I went and rolled back GCC all version down to 8-2019-q3-update. On all of them I could se the reported issue.

@josesimoes
Copy link
Author

josesimoes commented May 4, 2022

Here's some extra information about this: I'm compiling with -Og and originally with -ggdb3.
With this I could set the stopAtEntry option, it would stop at main() but F10 was incredibly slow. Hitting F5 would continue execution but, on hitting the pause button, the gbd overflow exception would pop and the debug would be terminated.

After changing the build options to -ggdb (or just -g) the debug started to work again. Stops at main(). F10 moves swiftly to the next line. F5 resumes execution. And I can hit pause and continue as many times as I want.

Tested this with gdb from GCC 8-2019-q3-update and the latest 11.2-2022.02.

I'm reporting this too to the bugzilla issue.

@github-actions
Copy link

github-actions bot commented May 5, 2022

This issue has been closed because it is external or not applicable to the extension.

@github-actions github-actions bot closed this as completed May 5, 2022
hydra added a commit to hydra/betaflight that referenced this issue Jul 12, 2023
Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

microsoft/vscode-cpptools#9219 (comment)
hydra added a commit to hydra/betaflight that referenced this issue Jul 19, 2023
The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
microsoft/vscode-cpptools#9219 (comment)
hydra added a commit to hydra/betaflight that referenced this issue Jul 19, 2023
The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* microsoft/vscode-cpptools#9219 (comment)

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
hydra added a commit to hydra/betaflight that referenced this issue Jul 24, 2023
The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* microsoft/vscode-cpptools#9219 (comment)

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
hydra added a commit to hydra/betaflight that referenced this issue Jul 24, 2023
The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* microsoft/vscode-cpptools#9219 (comment)

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
hydra added a commit to hydra/betaflight that referenced this issue Jul 24, 2023
The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* microsoft/vscode-cpptools#9219 (comment)

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
blckmn pushed a commit to betaflight/betaflight that referenced this issue Jul 25, 2023
…12971)

Makefile - use gddb2, not gddb3 due to issues with GDB crashing.

The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* microsoft/vscode-cpptools#9219 (comment)

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
freasy pushed a commit to freasy/betaflight that referenced this issue Aug 14, 2023
…etaflight#12971)

Makefile - use gddb2, not gddb3 due to issues with GDB crashing.

The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* microsoft/vscode-cpptools#9219 (comment)

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
davidbitton pushed a commit to davidbitton/betaflight that referenced this issue Feb 5, 2024
…etaflight#12971)

Makefile - use gddb2, not gddb3 due to issues with GDB crashing.

The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* microsoft/vscode-cpptools#9219 (comment)

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger external investigate This issue needs to be investigated/confirmed
Projects
None yet
Development

No branches or pull requests

2 participants