Thread: [Gambas-user] [SegFault 11] Enumerating HttpClient.Headers with For Each
Brought to you by:
gambas
|
From: T L. D. <t.l...@gm...> - 2014-11-23 21:07:22
Attachments:
GraphicalAppTest-0.0.1-crash-141123-151942.tar.bz2
|
Okay, I've done more testing related to the noise I accidentally sent to the list yesterday. Attempting to enumerate through HttpClient.Headers with For Each causes a SegFault 11 under certain conditions. In the attached project, there is a procedure that traverses through a list of three URLs from a GridView and does HttpClient.Get on each one. If HttpClient.Headers for each URL is enumerated with Headers[iIndex], I can run through the list of URLs multiple times all day long. But, if I enumerate the Headers array with For Each, the application SegFaults at the second execution of the procedure. When using Headers[iIndex], Headers.Count is correct. But, when using For Each, URL[1].Headers.Count is obviously URL[0].Headers.Count plus URL[1].Headers.Count. And, actually printing out the headers shows that URL[1].Headers is the URL[0].Headers with URL[1].Headers appended. Interestingly, the Headers for the third URL are correct no matter which enumeration method is used. And, the application does not SegFault when attempting to enumerate the Headers (with For Each) for the third URL on the first run. Only after the procedure is re-entered the second time does the app SegFault. How to reproduce: Set "Actually Print Headers to Console" to your preference. A. 1. Leave "Enumerate Response Headers With" set to "Headers[iIndex]". 2. Click "Get Response Status Codes" as many times as you wish to show that enumerating with Headers[iIndex] does not SegFault. B. 1. Set "Enumerate Response Headers With" to "For Each Headers". 2. Click "Get Response Status Codes" twice. (>>SegFault) One last note: I stumbled across this while trying to determine why HttpClient.Code sometimes returned "0", and IIRC, I was enumerating with For Each at the time. Now just for clarification, is enumerating HttpClient.Headers with For Each something I should not be doing? Have I done something else wrong? Or is this actually a bug? Oops, almost forgot. System info: [System] Gambas=3.6.0 OperatingSystem=Linux Kernel=3.10.60-desktop-1.mga3 Architecture=x86 Distribution=Mageia 3 Desktop=KDE4 Theme=Oxygen Language=en_US.UTF-8 Memory=1005M [Libraries] Cairo=libcairo.so.2.11200.12 Curl=libcurl.so.4.3.0 DBus=libdbus-1.so.3.7.2 GStreamer=libgstreamer-0.10.so.0.30.0 GStreamer=libgstreamer-1.0.so.0.5.0 GTK+3=libgtk-3.so.0.600.4 GTK+=libgtk-x11-2.0.so.0.2400.17 OpenGL=libGL.so.1.2.0 Poppler=libpoppler.so.34.0.0 Qt4=libQtCore.so.4.8.6 SDL=libSDL-1.2.so.0.11.4 -- Lee __________ "Artificial Intelligence is no match for natural stupidity." |
|
From: Benoît M. <ga...@us...> - 2014-11-23 21:48:50
|
Le 23/11/2014 22:07, T Lee Davidson a écrit : > Okay, I've done more testing related to the noise I accidentally sent to > the list yesterday. > > Attempting to enumerate through HttpClient.Headers with For Each causes > a SegFault 11 under certain conditions. > > In the attached project, there is a procedure that traverses through a > list of three URLs from a GridView and does HttpClient.Get on each one. > > If HttpClient.Headers for each URL is enumerated with Headers[iIndex], I > can run through the list of URLs multiple times all day long. But, if I > enumerate the Headers array with For Each, the application SegFaults at > the second execution of the procedure. > > When using Headers[iIndex], Headers.Count is correct. > > But, when using For Each, URL[1].Headers.Count is obviously > URL[0].Headers.Count plus URL[1].Headers.Count. And, actually printing > out the headers shows that URL[1].Headers is the URL[0].Headers with > URL[1].Headers appended. > > Interestingly, the Headers for the third URL are correct no matter which > enumeration method is used. And, the application does not SegFault when > attempting to enumerate the Headers (with For Each) for the third URL on > the first run. Only after the procedure is re-entered the second time > does the app SegFault. > > > How to reproduce: > > Set "Actually Print Headers to Console" to your preference. > > A. > 1. Leave "Enumerate Response Headers With" set to "Headers[iIndex]". > 2. Click "Get Response Status Codes" as many times as you wish to show > that enumerating with Headers[iIndex] does not SegFault. > > B. > 1. Set "Enumerate Response Headers With" to "For Each Headers". > 2. Click "Get Response Status Codes" twice. (>>SegFault) > > > One last note: I stumbled across this while trying to determine why > HttpClient.Code sometimes returned "0", and IIRC, I was enumerating with > For Each at the time. > > > Now just for clarification, is enumerating HttpClient.Headers with For > Each something I should not be doing? Have I done something else wrong? > Or is this actually a bug? > I will look at it. But if you have a segfault, this is a bug, whatever the reason. You are not doing anything wrong, the interpret should never crash, only raising errors. If the crash is a library bug, I can't do nothing, but it seems to not be the case there. Regards, -- Benoît Minisini |
|
From: roberto <rh...@ya...> - 2014-11-23 22:23:06
|
Hi Benoît and All I have a similar problem of fault segment 11 with a hpart (as MimePart) enumerated from a a MimeMessage in the special condition that the part is empty, as for example -> **************************************************************** ------ = _ Part_819_1944908340.1380722116143 Content-Type: text / plain; charset = us-ascii Content-Transfer-Encoding: 7bit ------ = _ Part_819_1944908340.1380722116143 **************************************************************** In this condition a simple return hPart.Data which is NULL, causes the segment fault if it is necessary to solve the problem, I will send you a part of the project code Regards Il 23/11/2014 22:48, Benoît Minisini ha scritto: > Le 23/11/2014 22:07, T Lee Davidson a écrit : >> Okay, I've done more testing related to the noise I accidentally sent to >> the list yesterday. >> >> Attempting to enumerate through HttpClient.Headers with For Each causes >> a SegFault 11 under certain conditions. >> >> In the attached project, there is a procedure that traverses through a >> list of three URLs from a GridView and does HttpClient.Get on each one. >> >> If HttpClient.Headers for each URL is enumerated with Headers[iIndex], I >> can run through the list of URLs multiple times all day long. But, if I >> enumerate the Headers array with For Each, the application SegFaults at >> the second execution of the procedure. >> >> When using Headers[iIndex], Headers.Count is correct. >> >> But, when using For Each, URL[1].Headers.Count is obviously >> URL[0].Headers.Count plus URL[1].Headers.Count. And, actually printing >> out the headers shows that URL[1].Headers is the URL[0].Headers with >> URL[1].Headers appended. >> >> Interestingly, the Headers for the third URL are correct no matter which >> enumeration method is used. And, the application does not SegFault when >> attempting to enumerate the Headers (with For Each) for the third URL on >> the first run. Only after the procedure is re-entered the second time >> does the app SegFault. >> >> >> How to reproduce: >> >> Set "Actually Print Headers to Console" to your preference. >> >> A. >> 1. Leave "Enumerate Response Headers With" set to "Headers[iIndex]". >> 2. Click "Get Response Status Codes" as many times as you wish to show >> that enumerating with Headers[iIndex] does not SegFault. >> >> B. >> 1. Set "Enumerate Response Headers With" to "For Each Headers". >> 2. Click "Get Response Status Codes" twice. (>>SegFault) >> >> >> One last note: I stumbled across this while trying to determine why >> HttpClient.Code sometimes returned "0", and IIRC, I was enumerating with >> For Each at the time. >> >> >> Now just for clarification, is enumerating HttpClient.Headers with For >> Each something I should not be doing? Have I done something else wrong? >> Or is this actually a bug? >> > I will look at it. > > But if you have a segfault, this is a bug, whatever the reason. You are > not doing anything wrong, the interpret should never crash, only raising > errors. > > If the crash is a library bug, I can't do nothing, but it seems to not > be the case there. > > Regards, > |
|
From: roberto <rh...@ya...> - 2014-11-24 03:28:05
|
to bypass the segfault 11 , if I wanted to use the external library libgmime with: Library "libgmime-2.6:0" the declaration of the function should be this: Private Extern g_mime_part_get_content_object(GMimePart As Pointer) As Pointer and my data is in variable hPart as MimePart how i can pass hPart to the libgmime function? Regards how do I go hpart to function? Il 23/11/2014 23:22, roberto ha scritto: > Hi Benoît and All > I have a similar problem of fault segment 11 with a hpart (as MimePart) > enumerated from a a MimeMessage > in the special condition that the part is empty, as for example -> > **************************************************************** > ------ = _ Part_819_1944908340.1380722116143 > Content-Type: text / plain; charset = us-ascii > Content-Transfer-Encoding: 7bit > > > ------ = _ Part_819_1944908340.1380722116143 > **************************************************************** > In this condition a simple > return hPart.Data > which is NULL, causes the segment fault > > if it is necessary to solve the problem, I will send you a part of the > project code > > Regards > > > Il 23/11/2014 22:48, Benoît Minisini ha scritto: >> Le 23/11/2014 22:07, T Lee Davidson a écrit : >>> Okay, I've done more testing related to the noise I accidentally sent to >>> the list yesterday. >>> >>> Attempting to enumerate through HttpClient.Headers with For Each causes >>> a SegFault 11 under certain conditions. >>> >>> In the attached project, there is a procedure that traverses through a >>> list of three URLs from a GridView and does HttpClient.Get on each one. >>> >>> If HttpClient.Headers for each URL is enumerated with Headers[iIndex], I >>> can run through the list of URLs multiple times all day long. But, if I >>> enumerate the Headers array with For Each, the application SegFaults at >>> the second execution of the procedure. >>> >>> When using Headers[iIndex], Headers.Count is correct. >>> >>> But, when using For Each, URL[1].Headers.Count is obviously >>> URL[0].Headers.Count plus URL[1].Headers.Count. And, actually printing >>> out the headers shows that URL[1].Headers is the URL[0].Headers with >>> URL[1].Headers appended. >>> >>> Interestingly, the Headers for the third URL are correct no matter which >>> enumeration method is used. And, the application does not SegFault when >>> attempting to enumerate the Headers (with For Each) for the third URL on >>> the first run. Only after the procedure is re-entered the second time >>> does the app SegFault. >>> >>> >>> How to reproduce: >>> >>> Set "Actually Print Headers to Console" to your preference. >>> >>> A. >>> 1. Leave "Enumerate Response Headers With" set to "Headers[iIndex]". >>> 2. Click "Get Response Status Codes" as many times as you wish to show >>> that enumerating with Headers[iIndex] does not SegFault. >>> >>> B. >>> 1. Set "Enumerate Response Headers With" to "For Each Headers". >>> 2. Click "Get Response Status Codes" twice. (>>SegFault) >>> >>> >>> One last note: I stumbled across this while trying to determine why >>> HttpClient.Code sometimes returned "0", and IIRC, I was enumerating with >>> For Each at the time. >>> >>> >>> Now just for clarification, is enumerating HttpClient.Headers with For >>> Each something I should not be doing? Have I done something else wrong? >>> Or is this actually a bug? >>> >> I will look at it. >> >> But if you have a segfault, this is a bug, whatever the reason. You are >> not doing anything wrong, the interpret should never crash, only raising >> errors. >> >> If the crash is a library bug, I can't do nothing, but it seems to not >> be the case there. >> >> Regards, >> > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gambas-user > |
|
From: T L. D. <t.l...@gm...> - 2014-11-24 03:47:47
|
Roberto, I don't mind you hi-jacking my thread, but I'm sure others do as it disrupts thread integrity and makes email message management more difficult, especially for those who have alot to manage. Plus, you would likely get better response if you started your own thread. To do so, DO NOT use the Reply button. Compose a NEW message to gam...@li... . When you do, try to include as much applicable code in the same message as is practical. The snippets you have provided here may not be enough information for someone to give you an intelligent answer. (For example, where did "hPart as MimePart" come from?) That being said, I do not have an answer for your question, sorry. --- Lee __________ On 11/23/2014 10:27 PM, roberto wrote: > to bypass the segfault 11 , if I wanted to use the external library > libgmime with: > > Library "libgmime-2.6:0" > > the declaration of the function should be this: > > Private Extern g_mime_part_get_content_object(GMimePart As Pointer) As > Pointer > > and my data is in variable hPart as MimePart > > how i can pass hPart to the libgmime function? |
|
From: roberto <rh...@ya...> - 2014-11-24 09:33:02
|
I'm sorry to have destroyed the integrity of your thread regards Il 24/11/2014 04:47, T Lee Davidson ha scritto: > Roberto, > > I don't mind you hi-jacking my thread, but I'm sure others do as it > disrupts thread integrity and makes email message management more > difficult, especially for those who have alot to manage. > > Plus, you would likely get better response if you started your own > thread. To do so, DO NOT use the Reply button. Compose a NEW message to > gam...@li... . > > When you do, try to include as much applicable code in the same message > as is practical. The snippets you have provided here may not be enough > information for someone to give you an intelligent answer. (For example, > where did "hPart as MimePart" come from?) |
|
From: Benoît M. <ga...@us...> - 2014-11-24 12:47:07
|
Le 24/11/2014 10:32, roberto a écrit : > I'm sorry to have destroyed the integrity of your thread > regards > No problem. But do create a new thread for a new bug, otherwise it may be lost! Anyway, can you provide your project, or part of it reproducing the problem? If you need a specific mail for that, you can provide it in *.eml format. Regards, -- Benoît Minisini |
|
From: Benoît M. <ga...@us...> - 2014-11-24 12:39:28
|
Le 23/11/2014 22:48, Benoît Minisini a écrit : >> Now just for clarification, is enumerating HttpClient.Headers with For >> Each something I should not be doing? Have I done something else wrong? >> Or is this actually a bug? >> > > I will look at it. > > But if you have a segfault, this is a bug, whatever the reason. You are > not doing anything wrong, the interpret should never crash, only raising > errors. > > If the crash is a library bug, I can't do nothing, but it seems to not > be the case there. > > Regards, > It's fixed in revision #6675. It was a bug in the internal management of the header array in the HttpClient class. Regards, -- Benoît Minisini |
|
From: T L. D. <t.l...@gm...> - 2014-11-25 00:40:56
|
On 11/24/2014 07:39 AM, Benoît Minisini wrote: > Le 23/11/2014 22:48, Benoît Minisini a écrit : >>> Now just for clarification, is enumerating HttpClient.Headers with For >>> Each something I should not be doing? Have I done something else wrong? >>> Or is this actually a bug? >>> >> >> I will look at it. >> >> But if you have a segfault, this is a bug, whatever the reason. You are >> not doing anything wrong, the interpret should never crash, only raising >> errors. >> >> If the crash is a library bug, I can't do nothing, but it seems to not >> be the case there. >> >> Regards, >> > > It's fixed in revision #6675. It was a bug in the internal management of > the header array in the HttpClient class. Thank you, Benoît. -- Lee __________ "Artificial Intelligence is no match for natural stupidity." |