Opened 14 years ago

Last modified 7 years ago

#104 closed defect (Fixed)

Signals, threads, and libevent may not necessarily play nice

Reported by: nickm Owned by: nickm
Priority: Low Milestone:
Component: Core Tor/Tor Version: 0.1.0.0-alpha-cvs
Severity: Keywords:
Cc: nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Sometimes when you control-c a server, multiple threads all get a sigint, and handle it oddly.

<arma2> Feb 27 03:29:09.348 [notice] foo
<arma2> Feb 27 03:29:09.349 [notice] Interrupt: will shut down in 30 seconds. In
terrupt again to exit now.
<arma2> Feb 27 03:29:09.350 [notice] foo
<arma2> Feb 27 03:29:09.351 [notice] Sigint received a second time; exiting now.
<arma2> Feb 27 03:30:35.950 [notice] 1024
<arma2> Feb 27 03:30:35.966 [notice] Interrupt: will shut down in 30 seconds. In
terrupt again to exit now.
<arma2> Feb 27 03:30:35.967 [notice] 1024
<arma2> Feb 27 03:30:35.968 [notice] Sigint received a second time; exiting now.
<arma2> hm.
<arma2> ok, so, not a thread thing.
<arma2> looks like it's getting called twice.
<arma2> does lib event let you double-register?
<arma2> is your tor_get_thread_id() known to work?

Haven't verified it, no, but it is Really Simple.
And if it's broken, so is pthreads.

<arma2> ooook :)
<arma2> ah. how's this:
<arma2> i'm not sending a sigint,
<arma2> i'm typing ^c.
<arma2> do you suppose that matters?
<arma2> it does.

ackpth!

<arma2> whee.
<arma2> is that threads or libevent?

  • nickm has no idea what *that* means.

<arma2> are we not allowed to sig_ign a ^c?

No, I think we are.

<arma2> does ^c sent a sigint to all threads?
<arma2> s/sent/send/
* You have new email.

Unspecified afaicr.

<arma2> 'woo'

Threads and signals is one of the canonically fudgy areas of pthreads iirc.

<arma2> ok i did a kill -INT of a child, and it called hibernate-begin-exit
<arma2> they are not ignoring signals like we'd like them to.

hmmmmm.

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (2)

comment:1 Changed 13 years ago by nickm

flyspray2trac: bug closed.
This seems to have gone away, somehow.

comment:2 Changed 7 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.