{"action":"created","issue":{"url":"https://api.github.com/repos/radare/radare2/issues/6298","repository_url":"https://api.github.com/repos/radare/radare2","labels_url":"https://api.github.com/repos/radare/radare2/issues/6298/labels{/name}","comments_url":"https://api.github.com/repos/radare/radare2/issues/6298/comments","events_url":"https://api.github.com/repos/radare/radare2/issues/6298/events","html_url":"https://github.com/radare/radare2/issues/6298","id":194683477,"number":6298,"title":"rarun2 config omitting `program=...` causes SEGFAULT","user":{"login":"TobalJackson","id":2519449,"avatar_url":"https://avatars.githubusercontent.com/u/2519449?v=3","gravatar_id":"","url":"https://api.github.com/users/TobalJackson","html_url":"https://github.com/TobalJackson","followers_url":"https://api.github.com/users/TobalJackson/followers","following_url":"https://api.github.com/users/TobalJackson/following{/other_user}","gists_url":"https://api.github.com/users/TobalJackson/gists{/gist_id}","starred_url":"https://api.github.com/users/TobalJackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TobalJackson/subscriptions","organizations_url":"https://api.github.com/users/TobalJackson/orgs","repos_url":"https://api.github.com/users/TobalJackson/repos","events_url":"https://api.github.com/users/TobalJackson/events{/privacy}","received_events_url":"https://api.github.com/users/TobalJackson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-09T19:58:32Z","updated_at":"2016-12-09T19:58:58Z","closed_at":null,"body":"Hello,\r\n\r\nI'm running `r2 -R <config>.rr2 -d <program>` in order to specify the output terminal that the program should tie its STDIN/OUT to using the config:\r\n\r\n```bash\r\n-> % cat fork1.rr2\r\n#!/usr/bin/rarun2\r\nstdio=/dev/pts/17\r\nbits=32\r\n```\r\nand running r2 with the command:\r\n\r\n```bash\r\nr2 -R fork1.rr2 -d fork1\r\n```\r\n\r\nwhich produces a segfault:\r\n\r\n```bash\r\ntobaljackson@b14ckb0x [02:45:10 PM] [~/programming/c/forking] \r\n-> % r2 -R fork1.rr2 -d fork1 2>error2.log\r\ntobaljackson@b14ckb0x [02:45:25 PM] [~/programming/c/forking] \r\n-> % cat error2.log \r\nASAN:DEADLYSIGNAL\r\n=================================================================\r\n==5233==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fc917850446 bp 0x7ffe7adda700 sp 0x7ffe7add9e88 T0)\r\n    #0 0x7fc917850445 in strlen (/usr/lib/libc.so.6+0x80445)\r\n    #1 0x7fc91d07c04e in __interceptor_strdup /build/gcc-multilib/src/gcc/libsanitizer/asan/asan_interceptors.cc:556\r\n    #2 0x561fc35027ee in main /home/tobaljackson/AUR/radare2/radare2.main/binr/radare2/radare2.c:606\r\n    #3 0x7fc9177f0290 in __libc_start_main (/usr/lib/libc.so.6+0x20290)\r\n    #4 0x561fc3500079 in _start (/home/tobaljackson/AUR/radare2/radare2.main/binr/radare2/radare2+0x6079)\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: SEGV (/usr/lib/libc.so.6+0x80445) in strlen\r\n==5233==ABORTING\r\n```\r\n\r\nadding in the line `program=fork1` to fork1.rr2 will alleviate this issue, but seems redundant to specify the program in the rr2 config as well as on `-d` option, but I could be thinking about this wrong:\r\n\r\n```bash\r\n-> % cat fork1.rr2 \r\n#!/usr/bin/rarun2\r\nprogram=fork1\r\nstdio=/dev/pts/17\r\nbits=32\r\ntobaljackson@b14ckb0x [02:55:29 PM] [~/programming/c/forking]\r\n-> % r2 -R fork1.rr2 -d fork1 \r\nProcess with PID 5528 started...\r\n= attach 5528 5528\r\nbin.baddr 0x08048000\r\nUSING 8048000\r\nAssuming filepath /home/tobaljackson/programming/c/forking/fork1\r\nasm.bits 32\r\n -- It's not a bug, it's a work in progress\r\n[0xf771eba0]> \r\n```"},"comment":{"url":"https://api.github.com/repos/radare/radare2/issues/comments/266108440","html_url":"https://github.com/radare/radare2/issues/6298#issuecomment-266108440","issue_url":"https://api.github.com/repos/radare/radare2/issues/6298","id":266108440,"user":{"login":"TobalJackson","id":2519449,"avatar_url":"https://avatars.githubusercontent.com/u/2519449?v=3","gravatar_id":"","url":"https://api.github.com/users/TobalJackson","html_url":"https://github.com/TobalJackson","followers_url":"https://api.github.com/users/TobalJackson/followers","following_url":"https://api.github.com/users/TobalJackson/following{/other_user}","gists_url":"https://api.github.com/users/TobalJackson/gists{/gist_id}","starred_url":"https://api.github.com/users/TobalJackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TobalJackson/subscriptions","organizations_url":"https://api.github.com/users/TobalJackson/orgs","repos_url":"https://api.github.com/users/TobalJackson/repos","events_url":"https://api.github.com/users/TobalJackson/events{/privacy}","received_events_url":"https://api.github.com/users/TobalJackson/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T19:58:58Z","updated_at":"2016-12-09T19:58:58Z","body":"forgot to add my r2 version:\r\n-> % r2 -v\r\nradare2 1.1.0-git 13166 @ linux-x86-64 git.1.0.2-221-g07819e2\r\ncommit: 07819e2f3659af4b43f21df58428eca392190a30 build: 2016-12-09\r\n"}}
{"actor":{"display_login":"TobalJackson"}}