mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
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:
parent
871a36bd7e
commit
a073cfa844
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user