bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] edif update / ⎕IO is 0


From: Chris Moller
Subject: Re: [Bug-apl] edif update / ⎕IO is 0
Date: Wed, 22 Aug 2018 11:47:29 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hi, Hans-Peter,

Something occurred to me last night...

When edif2 starts, it fork()s but instead of exec()ing it just goes into an inotify() read loop,  That leaves two APL processes running and when they're killed they both call the edif2 close_fun().  Among other things, close_fun() frees various bits of malloc()ed space and the double-free bug occurred when one or more of those spaces was freed twice.  (At least, I think that's what was happening...)  My last patch was to put in a test in before free()ing, but it occurred to me that the test&free stuff isn't atomic so there's a small but non-zero race window.  To deal with that, I just put in another that patch that adds a process-shared mutex to make the tests/frees effectively atomic.  (It would have been more straight forward to use pthread_create() for the inotify() loop, but I didn't think of it...)

No urgency, but if you want to try the patch in your environment, that would be great.  It works on my machines, but obviously that's no guarantee.

Thanks,
Chris

(Now maybe I can get a good night's sleep...)


On 20/08/18 17:58, Hans-Peter Sorge wrote:

YES - Thank You -

I'll have a good night sleep now:-)

Peter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]