We have encountered a crash scenario with J-Scope V7.92f (version 7.70e is the last one that does not crash) during parsing of an ELF-file that contains a C++ class with more than one factory method (using arm-none-eabi-g++-12)
Example code to reproduce:
Display All
Trying to load with MAKE_ME_FAIL defined will make max out the CPU usage of J-Scope, until it finally crashes. The screen freezes with this window:
![](https://forum.segger.com/index.php/Attachment/5737-Screenshot-20230926-144616-png/?thumbnail=1&s=613f1aa1e6ddeb42efe0bfdcd65c65324c29376a)
When only using one factory method (MAKE_ME_FAIL is false), the program does not crash, but there are already hints why it goes wrong: there seems to be a recursion when parsing the symbols:
![](https://forum.segger.com/index.php/Attachment/5736-Screenshot-20230926-142929-png/?thumbnail=1&s=613f1aa1e6ddeb42efe0bfdcd65c65324c29376a)
Please provide a fix so our teams can continue using this useful tool with our c++-codebase.
You can use
Display All
Example code to reproduce:
C Source Code: main.cpp
Trying to load with MAKE_ME_FAIL defined will make max out the CPU usage of J-Scope, until it finally crashes. The screen freezes with this window:
When only using one factory method (MAKE_ME_FAIL is false), the program does not crash, but there are already hints why it goes wrong: there seems to be a recursion when parsing the symbols:
Please provide a fix so our teams can continue using this useful tool with our c++-codebase.
You can use
arm-none-eabi-g++ -gdwarf-4 -T linker.ld main.cpp -o main.elf
to reproduce, with this minimum linker file:Source Code
- MEMORY
- {
- FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
- RAM (rw) : ORIGIN = 0x20000000, LENGTH = 20K
- }
- ENTRY(main)
- SECTIONS
- {
- .text : {
- KEEP(*(.vector_table))
- *(.text)
- *(.text*)
- __data_source = .;
- . = ALIGN(4);
- } > FLASH
- .data : {
- __data_start = .;
- *(.data)
- . = ALIGN(4);
- __data_size = SIZEOF(.data);
- } > RAM AT> FLASH
- .bss : {
- __bss_start = .;
- *(.bss)
- *(.bss*)
- . = ALIGN(4);
- __bss_size = SIZEOF(.bss);
- } > RAM
- .stack (NOLOAD) : {
- . = . + 0x400; /* Stack size */
- __stack = .;
- } > RAM
- }
The post was edited 1 time, last by SirCrus ().