This is an archive of the discontinued LLVM Phabricator instance.

Double size of sigaltstack to prevent overflow
AbandonedPublic

Authored by Hahnfeld on Jun 10 2016, 12:54 AM.

Details

Summary

On a crash printSymbolizedStackTrace(...) would need more memory than currently
allocated and therefore corrupts some data in front of sigaltstack.

Diff Detail

Event Timeline

Hahnfeld updated this revision to Diff 60318.Jun 10 2016, 12:54 AM
Hahnfeld retitled this revision from to Double size of sigaltstack to prevent overflow.
Hahnfeld updated this object.
Hahnfeld added a reviewer: rsmith.
Hahnfeld added a subscriber: llvm-commits.

Friendly ping...

I'm seeing the same problem, which is fixed with this patch. I'm seeing a hang when running llvm-lit with test/Bugpoint/crash-narrowfunctiontest.ll. The hang appears to be caused because data in the stack frame is corrupted, and the clear() method in a vector never returns, when executing CallBacksToRun->clear() in RunSignalHandlers().

This happens only when I build llvm in Debug mode. In Release mode, the problem doesn't occur. Also, if I build llvm in Debug mode, but compile only Signals.cpp with -O3, the failure doesn't occur.

I'm not sure how much stack space is needed on the alternate stack, though I tried MINSIGSTKSZ + 11264 and that works for me.

I'm seeing the same problem, which is fixed with this patch. I'm seeing a hang when running llvm-lit with test/Bugpoint/crash-narrowfunctiontest.ll. The hang appears to be caused because data in the stack frame is corrupted, and the clear() method in a vector never returns, when executing CallBacksToRun->clear() in RunSignalHandlers().

This happens only when I build llvm in Debug mode. In Release mode, the problem doesn't occur. Also, if I build llvm in Debug mode, but compile only Signals.cpp with -O3, the failure doesn't occur.

I'm not sure how much stack space is needed on the alternate stack, though I tried MINSIGSTKSZ + 11264 and that works for me.

Yes, exactly. @rsmith is this ok to commit?

Ping, I'd like to land this before branching for 3.9.

Thanks,
Jonas

Ping! I'm not sure if there was any reasoning behind choosing this magic number...

Weekly ping...

Another ping for this one-liner...

Hahnfeld abandoned this revision.Aug 25 2016, 12:13 AM

Has been done in rL279599