segfault in memset
Hi All
Question is - should I report this as a bug or am I the guilty one?
I setup a very simple test program to run FreeRTOS with libopencm3on an STM32F103 Cortex-M3 processor. It compiled and ran fine when compiled with the now unmaintained summon-arm toolchain. When I compiled it recently with gcc-arm-embedded it segfaulted. The location is in a call to memset within FreeRTOS tasks.c, in a section of code not related to the hardware drivers and that should be considered very well tested.
The disassembly of memset starts with
0x08000d04 <+0>: movs r3, r0
0x08000d06 <+2>: b.n 0x800132a
The branch to 0x800132a goes outside the program, the location containing 0xffffffff (unprogrammed). Contents of memory are the same as that in the below source listing
Source listing however seems to have a different idea of what the code does
8000d04: e3100003 tst r0, #3
8000d08: e92d0030 push {r4, r5}
8000d0c: e1a03000 mov r3, r0
8000d10: 0a000037 beq 8000df4 <memset+0xf0>
Just some possibly useless details:
Board is ET-STM32F103 (also happens on an ET-STAMP-STM32 which has a larger capacity device). interestingly the test program worked on an STM32F407 Cortex-M4 but I'll have to check it again in more detail if important.
Ubuntu 13.04 with gcc-arm-none-eabi version 4-7-2013q3-0raring7
gdb is the one provided with the toolchain, using Black Magic Probe for JTAG/SWD.
I have tried other applications I've written and they also segfault, but I haven't yet tracked down where (backtrace unhelpful).
Please let me know if anything else is needed.
cheers, Ken
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Joey Ye
- Solved:
- Last query:
- Last reply: