[sr-dev] shm_regex deadlock

Stefan Keller stefan.keller at isaco.de
Sun Jun 13 02:31:52 CEST 2010


Hi,

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.

Best regards,
Stefan

-- 
M.Eng. Stefan Keller
CTO (Technischer Leiter)

Phone  +49-30-203899889
Mobile +49-170-4150437
Fax    +49-30-722399150

stefan.keller at isaco.de
www.isaco.de

ISACO GmbH
Kurfürstenstr. 79
10787 Berlin
Germany

Amtsgericht Charlottenburg, HRB 112464B
Geschäftsführer: Daniel Frommherz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-work-around-libc-s-regex-deadlock.patch
Type: text/x-patch
Size: 4082 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20100613/28a995e7/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20100613/28a995e7/attachment.pgp>


More information about the sr-dev mailing list