Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#38907 - [valgrind] kernel CONFIG_MEM_SOFT_DIRTY causes pthread_attr_getstack bug
Attached to Project:
Arch Linux
Opened by sergio (sergio) - Thursday, 13 February 2014, 23:53 GMT
Last edited by Tobias Powalowski (tpowa) - Wednesday, 19 March 2014, 16:05 GMT
Opened by sergio (sergio) - Thursday, 13 February 2014, 23:53 GMT
Last edited by Tobias Powalowski (tpowa) - Wednesday, 19 March 2014, 16:05 GMT
|
DetailsDescription:
Valgrind 3.9 seems broken on archlinux, tested OK in other distros. Compile the attached program: g++ -g main.cpp -lpthread valgrind ./a.out The expected result would be like: Stack size: 8388608; success= 0 But our broken valgrind gives: Stack size: 8192; success= 0 This makes it impossible to valgrind any webkit program... Max stack size is usually 8MB, as you can see by running the snipplet without valgrind, or running under an unbroken version of valgrind. Edit: this is caused by CONFIG_MEM_SOFT_DIRTY in the Linux kernel |
This task depends upon
main.cpp
I tested valgrind-3.7 and it still happens, so it's something else that archlinux does... not sure what
Stack size: 8384512; success= 0
Maybe it's not glibc but something else we do differently
But testing it natively in suse ( without chroot ) I can't reproduce.
So this has nothing to do with valgrind/glibc version, maybe some sysctl setting
By chance does this work if you run valgrind as root?
@Dave, I can reproduce the bug as root
https://paste.xinu.at/NN3opq/
Looking at Dave's diff, everything he "added" is present as a module in the Arch build. So it must be something set by Arch that is breaking this.
There are 713 things set by Arch that are not set by Dave...
The result is that any QML code fails to evaluate and the application shows a blank window.
The Qt JavaScript engine tries to throw a "Maximum call stack size exceeded." exception, however the engine checks the stack again while trying to print the exception, and the only thing that shows up on the console is:
<Unknown File>:
<Unknown File>:
...
getStackLimit() in qtdeclarative/src/qml/jsruntime/qv4engine.cpp calls pthread_attr_getstack, which returns an unexpected 8k small stack size. A larger safety range of 256k is added at the end of the function which causes the stack check to fail every time.
$ uname -a
Linux archie 3.13.6-1-ARCH #1 SMP PREEMPT Fri Mar 7 22:47:48 CET 2014 x86_64 GNU/Linux
$ zgrep CONFIG_MEM_SOFT_DIRTY /proc/config.gz
CONFIG_MEM_SOFT_DIRTY=y
$ g++ -g main.cpp -lpthread
$ valgrind ./a.out
==46867== Memcheck, a memory error detector
==46867== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==46867== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==46867== Command: ./a.out
==46867==
Stack size: 8388608; success= 0
==46867==
==46867== HEAP SUMMARY:
==46867== in use at exit: 0 bytes in 0 blocks
==46867== total heap usage: 4 allocs, 4 frees, 960 bytes allocated
==46867==
==46867== All heap blocks were freed -- no leaks are possible
==46867==
==46867== For counts of detected and suppressed errors, rerun with: -v
==46867== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)
I use a virtual machine with [testing] repo, all packages up-to-date. I do not see the issue...