Bitcoin Institute

Satoshi to Hal Finney: Fixing select failed: 10038 (January 11, 2009)

Satoshi Nakamoto January 12, 2009 05:31 UTC

I believe I’ve fixed the bug related to “select failed: 10038” (error WSAENOTSOCK). The select error is not a big deal, but it led the communications thread to get blocked on a socket that should have been in non-blocking mode but wasn’t. It never came up until now because as long as select never failed, receive would never be called unless there was data.

Without this fix, your node’s communication sometimes goes dead. Connections are still made, but no data is passed. Any generated blocks would probably not be accepted since you can’t broadcast them and other nodes will leave your branch behind. That’s why Generate doesn’t run when you’re not connected.

This could also have caused bitcoin.exe to fail to exit. There’s no reason for shutdown to wait for the com thread, so I made it only wait for the message processing thread. I’ll do a more thorough forced shutdown later.

Looks like your node’s com thread just now got blocked on this bug again. It went for a few hours this time before it did.

Version 0.1.3 exe attached.

Original external source

https://online.wsj.com/public/resources/documents/finneynakamotoemails.pdf
Transcribed from the Wall Street Journal PDF. Hal Finney supplied the emails to the Journal in spring 2014. Subject: "select failed 10038 fix". PDF header: Sun, Jan 11, 2009 at 9:31 PM; no time zone is given, so the time is converted to UTC assuming Pacific Standard Time (UTC−8). Visual line wraps have been rejoined. Attachments mentioned in the email are not preserved.

Other external sources