When I start a relay with latest Tor version, it almost instantly crashes:
Aug 02 11:04:45.000 [err] tor_assertion_failed_(): Bug: consdiffmgr.c:1601: consensus_diff_queue_diff_work: Assertion in_main_thread() failed; aborting. (on Tor 0.3.1.5-alpha )Aug 02 11:04:45.000 [err] Bug: Assertion in_main_thread() failed in consensus_diff_queue_diff_work at consdiffmgr.c:1601. (Stack trace not available) (on Tor 0.3.1.5-alpha )
The work is being queued from somewhere other than the main thread.
Looks like most probable reason.
~~One more note:
Error happens only if relay is under the load.
I have two keys: first have weight ~1000, second is unmeasured now.
And with second key Tor did not hit this error yet.~~
**upd.** Second relay was running in non-service mode, this thing may be important.
It looks as if this bug has been present for a long time, so I've made a branch against 0.2.5 (the oldest supported version): bug23081_025. I've merged it to 0.3.1 and later, and I'll mark this ticket for possible backport.
It was doing other wrong things. Here's the changes message I wrote up:
+ - When running as a Windows service, set the ID of the main thread+ correctly. Failure to do so made us fail to send log messages+ to the controller in 0.2.1.16-rc, slowed down controller+ event delivery in 0.2.7.3-rc and later, and crash with an assertion+ failure in 0.3.1.1-alpha. Fixes bug 23081; bugfix on 0.2.1.6-alpha.+ Patch and diagnosis from "Vort".