Closed ramosian-glider closed 9 years ago
This is probably caused by mach_override incorrectly patching dispatch_async_f.
From gobjdump:
0000000000003939 <_dispatch_async_f>:
3939: 83 7f 3c 01 cmpl $0x1,0x3c(%rdi)
393d: 74 4d je 398c <_dispatch_async_f+0x53>
From gdb:
(gdb) printf "%p\n", (void*)_ZN14__interception21real_dispatch_async_fE
0x7fffffd18000
(gdb) disas 0x7fffffd18000 0x7fffffd18020
Dump of assembler code from 0x7fffffd18000 to 0x7fffffd18020:
0x00007fffffd18000: cmpl $0x1,0x3c(%rdi)
0x00007fffffd18004: je 0x7fffffd18053
The 2-byte je instruction is copied verbatim, so that becomes a wild jump into nowhere.
We'll need to somehow fix mach_override:
-- it can patch both jump branches separately -- does not scale generally
-- or it can copy the whole function so that every jump remains inside the function.
Maybe an ad-hoc solution for just dispatch_async_f will go.
Reported by ramosian.glider
on 2012-03-21 16:38:21
Please remind why we need to intercept those beasts at all.
yes, they create threads. Can we ignore it?
Reported by konstantin.s.serebryany
on 2012-03-21 16:46:44
The funny thing is that I've added those short jumps to the list of known instructions
myself, which was quite silly.
What I'm planning to do now is to expand short jumps into long ones when copying them
to the branch island.
I consider disabling any interceptors conceptually wrong. The interception mechanism
is broken, so we need to fix it rather than disable code that depends on it.
Reported by ramosian.glider
on 2012-03-22 08:54:11
LLVM r153249 should fix this issue. Both 32-bit and 64-bit ASan tests pass for me on
Lion (modulo HugeMallocTest, for which the memory limit should be tuned).
Reported by ramosian.glider
on 2012-03-22 11:56:31
Fixed
Adding Project:AddressSanitizer as part of GitHub migration.
Reported by ramosian.glider
on 2015-07-30 09:12:58
Originally reported on Google Code with ID 53
Reported by
ramosian.glider
on 2012-03-20 13:37:39