[PATCH] D51304: [Safestack] fix pthread stack unsafe unit test

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 28 10:29:01 PDT 2018


vlad.tsyrklevich added a comment.

In https://reviews.llvm.org/D51304#1214819, @devnexen wrote:

> Sure ... did the test on 11.2. Result might differ if it s 10.x older branch.


The test compiles fine for me on 11.2; however, it does fail. The reason it fails is because the `TgKill(...) == -ESRCH` check at https://github.com/llvm-mirror/compiler-rt/blob/a813e12f44ce55c22df5fb8f98d188ec6fd70495/lib/safestack/safestack.cc#L186 doesn't work. The internal_syscall() interfaces for Linux and the BSDs differ in that Linux performs a direct assembly system call and returns the result while the BSDs use the libc syscall() interface that puts error codes in errno and returns -1 if an error is encountered. After looking around a bit I found the internal_iserror() function to properly handle the difference. I have a fix up for review at https://reviews.llvm.org/D51368


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D51304





More information about the llvm-commits mailing list