]> err.no Git - systemd/commitdiff
udevd: detach event from worker if we kill a worker
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 8 Jul 2009 12:13:20 +0000 (14:13 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 8 Jul 2009 12:13:20 +0000 (14:13 +0200)
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

udev/udevd.c

index b2e4a022c5c0e9ece1807a198410470e8d00cdae..cfb8823f4cde00eabc38d78a768965a053517abb 100644 (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);