Pan crashing in libgnuregex after -pthread switchover

Peter Edwards peter.edwards at openet-telecom.com
Fri Mar 19 07:34:31 PST 2004


Jason Andresen wrote:

> Peter Edwards wrote:
>
>> Doug White wrote:
>>
>>> For the record, the OpenLDAP server has the same problem.
>>>
>>>  
>>>
>> On reflection, I think the most likely candidate is picking up the 
>> FreeBSD regex headers, but linking to the GNU regex library. There 
>> seems to be some activity afoot there  recently, but I wasn't been 
>> following it. Maybe just adding -I /usr/include/gnu to the CFLAGS 
>> would help. (I've an old mail from Andrey Chernov in my -current 
>> mailbox that mentioned he wanted to do some work on this. Any 
>> comments, Andrey?)
>>
>
> That seems to fix the problem.  I'm surprised that picking up the 
> wrong include file would cause crashes at runtime, but forcing Pan to 
> use the gnuregex header file fixed the problem.
>
The layout of the structures passed to regexec() and regcomp() are note 
binary compatible between the GNU library and the FreeBSD libc. So, when 
you pick one at compile time, and get something else at run-time, Things 
Go Horribly Wrong. The older version of the GNU library didn't have the 
POSIX "regexec" or "regcomp" functions compiled-in, so this didn't pose 
a problem, but the "-DNO_POSIX_COMPAT=1" was dropped from 
src/gnu/lib/libregex/Makefile with the latest import. I'm not sure if 
this was intentional or not, but there's nothing obvious about it in the 
commit message.




More information about the freebsd-current mailing list