OpenSolaris

Printable Version Enter a New Search
Bug ID 6583726
Synopsis race between program and process destruction
State 10-Fix Delivered (Fix available in build)
Category:Subcategory library:libdtrace
Keywords
Responsible Engineer Adam Leventhal
Reported Against
Duplicate Of
Introduced In solaris_10
Commit to Fix snv_88
Fixed In snv_88
Release Fixed solaris_nevada(snv_88) , solaris_10u8(s10u8_01) (Bug ID:2175828)
Related Bugs
Submit Date 21-July-2007
Last Update Date 20-April-2009
Description
# uname -a
SunOS rampage 5.11 snv_66 i86pc i386 i86pc

With the following DTrace script - 

#!/usr/sbin/dtrace -s

#pragma D option flowindent

pid$target:libgtk-x11-2.0.so.0.1000.12::entry {
}
pid$target:libgtk-x11-2.0.so.0.1000.12::return {
}

invoked with the following command -

# ./dtrace-script -Z -c 'zenity --about'

When you immediately see the 'matched 0 probes', ^C the execution, and it'll die with a segmentation fault, and resulting stack trace -

# pstack dtrace-core 
core 'dtrace-core' of 7698:     /usr/sbin/dtrace -s ./zenity.d -Z -c zenity --about
-----------------  lwp# 1 / thread# 1  --------------------
 d29fd129 __lwp_park (d28f2a00, 0, 82d1ca8, 0) + 19
 d29f6124 slow_lock (d28f2a00, 82d1ca8, 0) + 40
 d29f627b mutex_lock_impl (82d1ca8, 0) + 14b
 d29f6362 mutex_lock (82d1ca8) + 1d
 d2b59ed8 dt_proc_destroy (806b608, 82d1cf8) + bc
 d2b5a832 dt_proc_hash_destroy (806b608) + 2e
 d2b42f34 dtrace_close (806b608) + 128
 08055868 main     (6, 8047ab4, 8047ad0) + 1440
 08052212 _start   (6, 8047bba, 8047bc1, 8047bc4, 8047bcf, 8047bd2) + 7a
-----------------  lwp# 2 / thread# 2  --------------------
 d2b546ff dt_pid_get_pid (8b645795, 806b608, 0, 82d1890) + 23
 d2b54adf dt_pid_create_probes_module (806b608, 82d1890) + 73
 d2b593fd dt_proc_rdevent (806b608, 82d1890, d2b6fed8) + b5
 d2b59034 dt_proc_bpmatch (806b608, 82d1890) + a0
 d2b59bba dt_proc_control (8047858) + 36e
 d29fce72 _thr_setup (d0bf0200) + 52
 d29fd0d0 _lwp_start (d0bf0200, 0, 0, 0, 0, 0)

In the process of uploading a core file here -

http://www.gnome.org/~gman/dtrace-core

Should be available soon.
also seen on snv_69 64bit kernel amd64 box

seans:~/langs/d$ dtrace -Z -s gman1.d -c 'zenity --about'
dtrace: script 'gman1.d' matched 0 probes
^C
CPU FUNCTION                                 
  0  -> gtk_init                              
  0    -> gtk_init_check                      
  0      -> gtk_parse_args                    
  0        -> gettext_initialization          
  0        <- gettext_initialization          
  0        -> check_setugid                   
  0        <- check_setugid                   
  0        -> gtk_get_option_group            
  0          -> gettext_initialization        
  0          <- gettext_initialization        
  0        <- gtk_get_option_group            
  0        -> pre_parse_hook                  
  0        <- pre_parse_hook                  
  0        -> post_parse_hook                 
  0          -> gettext_initialization        
  0          <- gettext_initialization        
  0          -> gtk_type_init                 
  0            -> gtk_object_get_type         
  0            <- gtk_object_get_type         
  0          <- gtk_type_init                 
  0          -> _gtk_accel_map_init           
  0          <- _gtk_accel_map_init           
  0          -> _gtk_rc_init                  
  0            -> gtk_rc_add_initial_default_files 
  0              -> gtk_rc_add_default_file   
  0                -> gtk_rc_add_initial_default_files 
  0                <- gtk_rc_add_initial_default_files 
  0              <- gtk_rc_add_default_file   
  0              -> gtk_rc_add_default_file   
  0                -> gtk_rc_add_initial_default_files 
  0                <- gtk_rc_add_initial_default_files 
  0              <- gtk_rc_add_default_file   
  0            <- gtk_rc_add_initial_default_files 
  0            -> gtk_rc_parse_string         
  0            <- gtk_rc_parse_string         
  0          <- _gtk_rc_init                  
  0        <- post_parse_hook                 
  0      <- gtk_parse_args                    

