From: Endre S. X <end...@er...> - 2010-03-10 12:40:16
|
Hi guys, Is sipp still actively developed ? Is it worth to post bug reports ? :) If yes, I have more information to this one (I could not update the bug report in the trakcer, so I post it here): Segmentation fault when the first command is sendCmd - ID: 2966434 "SIPp makes a segfault when the first command in the master's scenario is a sendCmd. It works fine, if sendCmd follows a regular send command. If nop or pause precedes the sendCmd, it does not help either. The problem can always be reproduced. Segmentation fault ./sipp -sf ../scenarios/3pty/3pty_normal_A_send.xml -inf ../scenarios/3pty/3pty_normal.csv -i 130.100.227.249 10.64.65.4:5082 -mp 6252 -buff_size 1000000000 -slave_cfg ../scenarios/3pty/3pty_normal_3PCC.cfg -master 3pty_normal_A_master -r 0 -rp 1000 -l 100" The problem is in function struct sipp_socket *get_peer_socket(char * peer) in sipp.cpp: struct sipp_socket **get_peer_socket(char * peer) { struct sipp_socket **peer_socket; T_peer_infos infos; peer_map::iterator peer_it; peer_it = peers.find(peer_map::key_type(peer)); if(peer_it != peers.end()) { infos = peer_it->second; peer_socket = &(infos.peer_socket); return peer_socket; } else { ERROR("get_peer_socket: Peer %s not found\n", peer); } return NULL; } The pointer returned points to a field of an object created on the STACK. When returning from the function, this value becomes invalid (in my case) hence the segmentation fault occurs. The fix is to avoid giving back a reference to a local object: simply pass back 'infos.peer_socket' instead of its address. So the return value of this function will become * instead of **: struct sipp_socket *get_peer_socket(char * peer); Regards, Endre |