Re: segfault in vfscanf(3): clang and __restrict usage
On 2012-04-25 21:13, Boris Samorodov wrote:
> 25.04.2012 22:57, Dimitry Andric =D0=BF=D0=B8=D1=88=D0=B5=D1=82:
>> On 2012-04-24 21:49, Jean-S=C3=A9bastien P=C3=A9dron wrote:
>>> Hi everyone,
>>>
>>> vfscanf(3) in HEAD (r234606) segfaults when compiled with clang. For
>>> instance, here is a call made in cmake which crashes:
>>> fscanf(f, "%*[^\n]\n");
>>
>> Using r234549 here, everything compiled with clang, but I cannot make
>> that statement crash, whatever I do. Do you have a specific input fil=
e
>> which crashes it?
>=20
> -----
> % uname -a
> FreeBSD bsam.wart.ru 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r234635: Tue
> Apr 24 11:41:32 SAMT 2012 bsam@bsam.wart.ru:/usr/obj/usr/src/sys/BB=
X
> i386
> % sudo gdb smartd smartd.core
> GNU gdb 6.1.1 [FreeBSD]
> [...]
> #0 0x33ebdc2e in vfscanf () from /lib/libc.so.7
> (gdb)
> -----
>=20
> I think that cupsd also suffer from the bug.
>=20
> BTW, I have the system and almost all ports compiled (tomorrow
> and today) with clang.
Looks like the __restricted keywords were introduced just two days ago,
in r234585, which may be why I didn't see any crashes yet.
I think the easiest solution for now is to #undef __restrict at the top
of both lib/libc/stdio/vfscanf.c and lib/libc/stdio/vfwscanf.c, then
recompile and reinstall libc.
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
討論串 (同標題文章)
完整討論串 (本文為第 3 之 5 篇):