I''m trying to figure out why devfsadm is crashing in strcmp (actually, I suspect it''s related to lofi breaking and this condition surviving several reboots, but can''t track it down any further). omega# devfsadm -C zsh: segmentation fault (core dumped) devfsadm -C omega# pstack core core ''core'' of 616: devfsadm -C ff130910 strcmp (10, feea2210, 503f0, 0, 19290, 5e350) + 170 00017048 ???????? (ffbff850, 5e350, 36000, 5e328, 0, 503f0) 00016eb0 ???????? (5e2a0, 5e350, ffbff9b8, ff377e88, 5e380, ff398680) ff3782fc walk_one_minor_list (0, 0, 10, ffbff9b8, 16dd4, 5e350) + b0 ff3783f4 di_walk_minor (5dba8, 0, 10, ffbff9b8, 16dd4, 36000) + d0 000151b0 ???????? (ffbff9b8, 37fc8, 0, 23804, 5e050, 1ae74) 0001549c ???????? (0, 20df2f, 37838, 37fc8, dc00, df2f) 00013f00 main (2, ffbffb24, 0, 22438, 0, 36000) + 340 00013ba8 _start (0, 0, 0, 0, 0, 0) + 108 So I tried the following: omega# cat strcmp.d #!/usr/sbin/dtrace -s ::strcmp:entry /execname == "devfsadm"/ { self->first = arg0; self->second = arg1; } ::strcmp:return /execname == "devfsadm"/ { printf("strcmp(''%s'', ''%s'');\n", copyinstr(self->first), copyinstr(self->second)); self->first = 0; self->second = 0; } But when I try running this, I get: dtrace: script ''./strcmp.d'' matched 2 probes dtrace: error on enabled probe ID 2 (ID 28794: fbt:genunix:strcmp:return): invalid address (0x600031d6000) in action #1 at DIF offset 28 dtrace: error on enabled probe ID 2 (ID 28794: fbt:genunix:strcmp:return): invalid address (0x600031d6000) in action #1 at DIF offset 28 dtrace: error on enabled probe ID 2 (ID 28794: fbt:genunix:strcmp:return): invalid address (0x2a100678000) in action #1 at DIF offset 28 dtrace: error on enabled probe ID 2 (ID 28794: fbt:genunix:strcmp:return): invalid address (0x2a100678000) in action #1 at DIF offset 28 [...] Why is this happening? Of course I''m not going to catch the crashing invocation with the above, but I''m just trying to get a start at looking into the function''s arguments. --Nicholas This message posted from opensolaris.org
Casper.Dik at Sun.COM
2006-Dec-22 13:50 UTC
[dtrace-discuss] capturing arguments to strcmp?
>I''m trying to figure out why devfsadm is crashing in strcmp (actually, >I suspect it''s related to lofi breaking and this condition surviving >several reboots, but can''t track it down any further).>omega# devfsadm -C >zsh: segmentation fault (core dumped) devfsadm -CThis is outside the kernel.>omega# pstack core >core ''core'' of 616: devfsadm -C > ff130910 strcmp (10, feea2210, 503f0, 0, 19290, 5e350) + 170 > 00017048 ???????? (ffbff850, 5e350, 36000, 5e328, 0, 503f0) > 00016eb0 ???????? (5e2a0, 5e350, ffbff9b8, ff377e88, 5e380, ff398680) > ff3782fc walk_one_minor_list (0, 0, 10, ffbff9b8, 16dd4, 5e350) + b0 > ff3783f4 di_walk_minor (5dba8, 0, 10, ffbff9b8, 16dd4, 36000) + d0 > 000151b0 ???????? (ffbff9b8, 37fc8, 0, 23804, 5e050, 1ae74) > 0001549c ???????? (0, 20df2f, 37838, 37fc8, dc00, df2f) > 00013f00 main (2, ffbffb24, 0, 22438, 0, 36000) + 340 > 00013ba8 _start (0, 0, 0, 0, 0, 0) + 108 > >So I tried the following: > >omega# cat strcmp.d >#!/usr/sbin/dtrace -s >::strcmp:entry >/execname == "devfsadm"/ >{ > self->first = arg0; > self->second = arg1;This is inside the kernel.>Why is this happening? Of course I''m not going to catch the crashing >invocation with the above, but I''m just trying to get a start at >looking into the function''s arguments.You''re catching the wrong strcmp; and the one you are catching is inside the kernel and the arguments to it don''t need to be copied with copyinstr(). Starting with "truss" or a debugger on the core looks more helpful. (Or use the pid provider) Casper