[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#316484: cdebconf's signal handling is dangerously wrong



Package: cdebconf
Version: 0.81
Severity: important

debconf, debconf-communicate, and dpkg-reconfigure all attempt to save
the debconf database to disk in a signal handler. Words fail me while
trying to express how wrong this is, and I'm amazed we haven't had more
reports of data corruption, crashes, etc. I ran into this hard while
testing cdebconf 0.80 with Linux 2.6.12 on amd64 and powerpc, where it
caused various scripts called from debian-installer-startup to hang
waiting on a futex. I applied a partial fix (correcting only the SIGCHLD
handler) in cdebconf 0.81, but the rest needs to be cleaned up too.

Following my SIGCHLD handler fix, we should simply set a volatile
sig_atomic_t variable which is occasionally checked in the main control
flow; either that or very carefully block signals everywhere that might
write to the database in memory or otherwise collide with the signal
handler, but I think the first approach is simpler and more robust.

-- 
Colin Watson                                       [cjwatson@debian.org]



Reply to: