GetMyExternalIP hangs shutdown when waiting for response #4502

issue dgenr8 opened this issue on July 10, 2014
  1. dgenr8 commented at 4:48 AM on July 10, 2014: contributor

    If the GetMyExternalIP provider hasn't answered, bitcoind can't be stopped gracefully.

    It looks like #3372 did not fix this, because boost interrupt() doesn't actually interrupt recv(), it just causes an exception at the next boost interruption point.

    Thread in bitcoind that won't die:

    (gdb) thread 6
    [Switching to thread 6 (Thread 0x7f5818b7a700 (LWP 5569))]
    [#0](/github-metadata-backup-bitcoin-bitcoin/0/)  0x00007f581db6814c in recv () from /lib/x86_64-linux-gnu/libpthread.so.0
    (gdb) bt
    [#0](/github-metadata-backup-bitcoin-bitcoin/0/)  0x00007f581db6814c in recv () from /lib/x86_64-linux-gnu/libpthread.so.0
    [#1](/github-metadata-backup-bitcoin-bitcoin/1/)  0x00007f581eccd213 in recv (__flags=0, __n=1, __buf=0x7f5818b79a56, __fd=23)
        at /usr/include/x86_64-linux-gnu/bits/socket2.h:45
    [#2](/github-metadata-backup-bitcoin-bitcoin/2/)  RecvLine (hSocket=23, strLine=...) at net.cpp:153
    [#3](/github-metadata-backup-bitcoin-bitcoin/3/)  0x00007f581eccd541 in GetMyExternalIP2 (addrConnect=..., 
        pszGet=0x7f581ee9dcd8 "GET / HTTP/1.1\r\nHost: checkip.dyndns.org\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\nConnection: close\r\n\r\n", pszKeyword=0x7f581ee9d976 "Address:", ipRet=...) at net.cpp:318
    [#4](/github-metadata-backup-bitcoin-bitcoin/4/)  0x00007f581eccdb14 in GetMyExternalIP (ipRet=...) at net.cpp:407
    [#5](/github-metadata-backup-bitcoin-bitcoin/5/)  0x00007f581eccdeb8 in ThreadGetMyExternalIP () at net.cpp:417
    [#6](/github-metadata-backup-bitcoin-bitcoin/6/)  0x00007f581ece128a in TraceThread<void (*)()> (name=0x7f581ee9dada "ext-ip", 
        func=0x7f581eccde90 <ThreadGetMyExternalIP()>) at util.h:544
    [#7](/github-metadata-backup-bitcoin-bitcoin/7/)  0x00007f581e111ce9 in thread_proxy () from /usr/lib/libboost_thread.so.1.46.1
    [#8](/github-metadata-backup-bitcoin-bitcoin/8/)  0x00007f581db60e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
    [#9](/github-metadata-backup-bitcoin-bitcoin/9/)  0x00007f581ca423fd in clone () from /lib/x86_64-linux-gnu/libc.so.6
    [#10](/github-metadata-backup-bitcoin-bitcoin/10/) 0x0000000000000000 in ?? ()
    
  2. dgenr8 referenced this in commit 009f75d738 on Jul 10, 2014
  3. laanwj commented at 6:03 AM on July 10, 2014: member

    Indeed, there are various things that can hang the shutdown, for example connecting through a proxy that is very slow (also while getting the external IP).

  4. laanwj added the label Priority Low on Jul 10, 2014
  5. dgenr8 cross-referenced this on Jul 11, 2014 from issue Fix: respend relay must examine more inputs by dgenr8
  6. dgenr8 cross-referenced this on Jul 13, 2014 from issue Set -discover=0 in regtest framework by dgenr8
  7. laanwj cross-referenced this on Sep 8, 2014 from issue netbase: Make SOCKS5 negotiation interruptible by laanwj
  8. laanwj commented at 8:33 AM on May 18, 2015: member

    GetMyExternalIP does no longer exist, closing

  9. laanwj closed this on May 18, 2015

  10. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC