-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AddressSanitizer CHECK failed #1171
Comments
Does it happen with all programs or any particular one? Do you have a
minimal test case?
Try running under strace to see errno code from the failed sigaltstack call.
…On Mon, Dec 2, 2019 at 6:38 AM João M. S. Silva ***@***.***> wrote:
Hi,
I get this error:
==26081==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179 "((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
#0 0x7f375645c445 in AsanCheckFailed ../../../../src/libsanitizer/asan/asan_rtl.cc:66
#1 0x7f3756479145 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc:77
#2 0x7f3756471be9 in __sanitizer::UnsetAlternateSignalStack() ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
#3 0x7f375645fe24 in __asan::AsanThread::Destroy() ../../../../src/libsanitizer/asan/asan_thread.cc:108
#4 0x7f375482ebd1 in __nptl_deallocate_tsd (/lib64/libpthread.so.0+0x7bd1)
#5 0x7f375482ede2 in start_thread (/lib64/libpthread.so.0+0x7de2)
#6 0x7f37538aaeac in __clone (/lib64/libc.so.6+0xfdeac)
but absolutely no clues where to look.
Google seems to know nothing about this specific error.
How can I understand what's wrong and fix it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1171?email_source=notifications&email_token=AADG4SWMTQ2DYKH6EEO5HPDQWUMW3A5CNFSM4JTWZ3LKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5JAPAA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADG4STN7B4SGVNOAN6CU5LQWUMW3ANCNFSM4JTWZ3LA>
.
|
Is this enough?
$ ASAN_OPTIONS=halt_on_error=0 ASAN_OPTIONS=verbosity=1
LD_PRELOAD=/opt/gnat/lib64/libasan.so strace
./FCS/SAR_Logger/pc_sar_data_logger.eab|& grep sigaltstack
sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0
sigaltstack({ss_sp=0x7f4e9707c000, ss_flags=0, ss_size=32768}, NULL) = 0
sigaltstack(NULL, {ss_sp=0x7f4e9707c000, ss_flags=0, ss_size=32768}) = 0
sigaltstack({ss_sp=0x7f4e94b22f60, ss_flags=0, ss_size=16384}, NULL) = 0
sigaltstack({ss_sp=0x7f4e94b22f60, ss_flags=0, ss_size=16384}, NULL) = 0
==4842==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
João M. S. Silva
On Mon, Dec 2, 2019 at 9:56 PM Evgenii Stepanov <notifications@github.com>
wrote:
… Does it happen with all programs or any particular one? Do you have a
minimal test case?
Try running under strace to see errno code from the failed sigaltstack
call.
On Mon, Dec 2, 2019 at 6:38 AM João M. S. Silva ***@***.***>
wrote:
> Hi,
>
> I get this error:
>
> ==26081==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
> #0 0x7f375645c445 in AsanCheckFailed
../../../../src/libsanitizer/asan/asan_rtl.cc:66
> #1 0x7f3756479145 in __sanitizer::CheckFailed(char const*, int, char
const*, unsigned long long, unsigned long long)
../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc:77
> #2 0x7f3756471be9 in __sanitizer::UnsetAlternateSignalStack()
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
> #3 0x7f375645fe24 in __asan::AsanThread::Destroy()
../../../../src/libsanitizer/asan/asan_thread.cc:108
> #4 0x7f375482ebd1 in __nptl_deallocate_tsd
(/lib64/libpthread.so.0+0x7bd1)
> #5 0x7f375482ede2 in start_thread (/lib64/libpthread.so.0+0x7de2)
> #6 0x7f37538aaeac in __clone (/lib64/libc.so.6+0xfdeac)
>
> but absolutely no clues where to look.
>
> Google seems to know nothing about this specific error.
>
> How can I understand what's wrong and fix it?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <
#1171?email_source=notifications&email_token=AADG4SWMTQ2DYKH6EEO5HPDQWUMW3A5CNFSM4JTWZ3LKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5JAPAA
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AADG4STN7B4SGVNOAN6CU5LQWUMW3ANCNFSM4JTWZ3LA
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1171?email_source=notifications&email_token=AB35TBJ4DGLQOEZAPPHL2W3QWWAAXA5CNFSM4JTWZ3LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFVU5AI#issuecomment-560680577>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB35TBLS3ME7V3QVSQ25Y6TQWWAAXANCNFSM4JTWZ3LA>
.
|
Does it happen with all programs or any particular one? Do you have a
minimal test case?
No minimal testcase, that's an issue.
This application consists in 2 programs, it only happens with this
one, the other I'm able to get at least one asan error. Did not
investigate yet. I need both running, because they communicate with
each other.
João M. S. Silva
|
On Mon, Dec 2, 2019 at 2:08 PM João M. S. Silva <notifications@github.com>
wrote:
Is this enough?
$ ASAN_OPTIONS=halt_on_error=0 ASAN_OPTIONS=verbosity=1
LD_PRELOAD=/opt/gnat/lib64/libasan.so strace
./FCS/SAR_Logger/pc_sar_data_logger.eab|& grep sigaltstack
sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0
sigaltstack({ss_sp=0x7f4e9707c000, ss_flags=0, ss_size=32768}, NULL) = 0
sigaltstack(NULL, {ss_sp=0x7f4e9707c000, ss_flags=0, ss_size=32768}) = 0
sigaltstack({ss_sp=0x7f4e94b22f60, ss_flags=0, ss_size=16384}, NULL) = 0
sigaltstack({ss_sp=0x7f4e94b22f60, ss_flags=0, ss_size=16384}, NULL) = 0
==4842==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
This does not make sense, the call on line 179 passes SS_DISABLE and two
non-null arguments, but I don't see anything like that in the strace output.
You may need to pass -f to strace.
Does you application set its own sigaltstack?
…
João M. S. Silva
On Mon, Dec 2, 2019 at 9:56 PM Evgenii Stepanov ***@***.***>
wrote:
> Does it happen with all programs or any particular one? Do you have a
> minimal test case?
>
> Try running under strace to see errno code from the failed sigaltstack
> call.
>
>
> On Mon, Dec 2, 2019 at 6:38 AM João M. S. Silva <
***@***.***>
> wrote:
>
> > Hi,
> >
> > I get this error:
> >
> > ==26081==AddressSanitizer CHECK failed:
>
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
> "((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0,
0xffffffffffffffff)
> > #0 0x7f375645c445 in AsanCheckFailed
> ../../../../src/libsanitizer/asan/asan_rtl.cc:66
> > #1 0x7f3756479145 in __sanitizer::CheckFailed(char const*, int, char
> const*, unsigned long long, unsigned long long)
> ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc:77
> > #2 0x7f3756471be9 in __sanitizer::UnsetAlternateSignalStack()
>
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
> > #3 0x7f375645fe24 in __asan::AsanThread::Destroy()
> ../../../../src/libsanitizer/asan/asan_thread.cc:108
> > #4 0x7f375482ebd1 in __nptl_deallocate_tsd
> (/lib64/libpthread.so.0+0x7bd1)
> > #5 0x7f375482ede2 in start_thread (/lib64/libpthread.so.0+0x7de2)
> > #6 0x7f37538aaeac in __clone (/lib64/libc.so.6+0xfdeac)
> >
> > but absolutely no clues where to look.
> >
> > Google seems to know nothing about this specific error.
> >
> > How can I understand what's wrong and fix it?
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub
> > <
>
#1171?email_source=notifications&email_token=AADG4SWMTQ2DYKH6EEO5HPDQWUMW3A5CNFSM4JTWZ3LKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5JAPAA
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AADG4STN7B4SGVNOAN6CU5LQWUMW3ANCNFSM4JTWZ3LA
> >
> > .
> >
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <
#1171?email_source=notifications&email_token=AB35TBJ4DGLQOEZAPPHL2W3QWWAAXA5CNFSM4JTWZ3LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFVU5AI#issuecomment-560680577
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AB35TBLS3ME7V3QVSQ25Y6TQWWAAXANCNFSM4JTWZ3LA
>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1171?email_source=notifications&email_token=AADG4STEWINACTQYEHAWGQDQWWBMHA5CNFSM4JTWZ3LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFV4KYY#issuecomment-560711011>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADG4SROHYNUBIVRCMWA4RLQWWBMHANCNFSM4JTWZ3LA>
.
|
I'm sorry, I starred the e-mail but then completely missed it. Here is the output with -f: $ ASAN_OPTIONS=halt_on_error=0 ASAN_OPTIONS=verbosity=1 LD_PRELOAD=/opt/gnat/lib64/libasan.so strace -f ./FCS/SAR_Logger/pc_sar_data_logger.eab|& grep sigaltstack with -f it does not end, I had to kill it. Without the grep, we can see it gets "stuck" in this: (...) I don't think our application sets its own sigaltstack (I've never heard about this) and I ran a grep and this word "sigaltstack" only occurs in the executables. |
It seems to be working now after recompiling. Maybe something outdated, maybe a glitch. |
It seems to have happened again with a colleague: ==20==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179 "((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff) And still related to sigaltstack. What would cause this undeterminism since we don't mess with sigaltstack (don't even know what it is)? |
One more example: ==28227==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179 "((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
I have absolutely no clue what this means. The program has been working correctly for years, no problems detected. There may be memory errors and leaks, but I don't understand these failed checks. Is this a bug, a false positive, a benign symptom? |
Sorry, no idea. I've never seen sigaltstack failing to _remove_ a stack
like that. This looks like a bug in ASan, or in the way you are using it.
Why LD_PRELOAD, btw? Please make sure that the preloaded library is exactly
the one that is linked to your code, i.e. you do not end up with 2 copies
of ASan runtime library in the process. Consider trying a newer version of
ASan, ideally with Clang.
…On Tue, Dec 10, 2019 at 10:10 AM João M. S. Silva ***@***.***> wrote:
One more example:
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
==28227==AddressSanitizer CHECK failed:
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
"((0)) == ((sigaltstack(&altstack, &oldstack)))" (0x0, 0xffffffffffffffff)
#0 0x7f9a038d8445 in AsanCheckFailed
../../../../src/libsanitizer/asan/asan_rtl.cc:66
#1 <#1> 0x7f9a038f5145 in
__sanitizer::CheckFailed(char const*, int, char const*, unsigned long long,
unsigned long long)
../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc:77
#2 <#2> 0x7f9a038edbe9 in
__sanitizer::UnsetAlternateSignalStack()
../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:179
#3 <#3> 0x7f9a038dbe24 in
__asan::AsanThread::Destroy()
../../../../src/libsanitizer/asan/asan_thread.cc:108
#4 <#4> 0x7f9a01caabd1 in
__nptl_deallocate_tsd (/lib64/libpthread.so.0+0x7bd1)
#5 <#5> 0x7f9a01caade2 in
start_thread (/lib64/libpthread.so.0+0x7de2)
#6 <#6> 0x7f9a00d26eac in
__clone (/lib64/libc.so.6+0xfdeac)
#0 0x7f9a038d8445 in AsanCheckFailed ../../../../src/libsanitizer/asan/asan_rtl.cc:66
#0 0x7f9a038d8445 in AsanCheckFailed ../../../../src/libsanitizer/asan/asan_rtl.cc:66
#0 0x7f9a038d8445 in AsanCheckFailed ../../../../src/libsanitizer/asan/asan_rtl.cc:66
#0 0x7f9a038d8445 in AsanCheckFailed ../../../../src/libsanitizer/asan/asan_rtl.cc:66
I have absolutely no clue what this means. The program has been working
correctly for years, no problems detected. There may be memory errors and
leaks, but I don't understand these failed checks.
Is this a bug, a false positive, a benign symptom?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1171?email_source=notifications&email_token=AADG4SRDZRHH7NOKULOLHCDQX7LQJA5CNFSM4JTWZ3LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGQGQYA#issuecomment-564160608>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADG4SUY4U3LVMBERHC7X2DQX7LQJANCNFSM4JTWZ3LA>
.
|
What would sigaltstack be used for? I can't understand from a Google search. And why does it relate to ASAn? I need LD_PRELOAD because: So I run with: I build with: Then bind with: And link with: If I use a newer version from ASan, included in a newer version of GNAT, I get this for one program: We avoid using ASan from LLVM since we use GNAT. |
It seems that ASAN_OPTIONS=use_sigaltstack=1 prevents this crash. Does it make sense? |
Well it means that your ASan is more than half-a-decade old, because
use_sigaltstack has been on by default since April 2014.
…On Fri, Dec 13, 2019 at 7:10 AM João M. S. Silva ***@***.***> wrote:
It seems that ASAN_OPTIONS=use_sigaltstack=1 prevents this crash. Does it make sense?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I have hit the same bug. |
I think that I've just stumbled across this bug today, it happens after I
|
I'm hitting the same issue, here's a simple example to reproduce this with: |
Please paste source files directly here and do not link it to an external service: #include <pthread.h>
static void *thread_test(void *user)
{
(void)user;
struct timespec now1;
struct timespec now2;
struct timespec now3;
for (;;) {
clock_gettime(CLOCK_MONOTONIC, &now1);
clock_gettime(CLOCK_MONOTONIC, &now2);
clock_gettime(CLOCK_MONOTONIC, &now3);
clock_nanosleep(CLOCK_MONOTONIC, 0,
&(struct timespec){.tv_nsec = 1000000}, NULL);
}
return NULL;
}
int main()
{
pthread_t thread;
pthread_create(&thread, NULL, thread_test, NULL);
clock_nanosleep(CLOCK_MONOTONIC, 0,
&(struct timespec){.tv_nsec = 10000000}, NULL);
pthread_cancel(thread);
pthread_join(thread, NULL);
} |
I faced the same issue (at least same error message) in some code using signals and |
Currently when SPDK is built with `--enable-asan`, flag is not passed to DPDK mainly due to AsanCheckFailed that is seemingly a false positive. Forcing ASan to use single stack fix this issue, but it's not well documented (at all) and conversation attached below, has different and contradiction solutions proposed. This patch is only relevant if `-Db_sanitize=address` is enabled for DPDK. Mentioned conversation on ASan github and GCC bugzilla ``` google/sanitizers#1171 https://gcc.gnu.org/bugzilla//show_bug.cgi?id=101476 ``` Update comment regarding librados issue. Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Change-Id: Ic6a5743b56972ff1f9f9c0fefed34084180bb65b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19709 Reviewed-by: Ben Walker <ben@nvidia.com> Reviewed-by: Jim Harris <jim.harris@gmail.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Hi,
I get this error:
but absolutely no clues where to look.
Google seems to know nothing about this specific error.
How can I understand what's wrong and fix it?
The text was updated successfully, but these errors were encountered: