[PATCH] D40337: Support the setjmp(3) family of functions in TSan/NetBSD

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 02:44:52 PST 2017


dvyukov added inline comments.


================
Comment at: lib/tsan/rtl/tsan_interceptors.cc:556
+extern "C" SANITIZER_INTERFACE_ATTRIBUTE
+int __interceptor___setjmp14(void *env);
+extern "C" int __interceptor___setjmp14(void *env) {
----------------
I am somewhat disappointed by amount of copy-paste between netbsd and linux. I think we should do the same thing you did with sigaction_symname, because it's effectively the same problem.

I.e. (under !SANITIZER_MAC):
```
#if SANITIZER_NETBSD
# define setjmp_symname __setjmp14
...
#else
# define setjmp_symname setjmp
...
#endif
```

And then use setjmp_symname in the rest of the code.
I see that netbsd has 1 less setjmp flavor and 1 more longjmp flavor. So we could put 1 setjmp under `#if SANITIZER_LINUX` and 1 longjmp under `#if SANITIZER_NETBSD`.

Will this work?


Repository:
  rL LLVM

https://reviews.llvm.org/D40337





More information about the llvm-commits mailing list