[valgrind] [Bug 416436] Unrecognised instruction at address 0x1006037BD (__pthread_init.cold.2) macOS 10.15
https://bugs.kde.org/show_bug.cgi?id=416436 --- Comment #2 from Louis Brunner --- Created attachment 125843 --> https://bugs.kde.org/attachment.cgi?id=125843&action=edit Fix _pthread_init illegal instruction by providing ptr_munge I have been investigating the problem and I have a fix (patch included). Some context: it is difficult to be sure without the libpthread sources for 10.15, but if you check libpthread-330.250.2 (for 10.14), you will find a parse_ptr_munge_params function that tries to get ptr_munge value from the environment (through the Apple environment or an actual environment variable, PTHREAD_PTR_MUNGE_TOKEN). In previous versions, __pthread_init would just carry on even if the value wasn't defined, but while stepping through the code, I have found that macOS 10.15 seems to crash using the ud2 instruction just after the environment variable check, hinting that this value is now required. My patch adds PTHREAD_PTR_MUNGE_TOKEN with a value of 1 everytime valgrind starts a program. Note that a value of 0 is considered an error by pthread. Disclaimer: while I found where ptr_munge is generated (kernel) and used (some kind of conversion in jmp instructions in libplatform), I don't understand what it does exactly. On the other hand, the dummy value doesn't seem to make a difference when executing a program with valgrind. -- You are receiving this mail because: You are watching all bug changes.
[valgrind] [Bug 416436] Unrecognised instruction at address 0x1006037BD (__pthread_init.cold.2) macOS 10.15
https://bugs.kde.org/show_bug.cgi?id=416436 Louis Brunner changed: What|Removed |Added CC||louis.brunner...@gmail.com -- You are receiving this mail because: You are watching all bug changes.
[valgrind] [Bug 416436] Unrecognised instruction at address 0x1006037BD (__pthread_init.cold.2) macOS 10.15
https://bugs.kde.org/show_bug.cgi?id=416436 John Reiser changed: What|Removed |Added CC||jrei...@bitwagon.com --- Comment #1 from John Reiser --- The 'ud2' instruction is the calling convention to request that MacOS respond to a fatal error detected by run-time library code. This is almost certainly a symptom that valgrind did not emulate a recent system call correctly. See https://bugs.kde.org/show_bug.cgi?id=383723#c20 for a similar case more than 2 years ago. -- You are receiving this mail because: You are watching all bug changes.
[valgrind] [Bug 416436] Unrecognised instruction at address 0x1006037BD (__pthread_init.cold.2) macOS 10.15
https://bugs.kde.org/show_bug.cgi?id=416436 Rhys Kidd changed: What|Removed |Added Assignee|jsew...@acm.org |rhysk...@gmail.com Status|REPORTED|CONFIRMED Ever confirmed|0 |1 Blocks||412745 Referenced Bugs: https://bugs.kde.org/show_bug.cgi?id=412745 [Bug 412745] Support macOS Catalina (10.15) -- You are receiving this mail because: You are watching all bug changes.