Segmentation Fault (core dumped)
seans:~/langs/d$ 

bash-3.00# pstack core.dtrace.6570.11850480
pstack: cannot examine core.dtrace.6570.11850480: no such process or core file
bash-3.00# pstack core.dtrace.6570.1185048065 
core 'core.dtrace.6570.1185048065' of 6570:     dtrace -Z -s gman1.d -c zenity -
-about
-----------------  lwp# 1 / thread# 1  --------------------
 fffffd7fff18b9d7 __lwp_park () + 17
 fffffd7fff1841c6 mutex_lock_impl () + 116
 fffffd7fff18425c mutex_lock () + c
 fffffd7fff3305a4 dt_proc_destroy () + b4
 fffffd7fff330f4c dt_proc_hash_destroy () + 2c
 fffffd7fff319797 dtrace_close () + 117
 000000000040729d main () + 164d
 00000000004031cc ???????? ()
-----------------  lwp# 2 / thread# 2  --------------------
 fffffd7fff32b1a0 dt_pid_create_probes_module () + 50
 fffffd7fff32fa32 dt_proc_rdevent () + b2
 fffffd7fff32f664 dt_proc_bpmatch () + a4
 fffffd7fff3301fb dt_proc_control () + 37b
 fffffd7fff18b6e7 _thr_setup () + 67
 fffffd7fff18b990 _lwp_start ()
bash-3.00# 

  fairly easy to reproduce.

   core at /net/greyarea.ireland/export/home/sean/cores/core.dtrace.6570.1185048065.bz2
The final updated core (bad hotel connection) had the following pstack

core 'core' of 2791:    /usr/sbin/dtrace -s ./dtrace-script -Z -c zenity --about
-----------------  lwp# 1 / thread# 1  --------------------
 d29fd129 __lwp_park (d28f2a00, 0, 8145c90, 0) + 19
 d29f6124 slow_lock (d28f2a00, 8145c90, 0) + 40
 d29f627b mutex_lock_impl (8145c90, 0) + 14b
 d29f6362 mutex_lock (8145c90) + 1d
 d2b59ed8 dt_proc_destroy (806b608, 82d08a0) + bc
 d2b5a832 dt_proc_hash_destroy (806b608) + 2e
 d2b42f34 dtrace_close (806b608) + 128
 08055868 main     (6, 8047aec, 8047b08) + 1440
 08052212 _start   (6, 8047bee, 8047bf5, 8047bf8, 8047c08, 8047c0b) + 7a
-----------------  lwp# 2 / thread# 2  --------------------
 d2b546ff dt_pid_get_pid (e374, 806b608, 0, 8145878) + 23
 d2b54adf dt_pid_create_probes_module (806b608, 8145878) + 73
 d2b593fd dt_proc_rdevent (806b608, 8145878, d2b6fed8) + b5
 d2b59034 dt_proc_bpmatch (806b608, 8145878) + a0
 d2b59bba dt_proc_control (8047888) + 36e
 d29fce72 _thr_setup (d0bb0200) + 52
 d29fd0d0 _lwp_start (d0bb0200, 0, 0, 0, 0, 0)
Work Around
N/A
Comments
N/A