[Bug 238404] AddressSanitizer should intercept pthread_get_name_np (FreeBSD), not pthread_getname_np (Glibc) symbol
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Jun 7 23:09:34 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238404
Bug ID: 238404
Summary: AddressSanitizer should intercept pthread_get_name_np
(FreeBSD), not pthread_getname_np (Glibc) symbol
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: toolchain at FreeBSD.org
Reporter: jbeich at FreeBSD.org
AC_CHECK_FUNCS() doesn't check declaration, only library symbol. For one,
FreeBSD never had pthread_getname_np() but added a similar function in base
r337983.
See contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
$ cat >a.c
char pthread_getname_np();
int main()
{
pthread_getname_np();
return 0;
}
$ cc a.c -fsanitize=address
$ cc a.c
ld: error: undefined symbol: pthread_getname_np
>>> referenced by a.c
>>> /tmp/a-101e7b.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
$ pkg install python27
$ hash git 2>/dev/null || pkg install mercurial
$ hg clone https://hg.mozilla.org/mozilla-unified firefox ||
git clone https://github.com/mozilla/gecko-dev firefox
$ cd firefox
$ hg update central || git checkout origin/master
$ echo "ac_add_options --with-libclang-path=${LOCALBASE-/usr/local}/llvm80/lib"
>>.mozconfig
$ echo "ac_add_options --enable-address-sanitizer" >>.mozconfig
$ ./mach bootstrap # select Firefox for Desktop
$ ./mach build
[...]
In file included from objdir/js/src/Unified_cpp_js_src9.cpp:29:
js/src/threading/posix/Thread.cpp:174:8: error: use of undeclared identifier
'pthread_getname_np'; did you mean 'pthread_get_name_np'?
rv = pthread_getname_np(pthread_self(), nameBuffer, len);
^~~~~~~~~~~~~~~~~~
pthread_get_name_np
/usr/include/pthread_np.h:52:6: note: 'pthread_get_name_np' declared here
void pthread_get_name_np(pthread_t, char *, size_t);
^
In file included from objdir/js/src/Unified_cpp_js_src9.cpp:29:
js/src/threading/posix/Thread.cpp:174:8: error: assigning to 'int' from
incompatible type 'void'
rv = pthread_getname_np(pthread_self(), nameBuffer, len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-toolchain
mailing list