|
Description
|
If you have a trivial piece of code like the following, compiled 64 bit,
and run two copies with watchmalloc.so.1 preloaded (MALLOC_DEBUG=WATCH,RW)
then one copy quickly receives a write watchpoint trap on a valid address:
int
main(int argc, char* argv[])
{
int i = 0;
int *bar = (int *)malloc(4 * sizeof(int));
for (i = 0; i < 1000000000; i++)
{
bar[3] = 0xffffffff;
}
return (0);
}
Executing the above twice we get a write watchpoint trap delivered to one of the
processes:
# export LD_PRELOAD_64=watchmalloc.so.1
# export MALLOC_DEBUG=WATCH,RW
# ./watch
Trace/Breakpoint Trap(coredump)
The problem is owing to incorrect symbol scoping for a couple of variables used in
dtrace_disx86(). See evaluation.
|