Warzone memory requested sizes (bytes) from malloc, printed out into a Distribution graph using ASCI format.
Code: Select all
# dtrace -n 'pid$target::malloc:entry { @ = quantize(arg0); }' -p 57036
dtrace: description 'pid$target::malloc:entry ' matched 1 probe
^C
value ------------- Distribution ------------- count
2 | 0
4 |@@@@ 3642
8 |@ 704
16 |@ 982
32 |@@@@@@@@@@@@@@@@ 15336
64 |@@@@@@@@@@@@@@@@ 15009
128 |@ 1367
256 |@@ 1505
512 | 8
1024 | 51
2048 | 41
4096 | 20
8192 | 0
16384 | 55
32768 | 0
Warzone memory returned (bytes) from requested
Code: Select all
dtrace -n 'pid$target::malloc:return { @ = quantize(arg0); }' -p 57036
dtrace: description 'pid$target::malloc:return ' matched 1 probe
^C
value ------------- Distribution ------------- count
2048 | 0
4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 63469
8192 | 0
Tracing warzone memory reqests for bytes size 16384, traced during game 1v1 against medium Nexus AI. Only seen once near start and couldn't replicate
Code: Select all
# dtrace -n 'pid$target::malloc:entry /arg0 == 16384/ { ustack(); }' -p 57036
dtrace: description 'pid$target::malloc:entry ' matched 1 probe
CPU ID FUNCTION:NAME
3 59594 __malloc:entry
libc.so.7`__malloc+0x1
libogg.so.8`ogg_stream_init+0x4c
libvorbisfile.so.6`_ov_open1+0x106
libvorbisfile.so.6`ov_open_callbacks+0x22
warzone2100`sound_CreateOggVorbisDecoder(PHYSFS_File*, bool)+0xc1
warzone2100`sound_PlayStreamWithBuf(PHYSFS_File*, float, void(*)(void*), void*, unsigned long, unsigned int)+0xf4
warzone2100`0x604a51
warzone2100`0x604c23
warzone2100`0x606812
warzone2100`0x60541c
warzone2100`sound_Update(void)+0x37
warzone2100`audio_Update(void)+0x235
warzone2100`gameLoop(void)+0xae1
warzone2100`mainLoop(void)+0x7c
warzone2100`wzMain3(void)+0x4d
warzone2100`realmain(int, char**)+0xd64
warzone2100`_start+0x16f
ld-elf.so.1`0x80094b000
Then checked a bit more common 256 size memory requests.
Code: Select all
dtrace -n 'pid$target::malloc:entry /arg0 == 256/ { ustack(); }' -p 57036
dtrace: description 'pid$target::malloc:entry ' matched 1 probe
CPU ID FUNCTION:NAME
1 59594 __malloc:entry
libc.so.7`__malloc+0x1
libc++.so.1`operator new(unsigned long)+0x2a
warzone2100`std::__1::vector<PROJECTILE*, std::__1::allocator<PROJECTILE*> >::vector(std::__1::vector<PROJECTILE*, std::__1::allocator<PROJECTILE*> > const&)+0x3c
warzone2100`proj_UpdateAll(void)+0x1d
warzone2100`gameLoop(void)+0x8ae
warzone2100`mainLoop(void)+0x7c
warzone2100`wzMain3(void)+0x4d
warzone2100`realmain(int, char**)+0xd64
warzone2100`_start+0x16f
ld-elf.so.1`0x80094b000
2 59594 __malloc:entry
libc.so.7`__malloc+0x1
libc++.so.1`operator new(unsigned long)+0x2a
warzone2100`std::__1::vector<PROJECTILE*, std::__1::allocator<PROJECTILE*> >::vector(std::__1::vector<PROJECTILE*, std::__1::allocator<PROJECTILE*> > const&)+0x3c
warzone2100`proj_UpdateAll(void)+0x1d
warzone2100`gameLoop(void)+0x8ae
warzone2100`mainLoop(void)+0x7c
warzone2100`wzMain3(void)+0x4d
warzone2100`realmain(int, char**)+0xd64
warzone2100`_start+0x16f
ld-elf.so.1`0x80094b000
3 59594 __malloc:entry
libc.so.7`__malloc+0x1
libc++.so.1`operator new(unsigned long)+0x2a
warzone2100`std::__1::vector<PROJECTILE*, std::__1::allocator<PROJECTILE*> >::vector(std::__1::vector<PROJECTILE*, std::__1::allocator<PROJECTILE*> > const&)+0x3c
warzone2100`proj_UpdateAll(void)+0x1d
warzone2100`gameLoop(void)+0x8ae
warzone2100`mainLoop(void)+0x7c
warzone2100`wzMain3(void)+0x4d
warzone2100`realmain(int, char**)+0xd64
warzone2100`_start+0x16f
ld-elf.so.1`0x80094b000
3 59594 __malloc:entry
libc.so.7`__malloc+0x1
libc++.so.1`operator new(unsigned long)+0x2a
warzone2100`std::__1::vector<PROJECTILE*, std::__1::allocator<PROJECTILE*> >::vector(std::__1::vector<PROJECTILE*, std::__1::allocator<PROJECTILE*> > const&)+0x3c
warzone2100`proj_UpdateAll(void)+0x1d
warzone2100`gameLoop(void)+0x8ae
warzone2100`mainLoop(void)+0x7c
warzone2100`wzMain3(void)+0x4d
warzone2100`realmain(int, char**)+0xd64
warzone2100`_start+0x16f
ld-elf.so.1`0x80094b000
Checked all realted malloc data later on... Curious about value 34359738368
Code: Select all
# dtrace -n 'pid$target::malloc: { @ = quantize(arg0); }' -p 57778
dtrace: description 'pid$target::malloc: ' matched 1190 probes
^C
value ------------- Distribution ------------- count
1 | 0
2 | 5184
4 |@@ 232419
8 | 7729
16 | 9461
32 |@@@@@@@@@@@@@@@@@@ 1660018
64 |@@@@@@@@@@@@@@@@@@ 1715728
128 |@ 99440
256 | 7851
512 | 4334
1024 | 108
2048 | 360
4096 | 36166
8192 | 0
16384 | 4382
32768 | 0
65536 | 0
131072 | 0
262144 | 0
524288 | 0
1048576 | 0
2097152 | 0
4194304 | 0
8388608 | 0
16777216 | 0
33554432 | 0
67108864 | 0
134217728 | 0
268435456 | 0
536870912 | 0
1073741824 | 0
2147483648 | 0
4294967296 | 0
8589934592 | 0
17179869184 | 0
34359738368 | 3435
68719476736 | 0
game crashed during trace of 34359738368
due to using PID provider which isn't stable due to exposing application functions perhaps.
due to pointer is to an address in user-land, whereas DTrace runs in kernel-land – so it can’t be dereferenced directly..
Code: Select all
# dtrace -n 'pid$target:libc.so.7:strcmp:entry { trace(stringof(arg0)); }' -p 57036
"dtrace: error on enabled probe ID 1 (ID 62753: pid57036:libc.so.7:strcmp:entry): invalid address (0x80ac84112) in action #1"
oops, need instead... seems to crash game
Code: Select all
# dtrace -n 'pid$target:libc.so.7:strcmp:entry { trace(copyinstr(arg0)); }' -p 57752
On FreeBSD so checking network function, (whilst in online lobby) join game list, host game and refresh server list.
first checked for getaddrinfo function:name
59594 pid57814 libc.so.7 getaddrinfo entry
59595 pid57814 libc.so.7 getaddrinfo return
Code: Select all
# dtrace -n 'pid$target::getaddrinfo:entry { printf("%s %s", copyinstr(arg1), copyinstr(arg1)); }' -p 57814
dtrace: description 'pid$target::getaddrinfo:entry ' matched 1 probe
CPU ID FUNCTION:NAME
2 59594 getaddrinfo:entry 9990 9990
2 59594 getaddrinfo:entry 53 53
2 59594 getaddrinfo:entry 9990 9990
3 59594 getaddrinfo:entry 1900 1900
2 59594 getaddrinfo:entry 8000 8000
0 59594 getaddrinfo:entry 8000 8000
3 59594 getaddrinfo:entry 8000 8000
2 59594 getaddrinfo:entry 9990 9990
Code: Select all
# dtrace -n 'pid$target::getaddrinfo:return { printf("%s %s", copyinstr(arg1), copyinstr(arg1)); }' -p 57814
dtrace: description 'pid$target::getaddrinfo:return ' matched 1 probe
dtrace: error on enabled probe ID 1 (ID 59595: pid57814:libc.so.7:getaddrinfo:return): invalid address (0x0) in action #1 at DIF offset 12
dtrace: error on enabled probe ID 1 (ID 59595: pid57814:libc.so.7:getaddrinfo:return): invalid address (0x0) in action #1 at DIF offset 12
something went wrong there.
Code: Select all
# dtrace -n 'pid$target::getaddrinfo:entry { printf("%s %s", arg0 != NULL ? copyinstr(arg0) : "<NULL>", arg1 != NULL ? copyinstr(arg1) : "<NULL>"); }' -p 57814
dtrace: description 'pid$target::getaddrinfo:entry ' matched 1 probe
CPU ID FUNCTION:NAME
0 59594 getaddrinfo:entry lobby.wz2100.net 9990
2 59594 getaddrinfo:entry lobby.wz2100.net 9990
3 59594 getaddrinfo:entry 239.255.255.250 1900
2 59594 getaddrinfo:entry lobby.wz2100.net 9990
1 59594 getaddrinfo:entry 192.168.1.254 8000
2 59594 getaddrinfo:entry 192.168.1.254 8000
3 59594 getaddrinfo:entry 192.168.1.254 8000
2 59594 getaddrinfo:entry lobby.wz2100.net 9990
2 59594 getaddrinfo:entry lobby.wz2100.net 9990
2 59594 getaddrinfo:entry lobby.wz2100.net 9990
2 59594 getaddrinfo:entry lobby.wz2100.net 9990