[Bug-wget] Segmentation fault with current development version of wget

2013-04-30 Thread Stefano Lattarini
Here is the reproducer:

  $ wget --passive-ftp -nv --recursive --level=1 --no-directories --no-parent \
 --no-check-certificate -A '*.po' 
http://translationproject.org/latest/make
  2013-04-30 16:41:25 URL:https://translationproject.org/latest/make/ 
[5489/5489] - make [1]
  Segmentation fault

Sorry, I don't have to look into this more deeply ATM, not to provide
further feedback.  Hope you can reproduce this yourself; otherwise, I'll
try to get back to you in the next days.

Regards, and HTH,
  Stefano



Re: [Bug-wget] Segmentation fault with current development version of wget

2013-04-30 Thread Stefano Lattarini
On 04/30/2013 07:01 PM, Darshit Shah wrote:
 Okay, I could not prevent myself from looking into it.
 
 It seems as if the SUSPEND_POST_DATA macro was being called during a
 recursive download attempt.
 
 Attaching a hack around the situation. Will look more deeply when I have
 more time to identify what caused the regression.
 
I can confirm this temporary fix works for me.

Thanks,
  Stefano



Re: [Bug-wget] Segmentation fault with current development version of wget

2013-04-30 Thread Tim Rühsen
Hi Darshit,

I understand that your patch was just a quick hack.

But even than you should avoid doing
opt.method == POST
for string comparisons.

This definitely not portable.
Not every compiler/linker aggregates two occurrences of the same static string 
into one address in memory.

You should use strcmp or strcasecmp to check if opt.method points to POST.

Regards, Tim

Am Dienstag, 30. April 2013 schrieb Darshit Shah:
 Okay, I could not prevent myself from looking into it.
 
 It seems as if the SUSPEND_POST_DATA macro was being called during a
 recursive download attempt.
 
 Attaching a hack around the situation. Will look more deeply when I have
 more time to identify what caused the regression.
 
 On Tue, Apr 30, 2013 at 9:09 PM, Darshit Shah dar...@gmail.com wrote:
 
  I'm in the middle of University exams at the moment. I'll still have a
  look at it tomorrow when I get a breather.
 
  However, it looks like wget is converting any method to a POST request
  which is weird since that should have caused it to fail most of the tests.
 
  I'll have to look into it and check what is causing this issue.
 
  On Tue, Apr 30, 2013 at 8:46 PM, Tim Ruehsen tim.rueh...@gmx.de wrote:
 
  Hi,
 
  you can even reproduce it with a simple
  wget -r http://translationproject.org/latest/make
 
  Darshit, maybe you can have a look at it. It has something to do with
  opt.method (set to read-only POST in http.c, line 1772).
 
  Even with --method=GET opt.method points to POST. And the code tries to
  uppercase it inline.
 
  Regards, Tim
 
  Am Tuesday 30 April 2013 schrieb Stefano Lattarini:
   Here is the reproducer:
  
 $ wget --passive-ftp -nv --recursive --level=1 --no-directories
   --no-parent \ --no-check-certificate -A '*.po'
   http://translationproject.org/latest/make 2013-04-30 16:41:25
   URL:https://translationproject.org/latest/make/ [5489/5489] - make
  [1]
   Segmentation fault
  
   Sorry, I don't have to look into this more deeply ATM, not to provide
   further feedback.  Hope you can reproduce this yourself; otherwise, 
I'll
   try to get back to you in the next days.
  
   Regards, and HTH,
 Stefano
 
  Mit freundlichem Gruß
 
   Tim Rühsen
 
 
 
 
  --
  Thanking You,
  Darshit Shah
  Research Lead, Code Innovation
  Kill Code Phobia.
  B.E.(Hons.) Mechanical Engineering, '14. BITS-Pilani
 
 
 
 
 -- 
 Thanking You,
 Darshit Shah
 Research Lead, Code Innovation
 Kill Code Phobia.
 B.E.(Hons.) Mechanical Engineering, '14. BITS-Pilani