[jira] [Commented] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13693917#comment-13693917 ] Rejean Bouchard commented on TS-1958: - Hello James, If I define the ats_pagesize() function as a macro returning 32000 each time, all is working properly. I finally understand the use of the second "vsnprintf" but I don’t understand the test following that, this test will allways be false. Anyway, it's a great modification and this completely solve the problem. Thank you! Réjean Bouchard Nexweb -Message d'origine- De : James Peach (JIRA) [mailto:j...@apache.org] Envoyé : 20 juin 2013 11:39 À : rbouch...@nexweb.ca Objet : [jira] [Commented] (TS-1958) admin interface regex lookup seg fault [ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13689340#comment-13689340 ] James Peach commented on TS-1958: - I definitely think that this is a useful fix :) I don't think that your original patch is correct, because there are cases where repeating the vsnprintf is required. I believe that the patch I attached is correct. If you can confirm that it fixes your problem, I can propose it for the next 3.2.x release. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard >Assignee: James Peach > Fix For: 3.3.5 > > Attachments: show.h.patch, TS-1958-3.3.x.patch > > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13690405#comment-13690405 ] Rejean Bouchard commented on TS-1958: - Thank's! I download it and apply the patch successfully. But, there is a compile error. ats_pagesize() function is undefined. Where did you find it? Does it allways return 32000? Thank you for help! Réjean Bouchard Nexweb -Message d'origine- De : James Peach (JIRA) [mailto:j...@apache.org] Envoyé : 20 juin 2013 18:23 À : rbouch...@nexweb.ca Objet : [jira] [Commented] (TS-1958) admin interface regex lookup seg fault [ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13689762#comment-13689762 ] James Peach commented on TS-1958: - The patch is against the 3.2.x branch, commit 9f8195f443e1e16862cbb7abc0497ec64dafd025. J -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard >Assignee: James Peach > Fix For: 3.3.5 > > Attachments: show.h.patch, TS-1958-3.3.x.patch > > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13689504#comment-13689504 ] Rejean Bouchard commented on TS-1958: - Which Git version did you use. I want to have the same one to test it. Thank you!. RBouchard -Message d'origine- De : James Peach (JIRA) [mailto:j...@apache.org] Envoyé : 20 juin 2013 11:39 À : rbouch...@nexweb.ca Objet : [jira] [Commented] (TS-1958) admin interface regex lookup seg fault [ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13689340#comment-13689340 ] James Peach commented on TS-1958: - I definitely think that this is a useful fix :) I don't think that your original patch is correct, because there are cases where repeating the vsnprintf is required. I believe that the patch I attached is correct. If you can confirm that it fixes your problem, I can propose it for the next 3.2.x release. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard >Assignee: James Peach > Fix For: 3.3.5 > > Attachments: show.h.patch, TS-1958-3.3.x.patch > > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13689274#comment-13689274 ] Rejean Bouchard commented on TS-1958: - I don't pretend this is a major change, but this is a small solution to a segmentation fault (I explain the conditions and how to get it earlier). So, I think this is an important patch. In same time, I decide to make some cleaning to make it easier to read. Réjean Bouchard Nexweb -Message d'origine- De : James Peach (JIRA) [mailto:j...@apache.org] Envoyé : 18 juin 2013 17:16 À : rbouch...@nexweb.ca Objet : [jira] [Updated] (TS-1958) admin interface regex lookup seg fault [ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Peach updated TS-1958: Attachment: TS-1958-3.3.x.patch Proposed patch for 3.2.x. This isn't substantially different code from what is in master. It's cleaned up a little and somewhat easier to read IMHO. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard >Assignee: James Peach > Fix For: 3.3.5 > > Attachments: show.h.patch, TS-1958-3.3.x.patch > > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13686970#comment-13686970 ] Rejean Bouchard commented on TS-1958: - Hi again M. Peach, You told me that the second "vsnprintf" is necessary when realloc happens. After a lot of tests with and without that "vsnprintf", I found that the result is always the same. I use the "Cache Regex Lookup" page to do my test and my cache contains more than 5000 images. However, the check for the need of "ats_realloc" id done after "vsnprintf" is run. More than that, this test check is buffer is near to the end and not over the end (this will be a cataclysm). So, there is no loss of data when the buffer double his size and there is no reasons that I can see to re-run "vsnprintf". Also, after putting some traces in the code, I saw that there is (in my case) realloc being called 9 times and the last "vsnprintf" do nothing since the buffer be already being copied. What do you think about that? Réjean Bouchard Nexweb -Message d'origine- De : James Peach (JIRA) [mailto:j...@apache.org] Envoyé : 18 juin 2013 00:46 À : rbouch...@nexweb.ca Objet : [jira] [Commented] (TS-1958) admin interface regex lookup seg fault [ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13686387#comment-13686387 ] James Peach commented on TS-1958: - The second vsnprintf is still needed in the case where the realloc happens, since if there is not enough space in the buffer, the vsnprintf needs to be replayed. We should replace this memory management with ts::Buffer. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard >Assignee: James Peach > Fix For: 3.3.5 > > Attachments: show.h.patch > > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13686789#comment-13686789 ] Rejean Bouchard commented on TS-1958: - I will do the corrections for the second vsnprintf and integrate ts::Buffer. I will post it soon. Thank you! Réjean Bouchard Nexweb -Message d'origine- De : James Peach (JIRA) [mailto:j...@apache.org] Envoyé : 18 juin 2013 00:46 À : rbouch...@nexweb.ca Objet : [jira] [Commented] (TS-1958) admin interface regex lookup seg fault [ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13686387#comment-13686387 ] James Peach commented on TS-1958: - The second vsnprintf is still needed in the case where the realloc happens, since if there is not enough space in the buffer, the vsnprintf needs to be replayed. We should replace this memory management with ts::Buffer. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard >Assignee: James Peach > Fix For: 3.3.5 > > Attachments: show.h.patch > > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rejean Bouchard updated TS-1958: Attachment: show.h.patch Fix: segfault in show.h > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard > Attachments: show.h.patch > > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13685845#comment-13685845 ] Rejean Bouchard commented on TS-1958: - The segfault is provocated by the second call of vsnprintf in "int ShowCont::show(char *s, ...)" function in proxy/show.h file (we dont have the right to reuse "aap" without re-initialize that. This is exactly the reason of the crash.). I have modify this function to optimize it and solve this bug. The second "vsnprintf" seem to be unneeded for the result because the first "vsnprintf" already do the job and all data is copied to the new buffer by the "realloc" function. The second "if" will never used because var "l" is changed just before, so the test is allways false. Finally, va_scratch is useless so i erased it. The function is now like this: int show(const char *s, ...) { va_list aap; int l = ebuf - buf; va_start(aap, s); int done = vsnprintf(buf, l, s, aap); if (done > l - 256) { char *start2 = (char *)ats_realloc(start, (ebuf - start) * 2); ebuf = start2 + (ebuf - start) * 2; buf = start2 + (buf - start); start = start2; l = ebuf - buf; } buf += done; va_end(aap); return EVENT_CONT; } After thoses modifications, all is working. RB > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TS-1958) admin interface regex lookup seg fault
Rejean Bouchard created TS-1958: --- Summary: admin interface regex lookup seg fault Key: TS-1958 URL: https://issues.apache.org/jira/browse/TS-1958 Project: Traffic Server Issue Type: Bug Components: Web UI Reporter: Rejean Bouchard there is a possible seg fault (crashing the entire TS) when using a regex lookup form twice to show all cache content. To reproduce it, do a regex lookup like http://.* twice with a cache containing at least 5000 objects. RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TS-1958) admin interface regex lookup seg fault
[ https://issues.apache.org/jira/browse/TS-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rejean Bouchard updated TS-1958: Affects Version/s: 3.2.4 > admin interface regex lookup seg fault > -- > > Key: TS-1958 > URL: https://issues.apache.org/jira/browse/TS-1958 > Project: Traffic Server > Issue Type: Bug > Components: Web UI >Affects Versions: 3.2.4 >Reporter: Rejean Bouchard > > there is a possible seg fault (crashing the entire TS) when using a regex > lookup form twice to show all cache content. To reproduce it, do a regex > lookup like http://.* twice with a cache containing at least 5000 objects. > RB -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira