Monday 14 March 2011

The road to insanity....


/home/fox/src/dtrace@vmub10-64: build/dtrace -S -n io:::start'{printf("%x %x %x %s %s %p", args[1]->dev_major, args[1]->dev_minor, args[1]->dev_instance, args[2]->fi_pathname, args[1]->dev_pathname, arg2);exit(0);}'

DIFO 0xf3d0d0 returns D type (integer) (size 4)
OFF OPCODE INSTRUCTION
00: 25000001 setx DT_INTEGER[0], %r1 ! 0x0
01: 28000101 ldga DT_VAR(0), %r1, %r1
02: 0e010002 mov %r1, %r2
03: 25000103 setx DT_INTEGER[1], %r3 ! 0x48
04: 07020302 add %r2, %r3, %r2
05: 1e020002 ldsw [%r2], %r2
06: 23000002 ret %r2

DIFO 0xf3d330 returns D type (integer) (size 4)
OFF OPCODE INSTRUCTION
00: 25000001 setx DT_INTEGER[0], %r1 ! 0x0
01: 28000101 ldga DT_VAR(0), %r1, %r1
02: 0e010002 mov %r1, %r2
03: 25000103 setx DT_INTEGER[1], %r3 ! 0x48
04: 07020302 add %r2, %r3, %r2
05: 25000203 setx DT_INTEGER[2], %r3 ! 0x4
06: 07020302 add %r2, %r3, %r2
07: 1e020002 ldsw [%r2], %r2
08: 23000002 ret %r2

DIFO 0xf3d420 returns D type (integer) (size 4)
OFF OPCODE INSTRUCTION
00: 25000001 setx DT_INTEGER[0], %r1 ! 0x0
01: 28000101 ldga DT_VAR(0), %r1, %r1
02: 0e010002 mov %r1, %r2
03: 25000103 setx DT_INTEGER[1], %r3 ! 0x48
04: 07020302 add %r2, %r3, %r2
05: 25000203 setx DT_INTEGER[2], %r3 ! 0x8
06: 07020302 add %r2, %r3, %r2
07: 1e020002 ldsw [%r2], %r2
08: 23000002 ret %r2
...


Look at those 0x48's above -- corresponding to the
first 3 computed args to the printf.

Now...the question is : why?

The CTF type code is miscomputing the offset into the structure
for the dev_major, dev_minor and dev_instance members. ctfdump
is showing the correct values:


STRUCT devinfo_t (40 bytes)
dev_major type=4 off=0
dev_minor type=4 off=32
dev_instance type=4 off=64
dev_name type=75 off=128
dev_statname type=75 off=192
dev_pathname type=75 off=256


I wander whats going on - maybe I broke something....

Only time will tell.



Post created by CRiSP v10.0.3b-b5947


No comments:

Post a Comment