[ovs-dev] [PATCH 2/4] fatal-signal: Clean up code by using shash.
blp at nicira.com
Mon Sep 21 16:41:45 PDT 2009
Justin Pettit <jpettit at nicira.com> writes:
> On Sep 21, 2009, at 2:53 PM, Ben Pfaff wrote:
>> This simplifies the code here and should speed it up, too, when
>> there are
>> lots of files to unlink on a fatal signal.
> I don't suppose you care, but "files" is never destroyed. It wasn't
> done when it was an array, either so it is consistent. It only really
> matters when do_unlink_files() is called and the program is probably
> on its way out anyways...
That is intentional and necessary. do_unlink_files() gets called
from an asynchronous signal handler. If the signal arrives
during a call to malloc() or free(), etc., then freeing the data
structure could cause a segmentation fault.
More information about the dev