Closed j123b567 closed 5 years ago
thank you for reporting this, but I don't maintain openocd, I just pack it and distribute for user convenience.
I suggest you try the latest openocd version built from the main repository, and, if the problem is still there, report it to the maintainers.
You are producing heavily patched version of OpenOCD. I can't reproduce this with upstream OpenOCD. Upstream version 0.10.0 works Upstream version from 20180117 (commit edb67962865d5d3cc4a8ec1790b4c8c5327e98fd) works Upstream version head (commit 2b47ded8dee5ba52d47ce7cbc8b643ae4a3663ae) works
Oops! It might be possible that some of the RISC-V patches to interfere with ST-LINK.
The RISC-V guys are cleaning their code and contributing upstream.
I'll try to make a new release, hopefully it'll be less problematic.
I just released 0.10.0-8, with the latest commits. There are many cleanups in the RISC-V code.
Could you check if the problem was solved?
I'm still getting a similar problem ... I ran OpenOCD in gdb, and also printed out the backtrace. Hope that helps .. This was done with an stm32 Nucleo 144 board.
[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Open On-Chip Debugger 0.10.0+dev-dirty (2018-06-01-19:51) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD adapter speed: 500 kHz adapter_nsrst_delay: 100 none separate srst_only separate srst_nogate srst_open_drain connect_deassert_srst Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : Unable to match requested speed 500 kHz, using 480 kHz Info : Unable to match requested speed 500 kHz, using 480 kHz Info : clock speed 480 kHz [New Thread 0x7ffff6ec2700 (LWP 3558)] Info : STLINK v2 JTAG v28 API v2 SWIM v18 VID 0x0483 PID 0x374B Info : using stlink api v2 Info : Target voltage: 3.225000 Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints Info : Listening on port 3333 for gdb connections Info : accepting 'gdb' connection on tcp/3333 target halted due to debug-request, current mode: Handler External Interrupt(86) xPSR: 0x21000066 pc: 0x08004a40 msp: 0x200003f0 Info : device id = 0x20006461 Info : flash size = 1024kbytes Info : Unable to match requested speed 500 kHz, using 480 kHz Info : Unable to match requested speed 500 kHz, using 480 kHz adapter speed: 480 kHz Error: timed out while waiting for target halted Error in `/usr/local/bin/openocd': double free or corruption (fasttop): 0x0000000000967490 ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7ffff735f7e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7ffff736837a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7ffff736c53c] /usr/local/bin/openocd[0x556416] ======= Memory map: ======== 00400000-00667000 r-xp 00000000 fd:00 263489 /usr/local/bin/openocd 00867000-00868000 r--p 00267000 fd:00 263489 /usr/local/bin/openocd 00868000-00872000 rw-p 00268000 fd:00 263489 /usr/local/bin/openocd 00872000-00b01000 rw-p 00000000 00:00 0 [heap] 7ffff0000000-7ffff0021000 rw-p 00000000 00:00 0 7ffff0021000-7ffff4000000 ---p 00000000 00:00 0 7ffff64ac000-7ffff64c2000 r-xp 00000000 fd:00 787560 /lib/x86_64-linux-gnu/libgcc_s.so.1 7ffff64c2000-7ffff66c1000 ---p 00016000 fd:00 787560 /lib/x86_64-linux-gnu/libgcc_s.so.1 7ffff66c1000-7ffff66c2000 rw-p 00015000 fd:00 787560 /lib/x86_64-linux-gnu/libgcc_s.so.1 7ffff66c2000-7ffff66c3000 ---p 00000000 00:00 0 7ffff66c3000-7ffff6ec3000 rw-p 00000000 00:00 0 7ffff6ec3000-7ffff6eca000 r-xp 00000000 fd:00 827899 /lib/x86_64-linux-gnu/librt-2.23.so 7ffff6eca000-7ffff70c9000 ---p 00007000 fd:00 827899 /lib/x86_64-linux-gnu/librt-2.23.so 7ffff70c9000-7ffff70ca000 r--p 00006000 fd:00 827899 /lib/x86_64-linux-gnu/librt-2.23.so 7ffff70ca000-7ffff70cb000 rw-p 00007000 fd:00 827899 /lib/x86_64-linux-gnu/librt-2.23.so 7ffff70cb000-7ffff70e3000 r-xp 00000000 fd:00 817470 /lib/x86_64-linux-gnu/libpthread-2.23.so 7ffff70e3000-7ffff72e2000 ---p 00018000 fd:00 817470 /lib/x86_64-linux-gnu/libpthread-2.23.so 7ffff72e2000-7ffff72e3000 r--p 00017000 fd:00 817470 /lib/x86_64-linux-gnu/libpthread-2.23.so 7ffff72e3000-7ffff72e4000 rw-p 00018000 fd:00 817470 /lib/x86_64-linux-gnu/libpthread-2.23.so 7ffff72e4000-7ffff72e8000 rw-p 00000000 00:00 0 7ffff72e8000-7ffff74a8000 r-xp 00000000 fd:00 817662 /lib/x86_64-linux-gnu/libc-2.23.so 7ffff74a8000-7ffff76a8000 ---p 001c0000 fd:00 817662 /lib/x86_64-linux-gnu/libc-2.23.so 7ffff76a8000-7ffff76ac000 r--p 001c0000 fd:00 817662 /lib/x86_64-linux-gnu/libc-2.23.so 7ffff76ac000-7ffff76ae000 rw-p 001c4000 fd:00 817662 /lib/x86_64-linux-gnu/libc-2.23.so 7ffff76ae000-7ffff76b2000 rw-p 00000000 00:00 0 7ffff76b2000-7ffff76b5000 r-xp 00000000 fd:00 817836 /lib/x86_64-linux-gnu/libdl-2.23.so 7ffff76b5000-7ffff78b4000 ---p 00003000 fd:00 817836 /lib/x86_64-linux-gnu/libdl-2.23.so 7ffff78b4000-7ffff78b5000 r--p 00002000 fd:00 817836 /lib/x86_64-linux-gnu/libdl-2.23.so 7ffff78b5000-7ffff78b6000 rw-p 00003000 fd:00 817836 /lib/x86_64-linux-gnu/libdl-2.23.so 7ffff78b6000-7ffff79be000 r-xp 00000000 fd:00 782001 /lib/x86_64-linux-gnu/libm-2.23.so 7ffff79be000-7ffff7bbd000 ---p 00108000 fd:00 782001 /lib/x86_64-linux-gnu/libm-2.23.so 7ffff7bbd000-7ffff7bbe000 r--p 00107000 fd:00 782001 /lib/x86_64-linux-gnu/libm-2.23.so 7ffff7bbe000-7ffff7bbf000 rw-p 00108000 fd:00 782001 /lib/x86_64-linux-gnu/libm-2.23.so 7ffff7bbf000-7ffff7bd6000 r-xp 00000000 fd:00 787702 /lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0 7ffff7bd6000-7ffff7dd5000 ---p 00017000 fd:00 787702 /lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0 7ffff7dd5000-7ffff7dd6000 r--p 00016000 fd:00 787702 /lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0 7ffff7dd6000-7ffff7dd7000 rw-p 00017000 fd:00 787702 /lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0 7ffff7dd7000-7ffff7dfd000 r-xp 00000000 fd:00 817247 /lib/x86_64-linux-gnu/ld-2.23.so 7ffff7fb5000-7ffff7fb9000 rw-p 00000000 00:00 0 7ffff7fb9000-7ffff7fd7000 r-xp 00000000 fd:00 787085 /lib/x86_64-linux-gnu/libudev.so.1.6.4 7ffff7fd7000-7ffff7fd8000 r--p 0001d000 fd:00 787085 /lib/x86_64-linux-gnu/libudev.so.1.6.4 7ffff7fd8000-7ffff7fd9000 rw-p 0001e000 fd:00 787085 /lib/x86_64-linux-gnu/libudev.so.1.6.4 7ffff7fd9000-7ffff7fdb000 rw-p 00000000 00:00 0 7ffff7ff7000-7ffff7ff8000 rw-p 00000000 00:00 0 7ffff7ff8000-7ffff7ffa000 r--p 00000000 00:00 0 [vvar] 7ffff7ffa000-7ffff7ffc000 r-xp 00000000 00:00 0 [vdso] 7ffff7ffc000-7ffff7ffd000 r--p 00025000 fd:00 817247 /lib/x86_64-linux-gnu/ld-2.23.so 7ffff7ffd000-7ffff7ffe000 rw-p 00026000 fd:00 817247 /lib/x86_64-linux-gnu/ld-2.23.so 7ffff7ffe000-7ffff7fff000 rw-p 00000000 00:00 0 7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0 [stack] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Thread 1 "openocd" received signal SIGABRT, Aborted. 0x00007ffff731d428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt
Open On-Chip Debugger 0.10.0+dev-dirty (2018-06-01-19:51)
where did you get this version?
could you retry with the latest release (-10)? I removed most of the risc-v code, now it should not differ from the upstream version.
I will try this with Linux and Windows version within few days.
I can confirm that this issue is present by using gnu-mcu-eclipse-openocd-0.10.0-10-20181020-0522-centos64.tgz
$ /opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -c 'transport select hla_swd' -c 'hla_serial 0676FF574953867567204520' -f /opt/openocd/scripts/target/stm32f7x.cfg -c init -c 'reset halt' -c 'program application.hex verify reset' -c exit
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00352-gaa6c7e9b (2018-10-20-06:18)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2-1.cfg is deprecated, please switch to interface/stlink.cfg
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v28 API v2 SWIM v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.232941
Info : stm32f7x.cpu: hardware has 8 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Error: timed out while waiting for target halted
*** Error in `/opt/openocd/bin/openocd': double free or corruption (fasttop): 0x000000000154f980 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fd6b0f727e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fd6b0f7b37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fd6b0f7f53c]
/opt/openocd/bin/openocd[0x596136]
======= Memory map: ========
003ff000-00400000 rw-p 00000000 08:09 663697 /opt/openocd/bin/openocd
00400000-006e3000 r-xp 00001000 08:09 663697 /opt/openocd/bin/openocd
008e2000-008e3000 r--p 002e3000 08:09 663697 /opt/openocd/bin/openocd
008e3000-008f9000 rw-p 002e4000 08:09 663697 /opt/openocd/bin/openocd
008f9000-0097b000 rw-p 00000000 00:00 0
013dc000-01671000 rw-p 00000000 00:00 0 [heap]
7fd6ac000000-7fd6ac021000 rw-p 00000000 00:00 0
7fd6ac021000-7fd6b0000000 ---p 00000000 00:00 0
7fd6b04e4000-7fd6b04fa000 r-xp 00000000 08:09 529319 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd6b04fa000-7fd6b06f9000 ---p 00016000 08:09 529319 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd6b06f9000-7fd6b06fa000 rw-p 00015000 08:09 529319 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd6b06fa000-7fd6b06fb000 ---p 00000000 00:00 0
7fd6b06fb000-7fd6b0efb000 rw-p 00000000 00:00 0
7fd6b0efb000-7fd6b10bb000 r-xp 00000000 08:09 524373 /lib/x86_64-linux-gnu/libc-2.23.so
7fd6b10bb000-7fd6b12bb000 ---p 001c0000 08:09 524373 /lib/x86_64-linux-gnu/libc-2.23.so
7fd6b12bb000-7fd6b12bf000 r--p 001c0000 08:09 524373 /lib/x86_64-linux-gnu/libc-2.23.so
7fd6b12bf000-7fd6b12c1000 rw-p 001c4000 08:09 524373 /lib/x86_64-linux-gnu/libc-2.23.so
7fd6b12c1000-7fd6b12c5000 rw-p 00000000 00:00 0
7fd6b12c5000-7fd6b12d1000 r-xp 00000000 08:09 663698 /opt/openocd/bin/libudev.so.0.5.1
7fd6b12d1000-7fd6b14d1000 ---p 0000c000 08:09 663698 /opt/openocd/bin/libudev.so.0.5.1
7fd6b14d1000-7fd6b14d2000 r--p 0000c000 08:09 663698 /opt/openocd/bin/libudev.so.0.5.1
7fd6b14d2000-7fd6b14d3000 rw-p 0000d000 08:09 663698 /opt/openocd/bin/libudev.so.0.5.1
7fd6b14d3000-7fd6b14da000 r-xp 00000000 08:09 529149 /lib/x86_64-linux-gnu/librt-2.23.so
7fd6b14da000-7fd6b16d9000 ---p 00007000 08:09 529149 /lib/x86_64-linux-gnu/librt-2.23.so
7fd6b16d9000-7fd6b16da000 r--p 00006000 08:09 529149 /lib/x86_64-linux-gnu/librt-2.23.so
7fd6b16da000-7fd6b16db000 rw-p 00007000 08:09 529149 /lib/x86_64-linux-gnu/librt-2.23.so
7fd6b16db000-7fd6b16f3000 r-xp 00000000 08:09 524372 /lib/x86_64-linux-gnu/libpthread-2.23.so
7fd6b16f3000-7fd6b18f2000 ---p 00018000 08:09 524372 /lib/x86_64-linux-gnu/libpthread-2.23.so
7fd6b18f2000-7fd6b18f3000 r--p 00017000 08:09 524372 /lib/x86_64-linux-gnu/libpthread-2.23.so
7fd6b18f3000-7fd6b18f4000 rw-p 00018000 08:09 524372 /lib/x86_64-linux-gnu/libpthread-2.23.so
7fd6b18f4000-7fd6b18f8000 rw-p 00000000 00:00 0
7fd6b18f8000-7fd6b18fb000 r-xp 00000000 08:09 524375 /lib/x86_64-linux-gnu/libdl-2.23.so
7fd6b18fb000-7fd6b1afa000 ---p 00003000 08:09 524375 /lib/x86_64-linux-gnu/libdl-2.23.so
7fd6b1afa000-7fd6b1afb000 r--p 00002000 08:09 524375 /lib/x86_64-linux-gnu/libdl-2.23.so
7fd6b1afb000-7fd6b1afc000 rw-p 00003000 08:09 524375 /lib/x86_64-linux-gnu/libdl-2.23.so
7fd6b1afc000-7fd6b1c04000 r-xp 00000000 08:09 524303 /lib/x86_64-linux-gnu/libm-2.23.so
7fd6b1c04000-7fd6b1e03000 ---p 00108000 08:09 524303 /lib/x86_64-linux-gnu/libm-2.23.so
7fd6b1e03000-7fd6b1e04000 r--p 00107000 08:09 524303 /lib/x86_64-linux-gnu/libm-2.23.so
7fd6b1e04000-7fd6b1e05000 rw-p 00108000 08:09 524303 /lib/x86_64-linux-gnu/libm-2.23.so
7fd6b1e05000-7fd6b1e2b000 r-xp 00000000 08:09 524314 /lib/x86_64-linux-gnu/ld-2.23.so
7fd6b2002000-7fd6b2007000 rw-p 00000000 00:00 0
7fd6b2029000-7fd6b202a000 rw-p 00000000 00:00 0
7fd6b202a000-7fd6b202b000 r--p 00025000 08:09 524314 /lib/x86_64-linux-gnu/ld-2.23.so
7fd6b202b000-7fd6b202c000 rw-p 00026000 08:09 524314 /lib/x86_64-linux-gnu/ld-2.23.so
7fd6b202c000-7fd6b202d000 rw-p 00000000 00:00 0
7ffe48ea6000-7ffe48ec7000 rw-p 00000000 00:00 0 [stack]
7ffe48fcf000-7ffe48fd2000 r--p 00000000 00:00 0 [vvar]
7ffe48fd2000-7ffe48fd4000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
I just published a new release; I updated to the latest master and removed all RISC-V patches.
Can you test it and confirm that the problem was solved?
I just published a new release; I updated to the latest master and removed all RISC-V patches.
Can you test it and confirm that the problem was solved?
It looks like it works now
It looks like it works now
Great, thank you!
@j123b567 Jan, can you also confirm that the problem was solved, and close the ticket?
I am suffering this behaviour in "0.10.0+dev-00392-gbe9ef0b0", the current version provided by platformio.org.
@ilg-ul Which tag or commit have you applied the patch?
Which tag or commit have you applied the patch?
in the latest release I removed all RISC-V patches, it is mostly the master repacked.
the details of the builds can be seen in:
https://github.com/gnu-mcu-eclipse/openocd-build/blob/master/scripts/container-build.sh
False alarm: uC is damaged and OpenOCD binary dumps, but this is another story... Ignore my comment since it is not related to this issue... Thanks anyway :-)
I just released 0.10.0-12, with the latest upstream master.
Please check if the problem was solved. If not, reopen the ticket.
Description
I have board without hardware reset and when I accidentaly configure
reset_config srst_only
, openocd failes with "double free or corruption".I can connect with ST-LINK/V2-1 without problem. (ST-LINK/V2-1 is reported as
STLINK v2 JTAG v30 API v2 SWIM v20 VID 0x0483 PID 0x374B
)After connecting with ST-LINK/V2, OpenOCD fails with backtrace and double free or corruption message. (ST-LINK/V2 is reported as
STLINK v2 JTAG v30 API v2 SWIM v7 VID 0x0483 PID 0x3748
)I have tried all versions of gnu-mcu-eclipse/openocd and the problem was not in version
v0.10.0-2-20170622-1535-dev
and it first occures inv0.10.0-3-20170826-1813-dev
all later versions are affected, at leastv0.10.0-7-20180123
v0.10.0-5-20171110
Steps to Reproduce
Expected behaviour: [What you expected to happen]
Actual behaviour: [What actually happened]
Versions