{"action":"closed","issue":{"url":"https://api.github.com/repos/gnu-mcu-eclipse/openocd/issues/27","repository_url":"https://api.github.com/repos/gnu-mcu-eclipse/openocd","labels_url":"https://api.github.com/repos/gnu-mcu-eclipse/openocd/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/gnu-mcu-eclipse/openocd/issues/27/comments","events_url":"https://api.github.com/repos/gnu-mcu-eclipse/openocd/issues/27/events","html_url":"https://github.com/gnu-mcu-eclipse/openocd/issues/27","id":314573348,"number":27,"title":"double free or corruption with ST-LINK/V2","user":{"login":"j123b567","id":2813154,"avatar_url":"https://avatars1.githubusercontent.com/u/2813154?v=4","gravatar_id":"","url":"https://api.github.com/users/j123b567","html_url":"https://github.com/j123b567","followers_url":"https://api.github.com/users/j123b567/followers","following_url":"https://api.github.com/users/j123b567/following{/other_user}","gists_url":"https://api.github.com/users/j123b567/gists{/gist_id}","starred_url":"https://api.github.com/users/j123b567/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j123b567/subscriptions","organizations_url":"https://api.github.com/users/j123b567/orgs","repos_url":"https://api.github.com/users/j123b567/repos","events_url":"https://api.github.com/users/j123b567/events{/privacy}","received_events_url":"https://api.github.com/users/j123b567/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-16T09:41:17Z","updated_at":"2018-04-16T10:46:27Z","closed_at":"2018-04-16T10:46:27Z","author_association":"NONE","body":"### Description\r\n\r\nI have board without hardware reset and when I accidentaly configure `reset_config srst_only`, openocd failes with \"double free or corruption\".\r\n\r\nI can connect with ST-LINK/V2-1 without problem.\r\n(ST-LINK/V2-1 is reported as `STLINK v2 JTAG v30 API v2 SWIM v20 VID 0x0483 PID 0x374B`)\r\n\r\nAfter connecting with ST-LINK/V2, OpenOCD fails with backtrace and double free or corruption message.\r\n(ST-LINK/V2 is reported as `STLINK v2 JTAG v30 API v2 SWIM v7 VID 0x0483 PID 0x3748`)\r\n\r\nI have tried all versions of gnu-mcu-eclipse/openocd and the problem was not in version\r\n`v0.10.0-2-20170622-1535-dev`\r\nand it first occures in\r\n`v0.10.0-3-20170826-1813-dev`\r\nall later versions are affected, at least\r\n`v0.10.0-7-20180123`\r\n`v0.10.0-5-20171110`\r\n\r\n### Steps to Reproduce\r\n\r\n1. Connect ST-Link/V2 (not V2-1) to target MCU using just GND, TVCC, SWDIO, SWCLK\r\n2. Run OpenOCD with this configuration (I'm using STM32F030RC). It is wrong configuration, because SRST is not connected, so it should just tell \"timed out while waiting for target halted\".\r\n\r\n```tcl\r\nsource [find interface/stlink-v2.cfg ]\r\nreset_config srst_only\r\nset CHIPNAME STM32F030xC\r\nset WORKAREASIZE 0x00008000\r\nsource [find target/stm32f0x.cfg ]\r\ntcl_port disabled\r\ntelnet_port disabled\r\ngdb_port disabled\r\ninit\r\nreset halt\r\nsleep 300\r\nflash write_image erase \"app.elf\"\r\nsleep 300\r\nreset run\r\nsleep 1000\r\nshutdown\r\n```\r\n\r\n**Expected behaviour:** [What you expected to happen]\r\n\r\n```\r\nError: timed out while waiting for target halted\r\nTARGET: STM32F030xC.cpu - Not halted\r\n```\r\n\r\n**Actual behaviour:** [What actually happened]\r\n\r\n```\r\nGNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00404-g20463c28 (2018-01-23-12:24)\r\n...\r\nError: timed out while waiting for target halted\r\nError in `/path_to/bin/openocd': double free or corruption (fasttop): 0x000000000287e2c0 \r\n======= Backtrace: =========\r\n/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f05389e97e5]\r\n/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f05389f237a]\r\n/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f05389f653c]\r\n/opt/scide/cnd/tools/Linux-x86_64/openocd/0.10.0-7-20180123-1217/bin/openocd[0x5df57f]\r\n```\r\n\r\n### Versions\r\n\r\n* OpenOCD package version  v0.10.0-3-20170826-1813-dev and later\r\n* Debug probe: ST-Link/V2 (VID 0x0483 PID 0x3748)\r\n* operating system: Various x86_64 linux distributions (Ubuntu 16.04, Gentoo)\r\n"}}
{"actor":{"display_login":"ilg-ul"}}