OpenSolaris

Printable Version Enter a New Search
Bug ID 6705554
Synopsis dtrace_disx86() returns incorrect instruction size causing spurious watchpoint traps
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:dis
Keywords oss-request
Sponsor Jonathan Haslam
Submitter beevers
Responsible Engineer Jonathan Haslam
Reported Against
Duplicate Of
Introduced In solaris_10
Commit to Fix snv_92
Fixed In snv_92
Release Fixed solaris_nevada(snv_92) , solaris_10u7(s10u7_02) (Bug ID:2165708)
Related Bugs
Submit Date 21-May-2008
Last Update Date 23-September-2008
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.
Work Around
N/A
Comments
N/A