Re: truss crashing process

From: Dan Nelson <dnelson_at_allantgroup.com>
Date: Wed, 27 Jul 2011 11:35:49 -0500
In the last episode (Jul 27), Alexander Best said:
> hi there,
> 
> i was trying to attach truss to chromium via
> 
> 'truss -p 18445' and got:
> 
> [...]
> kevent(26,{},0,{0x1b,EVFILT_READ,0x0,0,0x1,0x44cb600 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x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x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,!
 0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,0x0,0x0,0,0x0,0x0 0x0,!
 0x0,0x0,
> -- UNKNOWN SYSCALL -14720592 --
> write(-14720976,0x8080808080808000,0)		 = 41 (0x29)
> select(94,0x6acd,{0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 40 41 42 43 44 45 46 70 71 72 73 76 77 78 79 80 81 82 84 87 88 91},0x1,{0.85048848 }) = 73 (0x49)
> -- UNKNOWN SYSCALL 303120384 --
> #94(0x0,0x0,0x5e,0xb6cd600,0x83ed780,0x3dae410)	 = 189 (0xbd)
> truss: Cannot malloc -14740096 bytes for fd_set array: Cannot allocate memory

Invalid syscalls numbers like that usually mean that truss has attached to a
process in the middle of a syscall.  The ptrace API fires the same event for
syscall enter and exit, so if truss is expecting an enter and gets an exit,
you get a mangled syscall number and eventually truss will coredump trying
to decode incorrect data.

Try applying the patch at https://www.evoy.net/FreeBSD/truss.diff , which
amongst other things, fixes this problem.  If you just want the syscall fix,
search the diff for "50-50 chance" and manually patch that if(){} block in
your source.

-- 
	Dan Nelson
	dnelson_at_allantgroup.com
Received on Wed Jul 27 2011 - 14:46:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:16 UTC