Opened 13 years ago

Closed 12 years ago

Last modified 10 years ago

#1040 enhancement closed wontfix (wontfix)

Starting threads in a tac file blocks everything

Reported by: Jean-Paul Calderone Owned by:
Priority: low Milestone:
Component: core Keywords:
Cc: Jean-Paul Calderone Branch:
Author:

Description


Change History (4)

comment:1 Changed 13 years ago by Jean-Paul Calderone

Figure out what's going on

comment:2 Changed 12 years ago by Jean-Paul Calderone

Component: conch
Resolution: wontfix
Status: newclosed

This is a libc threading/privilege shedding interaction:

  • Process starts up with UID X
  • Process starts a thread - threads share UID state so its UID is also X
  • Main thread sheds UID X in favor of UID Y
  • libc is broken and the second thread retains UID X
  • Main thread tries to release a super critical lock which happens to involve sending a signal to the secondary thread
  • Secondary thread has a different UID so sending the signal fails with a permission error
  • Secondary thread tries to do something with the lock, blocks forever
  • Main thread tries to do something with the lock, blocks forever

There's nothing we can do to fix it in the general case. We could avoid starting threads until after twistd has shed privileges, but it would still be possible to trigger this bug. So I don't think there's anything worth doing. Perhaps we should include a description of this scenario in documentation somewhere. Hopefully the broken version of libc is mostly out of circulation now, though.

comment:3 Changed 10 years ago by Jean-Paul Calderone

Component: conchcore

comment:4 Changed 8 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.