{"action":"created","issue":{"url":"https://api.github.com/repos/cjdelisle/cjdns/issues/778","labels_url":"https://api.github.com/repos/cjdelisle/cjdns/issues/778/labels{/name}","comments_url":"https://api.github.com/repos/cjdelisle/cjdns/issues/778/comments","events_url":"https://api.github.com/repos/cjdelisle/cjdns/issues/778/events","html_url":"https://github.com/cjdelisle/cjdns/pull/778","id":78022107,"number":778,"title":"Adding glibc backtrace dump on assertion failed","user":{"login":"viric","id":66664,"avatar_url":"https://avatars.githubusercontent.com/u/66664?v=3","gravatar_id":"","url":"https://api.github.com/users/viric","html_url":"https://github.com/viric","followers_url":"https://api.github.com/users/viric/followers","following_url":"https://api.github.com/users/viric/following{/other_user}","gists_url":"https://api.github.com/users/viric/gists{/gist_id}","starred_url":"https://api.github.com/users/viric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viric/subscriptions","organizations_url":"https://api.github.com/users/viric/orgs","repos_url":"https://api.github.com/users/viric/repos","events_url":"https://api.github.com/users/viric/events{/privacy}","received_events_url":"https://api.github.com/users/viric/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-19T10:03:24Z","updated_at":"2015-05-19T19:37:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cjdelisle/cjdns/pulls/778","html_url":"https://github.com/cjdelisle/cjdns/pull/778","diff_url":"https://github.com/cjdelisle/cjdns/pull/778.diff","patch_url":"https://github.com/cjdelisle/cjdns/pull/778.patch"},"body":"This produces a dump like this:\r\n```\r\nAssertion failure [Admin.c:182] [(0 && txid && txid->len >= admin->addrLen)]\r\nBacktrace (11 frames):\r\n  /home/viric/3rd/cjdns/cjdroute(+0x71f0) [0x7fbadaeeb1f0]\r\n  /home/viric/3rd/cjdns/cjdroute(+0x10fca) [0x7fbadaef4fca]\r\n  /home/viric/3rd/cjdns/cjdroute(+0x38b11) [0x7fbadaf1cb11]\r\n  /home/viric/3rd/cjdns/cjdroute(+0x7a3f3) [0x7fbadaf5e3f3]\r\n  /home/viric/3rd/cjdns/cjdroute(+0x7b567) [0x7fbadaf5f567]\r\n  /home/viric/3rd/cjdns/cjdroute(+0x70997) [0x7fbadaf54997]\r\n  /home/viric/3rd/cjdns/cjdroute(+0xc295) [0x7fbadaef0295]\r\n  /home/viric/3rd/cjdns/cjdroute(+0x58d90) [0x7fbadaf3cd90]\r\n  /home/viric/3rd/cjdns/cjdroute(main+0x314) [0x7fbadaee9de4]\r\n  /nix/store/la5imi1602jxhpds9675n2n2d0683lbq-glibc-2.20/lib/libc.so.6(__libc_start_main+0xf5) [0x7fbada521c15]\r\n  /home/viric/3rd/cjdns/cjdroute(+0x6c61) [0x7fbadaeeac61]\r\n```\r\n\r\nThe addresses can be resolved with addr2line:\r\n```\r\n$ addr2line -e cjdroute \r\n0x71f0\r\n/home/viric/3rd/cjdns/util/Assert.c:44\r\n0x10fca\r\n/home/viric/3rd/cjdns/./interface/Iface.h:61\r\n0x38b11\r\n/home/viric/3rd/cjdns/./interface/Iface.h:77\r\n0x7a3f3\r\n/home/viric/3rd/cjdns/build_linux/dependencies/libuv/out/../src/unix/udp.c:228\r\n0x7b567\r\n/home/viric/3rd/cjdns/build_linux/dependencies/libuv/out/../src/unix/linux-core.c:222\r\n0x70997\r\n/home/viric/3rd/cjdns/build_linux/dependencies/libuv/out/../src/unix/core.c:285\r\n...\r\n```\r\n\r\nBy the way, this assertion failure is fake, introduced just for testing. The backtrace dump should be enabled only on glibc systems. The usage of \"-rdynamic\" (see man gcc) in compilation allows for some resolutions of symbols (like main). On other programs I have tested it really provides function names properly.\r\n\r\nIf we wanted the filename and line in the backtrace output, it would be more complicated (linking libunwind, libbfd, ...).\r\n```"},"comment":{"url":"https://api.github.com/repos/cjdelisle/cjdns/issues/comments/103646872","html_url":"https://github.com/cjdelisle/cjdns/pull/778#issuecomment-103646872","issue_url":"https://api.github.com/repos/cjdelisle/cjdns/issues/778","id":103646872,"user":{"login":"lgierth","id":19248,"avatar_url":"https://avatars.githubusercontent.com/u/19248?v=3","gravatar_id":"","url":"https://api.github.com/users/lgierth","html_url":"https://github.com/lgierth","followers_url":"https://api.github.com/users/lgierth/followers","following_url":"https://api.github.com/users/lgierth/following{/other_user}","gists_url":"https://api.github.com/users/lgierth/gists{/gist_id}","starred_url":"https://api.github.com/users/lgierth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgierth/subscriptions","organizations_url":"https://api.github.com/users/lgierth/orgs","repos_url":"https://api.github.com/users/lgierth/repos","events_url":"https://api.github.com/users/lgierth/events{/privacy}","received_events_url":"https://api.github.com/users/lgierth/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T19:37:23Z","updated_at":"2015-05-19T19:37:23Z","body":"I like it. Caleb probably has an opinion on `-rdynamic`."}}