Re: [Sipp-users] label, next and ontimeout broken in 3.1
I had another look at this and the nextLabels map already has a strdup (leaking memory of course). So a crude fix to the problem is to change: line 739 of scenario.cpp to: labelMap[strdup(ptr)] = length; and line 1639 of scenario.cpp to: ontimeoutLabels[length] = strdup(ptr); and put a note on the TODO list about the leaking memory. I have tested it and it does fix Sumeet's issue. The memory loss is one off not continuous. Peter From: plh...@hotmail.com To: cpwri...@us.ibm.com Date: Wed, 13 Jan 2010 22:48:18 + CC: sipp-users@lists.sourceforge.net Subject: Re: [Sipp-users] label, next and ontimeout broken in 3.1 Charles, Care is needed to delete the space that strdup allocates (from malloc so free() is needed). I'm assuming that since the label maps are only needed for the scenario compilation, they are freed before the main phase. (I can see code that frees the maps.) Already I see that strdup is used with txnRevMap and the map freed without freeing the strdup allocations. Peter Subject: Re: [Sipp-users] label, next and ontimeout broken in 3.1 To: plh...@hotmail.com CC: sipp-users@lists.sourceforge.net; sumeet_bhard...@persistent.co.in From: cpwri...@us.ibm.com Date: Wed, 13 Jan 2010 16:13:55 -0500 I think the best answer would be to strdup the return from xp_get_value, as the named labels are far friendlier when writing any complex scenario that uses more than a handful of labels. Charles Peter Higginson ---01/13/2010 16:09:56--- Peter Higginson 01/13/2010 16:08 To , sipp_users cc Subject [Sipp-users] label, next and ontimeout broken in 3.1 The C routine xp_get_value returns a pointer to a static buffer from which a value is normally extracted, or in a few cases a string is copied to a new buffer. The new label code takes this pointer and uses it as the str part of an int_str_map. So it's just junk - it points to whatever last used the xp_get_value routine and it's a serious bug. It impacts all labels so I have changed the title of this message. Unless there is some magic way to get map to copy the elements (I don't know one), I can see a hard way (make an explicit copy of the strings) or an easy way (restrict the labels to integers) to fix this. Changing both the str_int_map and the int_str_map to int_int_map would be fairly simple to do. It would give you arbitrary integers as labels and keep the error checking advantage of the new code and allow large numbers of labels. Integers are the only things documented so I doubt many scenarios have non-numeric labels. The next step is upto the maintainers. The only thing I can suggest to Sumeet is to use version 3.0 which allows labels 1-99 only but has the old working code. Peter From: plh...@hotmail.com To: sumeet_bhard...@persistent.co.in; sipp-users@lists.sourceforge.net Date: Wed, 13 Jan 2010 18:11:19 + Subject: Re: [Sipp-users] FW: Help- ontimeout is not working Being snowed-in in Southern England (it is just so infrequent that we do not prepare for it) I am having a look at this in a bit more depth. The report so far is: It looks like the forward reference resolver is broken. So backward references work and all forward references go to the last defined label. I have a trap in scenario::apply_labels which shows this happening. -- The history is that when I wrote the label and next stuff I avoided having a resolver pass by limiting the labels to 1-n. (n was 9 initially - now 99.) My logic was that scenarios should be simple with few labels and the array required was smaller than the code for a resolver pass. Someone later wrote a resolver pass to get more flexibility and error checking - I'm fine with this but it means I'm now looking at code that is new to me. -- If you simplify your scenario to only use one label or only use backward references then it will work. (However I suspect that is hard to do.) Peter Higginson From: sumeet_bhard...@persistent.co.in To: sipp-users@lists.sourceforge.net Date: Tue, 12 Jan 2010 15:21:44 +0530 Subject: [Sipp-users] FW: Help- ontimeout is not working Please reply if anyone knows about this. Thanks -Sumeet From: Sumeet Bhardwaj Sent: Monday, January 11, 2010 6:05 PM To: 'Peter Higginson'; dushyant.dha...@rancoretech.com Cc: sipp_users Subject: RE: [Sipp-users] Help- ontimeout is not working Hello All, I am using sip 3.1 version. Only using uac xml And command for the same is : sipp -sf Sample.xml : -inf -r 1 -rp 1s -nr -trace_msg Thanks -Sumeet From: Peter Higginson [mailto:plh...@hotmail.com] Sent: Monday, January 11, 2010 5:00 PM To: dushyant.dha...@rancoretech.com; Sumeet Bhardwaj Cc: sipp_users Subject: RE: [Sipp-users] Help- ontimeout is not wo
Re: [Sipp-users] label, next and ontimeout broken in 3.1
Thanks Peter for pointing out this. I will use 3.0. Thanks -Sumeet From: Peter Higginson [mailto:plh...@hotmail.com] Sent: Thursday, January 14, 2010 4:18 AM To: cpwri...@us.ibm.com Cc: sipp_users; Sumeet Bhardwaj Subject: RE: [Sipp-users] label, next and ontimeout broken in 3.1 Charles, Care is needed to delete the space that strdup allocates (from malloc so free() is needed). I'm assuming that since the label maps are only needed for the scenario compilation, they are freed before the main phase. (I can see code that frees the maps.) Already I see that strdup is used with txnRevMap and the map freed without freeing the strdup allocations. Peter Subject: Re: [Sipp-users] label, next and ontimeout broken in 3.1 To: plh...@hotmail.com CC: sipp-users@lists.sourceforge.net; sumeet_bhard...@persistent.co.in From: cpwri...@us.ibm.com Date: Wed, 13 Jan 2010 16:13:55 -0500 I think the best answer would be to strdup the return from xp_get_value, as the named labels are far friendlier when writing any complex scenario that uses more than a handful of labels. Charles [cid:image001.gif@01CA9507.CF400730]Peter Higginson ---01/13/2010 16:09:56--- Peter Higginson 01/13/2010 16:08 To , sipp_users cc Subject [Sipp-users] label, next and ontimeout broken in 3.1 The C routine xp_get_value returns a pointer to a static buffer from which a value is normally extracted, or in a few cases a string is copied to a new buffer. The new label code takes this pointer and uses it as the str part of an int_str_map. So it's just junk - it points to whatever last used the xp_get_value routine and it's a serious bug. It impacts all labels so I have changed the title of this message. Unless there is some magic way to get map to copy the elements (I don't know one), I can see a hard way (make an explicit copy of the strings) or an easy way (restrict the labels to integers) to fix this. Changing both the str_int_map and the int_str_map to int_int_map would be fairly simple to do. It would give you arbitrary integers as labels and keep the error checking advantage of the new code and allow large numbers of labels. Integers are the only things documented so I doubt many scenarios have non-numeric labels. The next step is upto the maintainers. The only thing I can suggest to Sumeet is to use version 3.0 which allows labels 1-99 only but has the old working code. Peter From: plh...@hotmail.com To: sumeet_bhard...@persistent.co.in; sipp-users@lists.sourceforge.net Date: Wed, 13 Jan 2010 18:11:19 + Subject: Re: [Sipp-users] FW: Help- ontimeout is not working Being snowed-in in Southern England (it is just so infrequent that we do not prepare for it) I am having a look at this in a bit more depth. The report so far is: It looks like the forward reference resolver is broken. So backward references work and all forward references go to the last defined label. I have a trap in scenario::apply_labels which shows this happening. -- The history is that when I wrote the label and next stuff I avoided having a resolver pass by limiting the labels to 1-n. (n was 9 initially - now 99.) My logic was that scenarios should be simple with few labels and the array required was smaller than the code for a resolver pass. Someone later wrote a resolver pass to get more flexibility and error checking - I'm fine with this but it means I'm now looking at code that is new to me. -- If you simplify your scenario to only use one label or only use backward references then it will work. (However I suspect that is hard to do.) Peter Higginson From: sumeet_bhard...@persistent.co.in To: sipp-users@lists.sourceforge.net Date: Tue, 12 Jan 2010 15:21:44 +0530 Subject: [Sipp-users] FW: Help- ontimeout is not working Please reply if anyone knows about this. Thanks -Sumeet From: Sumeet Bhardwaj Sent: Monday, January 11, 2010 6:05 PM To: 'Peter Higginson'; dushyant.dha...@rancoretech.com Cc: sipp_users Subject: RE: [Sipp-users] Help- ontimeout is not working Hello All, I am using sip 3.1 version. Only using uac xml And command for the same is : sipp -sf Sample.xml : -inf -r 1 -rp 1s -nr -trace_msg Thanks -Sumeet From: Peter Higginson [mailto:plh...@hotmail.com] Sent: Monday, January 11, 2010 5:00 PM To: dushyant.dha...@rancoretech.com; Sumeet Bhardwaj Cc: sipp_users Subject: RE: [Sipp-users] Help- ontimeout is not working Also the exact version you were using What you have to watch is what "state" you are in. (When all else fails put a trace on the state.) I'm retired now and not actively using SIPP but my memory is that if you are expecting a 100 then you are probably still in the tran
Re: [Sipp-users] label, next and ontimeout broken in 3.1
Charles, Care is needed to delete the space that strdup allocates (from malloc so free() is needed). I'm assuming that since the label maps are only needed for the scenario compilation, they are freed before the main phase. (I can see code that frees the maps.) Already I see that strdup is used with txnRevMap and the map freed without freeing the strdup allocations. Peter Subject: Re: [Sipp-users] label, next and ontimeout broken in 3.1 To: plh...@hotmail.com CC: sipp-users@lists.sourceforge.net; sumeet_bhard...@persistent.co.in From: cpwri...@us.ibm.com Date: Wed, 13 Jan 2010 16:13:55 -0500 I think the best answer would be to strdup the return from xp_get_value, as the named labels are far friendlier when writing any complex scenario that uses more than a handful of labels. Charles Peter Higginson ---01/13/2010 16:09:56--- Peter Higginson 01/13/2010 16:08 To , sipp_users cc Subject [Sipp-users] label, next and ontimeout broken in 3.1 The C routine xp_get_value returns a pointer to a static buffer from which a value is normally extracted, or in a few cases a string is copied to a new buffer. The new label code takes this pointer and uses it as the str part of an int_str_map. So it's just junk - it points to whatever last used the xp_get_value routine and it's a serious bug. It impacts all labels so I have changed the title of this message. Unless there is some magic way to get map to copy the elements (I don't know one), I can see a hard way (make an explicit copy of the strings) or an easy way (restrict the labels to integers) to fix this. Changing both the str_int_map and the int_str_map to int_int_map would be fairly simple to do. It would give you arbitrary integers as labels and keep the error checking advantage of the new code and allow large numbers of labels. Integers are the only things documented so I doubt many scenarios have non-numeric labels. The next step is upto the maintainers. The only thing I can suggest to Sumeet is to use version 3.0 which allows labels 1-99 only but has the old working code. Peter From: plh...@hotmail.com To: sumeet_bhard...@persistent.co.in; sipp-users@lists.sourceforge.net Date: Wed, 13 Jan 2010 18:11:19 + Subject: Re: [Sipp-users] FW: Help- ontimeout is not working Being snowed-in in Southern England (it is just so infrequent that we do not prepare for it) I am having a look at this in a bit more depth. The report so far is: It looks like the forward reference resolver is broken. So backward references work and all forward references go to the last defined label. I have a trap in scenario::apply_labels which shows this happening. -- The history is that when I wrote the label and next stuff I avoided having a resolver pass by limiting the labels to 1-n. (n was 9 initially - now 99.) My logic was that scenarios should be simple with few labels and the array required was smaller than the code for a resolver pass. Someone later wrote a resolver pass to get more flexibility and error checking - I'm fine with this but it means I'm now looking at code that is new to me. -- If you simplify your scenario to only use one label or only use backward references then it will work. (However I suspect that is hard to do.) Peter Higginson From: sumeet_bhard...@persistent.co.in To: sipp-users@lists.sourceforge.net Date: Tue, 12 Jan 2010 15:21:44 +0530 Subject: [Sipp-users] FW: Help- ontimeout is not working Please reply if anyone knows about this. Thanks -Sumeet From: Sumeet Bhardwaj Sent: Monday, January 11, 2010 6:05 PM To: 'Peter Higginson'; dushyant.dha...@rancoretech.com Cc: sipp_users Subject: RE: [Sipp-users] Help- ontimeout is not working Hello All, I am using sip 3.1 version. Only using uac xml And command for the same is : sipp -sf Sample.xml : -inf -r 1 -rp 1s -nr -trace_msg Thanks -Sumeet From: Peter Higginson [mailto:plh...@hotmail.com] Sent: Monday, January 11, 2010 5:00 PM To: dushyant.dha...@rancoretech.com; Sumeet Bhardwaj Cc: sipp_users Subject: RE: [Sipp-users] Help- ontimeout is not working Also the exact version you were using What you have to watch is what "state" you are in. (When all else fails put a trace on the state.) I'm retired now and not actively using SIPP but my memory is that if you are expecting a 100 then you are probably still in the transmit state and doing re-transmits that will eventually time out themselves. Peter Date: Mon, 11 Jan 2010 16:43:10 +0530 From: dushyant.dha...@rancoretech.com To: sumeet_bhard...@persistent.co.in CC: plh...@hotmail.com; sipp-users@lists.sourceforge.net Subject: Re: [Sipp-users] Help- ontimeout is not working Can u send the following - 1. xml for uac. 2. xml for uas.
Re: [Sipp-users] label, next and ontimeout broken in 3.1
I think the best answer would be to strdup the return from xp_get_value, as the named labels are far friendlier when writing any complex scenario that uses more than a handful of labels. Charles Peter Higginson To , 01/13/2010 16:08 sipp_users cc Subject [Sipp-users] label, next and ontimeout broken in 3.1 The C routine xp_get_value returns a pointer to a static buffer from which a value is normally extracted, or in a few cases a string is copied to a new buffer. The new label code takes this pointer and uses it as the str part of an int_str_map. So it's just junk - it points to whatever last used the xp_get_value routine and it's a serious bug. It impacts all labels so I have changed the title of this message. Unless there is some magic way to get map to copy the elements (I don't know one), I can see a hard way (make an explicit copy of the strings) or an easy way (restrict the labels to integers) to fix this. Changing both the str_int_map and the int_str_map to int_int_map would be fairly simple to do. It would give you arbitrary integers as labels and keep the error checking advantage of the new code and allow large numbers of labels. Integers are the only things documented so I doubt many scenarios have non-numeric labels. The next step is upto the maintainers. The only thing I can suggest to Sumeet is to use version 3.0 which allows labels 1-99 only but has the old working code. Peter From: plh...@hotmail.com To: sumeet_bhard...@persistent.co.in; sipp-users@lists.sourceforge.net Date: Wed, 13 Jan 2010 18:11:19 + Subject: Re: [Sipp-users] FW: Help- ontimeout is not working Being snowed-in in Southern England (it is just so infrequent that we do not prepare for it) I am having a look at this in a bit more depth. The report so far is: It looks like the forward reference resolver is broken. So backward references work and all forward references go to the last defined label. I have a trap in scenario::apply_labels which shows this happening. -- The history is that when I wrote the label and next stuff I avoided having a resolver pass by limiting the labels to 1-n. (n was 9 initially - now 99.) My logic was that scenarios should be simple with few labels and the array required was smaller than the code for a resolver pass. Someone later wrote a resolver pass to get more flexibility and error checking - I'm fine with this but it means I'm now looking at code that is new to me. -- If you simplify your scenario to only use one label or only use backward references then it will work. (However I suspect that is hard to do.) Peter Higginson From: sumeet_bhard...@persistent.co.in To: sipp-users@lists.sourceforge.net Date: Tue, 12 Jan 2010 15:21:44 +0530 Subject: [Sipp-users] FW: Help- ontimeout is not working Please reply if anyone knows about this. Thanks -Sumeet From: Sumeet Bhardwaj Sent: Monday, January 11, 2010 6:05 PM To: 'Peter Higginson'; dushyant.dha...@rancoretech.com Cc: sipp_users Subject: RE: [Sipp-users] Help- ontimeout is not working Hello All, I am using sip 3.1 version. Only using uac xml And command for the same is : sipp -sf Sample.xml : -inf -r 1 -rp 1s -nr -trace_msg Thanks -Sumeet From: Peter Higginson [mailto:plh...@hotmail.com] Sent: Monday, January 11, 2010 5:00 PM To: dushyant.dha...@rancoretech.com; Sumeet Bhardwaj Cc: sipp_users Subject: RE: [Sipp-users] Help- ontimeout is not working Also the exact version you were using What you have to watch is what "state" you are in. (When all else fails put a trace on the state.) I'm retired now and not actively using SIPP but my memory is that if you are expecting a 100 then you are probably still in t