[sr-dev] shm_regex deadlock

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 14 15:18:14 CEST 2010


Hello,

On 6/14/10 3:11 PM, Henning Westerholt wrote:
> On Sunday 13 June 2010, Stefan Keller wrote:
>    
>> I used the shm_regex functions from lib in one of my own modules and
>> noticed that it is dead-locking (it hangs in FUTEX_WAIT).
>> The code hangs in regexec() when trying to acquire the lock. This was
>> a bit hard to find out as I couldn't reproduce it in a virtual
>> machine with some test code I wrote. It turns out this only happens if
>> the machine has more than one physical CPU core.
>> Reproducable on x86_64 with two CPU cores, glibc 2.3.6 (from Debian
>> Etch) and glibc 2.11.1 (from Ubuntu Jaunty).
>> Attached is a patch which does its own locking and thus works around
>> this problem.
>>      
> Hi Stefan,
>
> thank you for the patch, it looks fine to me on a first sight. The library in
> question is not used in any of the existing modules, so i think it should be
> pretty save. Miklos, its ok when i apply it, or do you maybe want to refine it
> a bit?
>
>    
just in case it was not know by you, pcre library can be used to store 
compiled regexp in shared memory (like in dialplan module).

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
Asterisk SIP Router Masterclass
Malaga, Spain - July 5-9, 2010
http://www.asipto.com/




More information about the sr-dev mailing list