udevd: detach event from worker if we kill a worker

Jul  8 09:36:41 udevd[663]: worker [5491] did not accept message, kill it
Jul  8 09:36:41 udevd[663]: worker [5491] unexpectedly returned with 0
Jul  8 09:36:41 udevd[663]: worker [5551] unexpectedly returned with 0
Jul  8 09:36:41 kernel: [  156.832086] <6>udevd[663]: segfault at 4 ip 00959fbc sp bfbe7b78 error 6 in udevd[94f000+1c000]

https://bugs.launchpad.net/ubuntu/+source/udev/+bug/396957
This commit is contained in:
Kay Sievers 2009-07-08 14:13:20 +02:00
parent 871a36bd7e
commit a073cfa844

View File

@ -328,8 +328,9 @@ static void event_run(struct event *event)
event->state = EVENT_RUNNING;
count = udev_monitor_send_device(monitor, worker->monitor, event->dev);
if (count < 0) {
err(event->udev, "worker [%u] did not accept message, kill it\n", worker->pid);
event->state = EVENT_QUEUED;
worker->event = NULL;
err(event->udev, "worker [%u] did not accept message %zi (%m), kill it\n", worker->pid, count);
worker->state = WORKER_KILLED;
kill(worker->pid, SIGKILL);
continue;
@ -521,6 +522,9 @@ static void worker_returned(void)
if (worker->pid != msg.pid)
continue;
if (worker->state != WORKER_RUNNING)
break;
/* worker returned */
worker->event->exitcode = msg.exitcode;
event_queue_delete(worker->event);