Modify

Opened 8 years ago

Closed 5 years ago

Last modified 4 years ago

#7339 closed defect (obsolete)

hotplug2-0.9

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: hotplug2-0.9 deadlock Cc:

Description

There is a problem with hotplug2-0.9 code, that it calls remove_child_by_pid in its signal handler for sigchld which in turn calls free() function. free() is signal safe and should not be called in signal handlers.

the code needs to release the node for the child struct when it gets a sigchild. But this should not be done in a signal handler. Because the signal handler can preempt the normal execution. I faced a hang when the normal flow of execution was holding some mutex in free () called from free_hotplug_event and the sigchld handler preempted this called free() and needed the same mutex which is a deadlock because the signal handler can never finish.

This is more observable with glibc-2.7

The easiest way to fix this is to use a self pipe and do the sigchld processing the main flow rather than the handler.
I have the patch attached.

Attachments (1)

200-hotplug2-fix-sigchld.patch (4.3 KB) - added by satananda.burla@… 8 years ago.
patch to fix the hotplug2-0.9 problem

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by satananda.burla@…

patch to fix the hotplug2-0.9 problem

comment:1 Changed 8 years ago by anonymous

comment:2 Changed 5 years ago by nbd

  • Resolution set to obsolete
  • Status changed from new to closed

hotplug2 is gone in trunk, replaced with procd

comment:3 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.