Summary: | pthread_create() then alloca() causing invalid stack write errors. | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Daniel Stodden <daniel> |
Component: | memcheck | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dimhen, philippe.waroquiers |
Priority: | NOR | ||
Version: | 3.9.0.SVN | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Demo test prog. |
Description
Daniel Stodden
2013-07-04 18:38:02 UTC
(In reply to comment #0) > > ==23755== Invalid write of size 8 > ==23755== at 0x4006B7: __yell (test2.c:16) > ==23755== by 0x40076C: main (test2.c:30) > ==23755== Address 0xffeffeed0 is on thread 1's stack > ==23755== > ==23755== (action on error) vgdb me ... Testing on Ubuntu 12.10 on amd64 and x86, no such error is reported by Valgrind 3.8.1 or by the last 3.9.0 SVN. Also tested on some others systems/platforms (e.g. f12/x86, debian/ppc), none of them gives an error. (In reply to comment #0) > Address 0xFFEFFEED0 len 256 has 144 bytes unaddressable > > Meanwhile the trivial workaround is to memset every result of alloca. Also, it is not very clear how a memset of the alloca result will solve an "unnaddressable" error. It would however solve a "use uninitialised error". (In reply to comment #1) > (In reply to comment #0) > > > > ==23755== Invalid write of size 8 > > ==23755== at 0x4006B7: __yell (test2.c:16) > > ==23755== by 0x40076C: main (test2.c:30) > > ==23755== Address 0xffeffeed0 is on thread 1's stack > > ==23755== > > ==23755== (action on error) vgdb me ... > Testing on Ubuntu 12.10 on amd64 and x86, no such error is reported by > Valgrind 3.8.1 or by the last 3.9.0 SVN. > Also tested on some others systems/platforms (e.g. f12/x86, debian/ppc), > none of them > gives an error. You need to hit a race between threads spawning and main()'s eventualy entry into __yell(). I agree that's not as deterministic as desirable, for a simple test/demo. I'd suggest to bump up the thread count, to e.g. thr[32]. That's where I got it to repro on the notebook I'm looking at. Raring/amd64: ii libc6:amd64 2.17-0ubuntu5 amd64 Embedded GNU C Library: Shared libraries ii valgrind 1:3.8.1-1ubunt amd64 instrumentation framework for building dyna fixed in revision 13467. Thanks for the small reproducer (used as the basis of the regression test). |