wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wget | Draft: Initial test for dynamic buffer size for downloads (!3


From: @rockdaboot
Subject: Re: wget | Draft: Initial test for dynamic buffer size for downloads (!32)
Date: Sat, 11 Jun 2022 18:55:51 +0000



Tim Rühsen commented:


There seems to be a bug. In L446:
```
      ret = fd_read (fd, dlbuf, rdsize, tmout);
```
... here the data is written:
```
              write_res = write_data (out, out2, dlbuf, ret, &skip,
                                      &sum_written);
```
valgrind then reports
```
==4462== Syscall param write(buf) points to unaddressable byte(s)
==4462==    at 0x5055603: write (write.c:26)
==4462==    by 0x4FE6A94: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1181)
==4462==    by 0x4FE5E25: new_do_write (fileops.c:449)
==4462==    by 0x4FE718D: _IO_new_file_xsputn (fileops.c:1255)
==4462==    by 0x4FE718D: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1197)
==4462==    by 0x4FDBDDC: fwrite (iofwrite.c:39)
==4462==    by 0x13ADCE: write_data (retr.c:191)
==4462==    by 0x13BA5A: fd_read_body (retr.c:524)
==4462==    by 0x12B855: read_response_body (http.c:1734)
==4462==    by 0x12F503: gethttp (http.c:4184)
==4462==    by 0x12F909: http_loop (http.c:4423)
==4462==    by 0x13BF99: retrieve_url (retr.c:1026)
==4462==    by 0x139F2B: retrieve_tree (recur.c:332)
==4462==  Address 0x7507950 is 0 bytes after a block of size 8,192 alloc'd
==4462==    at 0x483F7B5: malloc (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4462==    by 0x164C8A: xmalloc (xmalloc.c:44)
==4462==    by 0x13B34A: fd_read_body (retr.c:263)
==4462==    by 0x12B855: read_response_body (http.c:1734)
==4462==    by 0x12F503: gethttp (http.c:4184)
==4462==    by 0x12F909: http_loop (http.c:4423)
==4462==    by 0x13BF99: retrieve_url (retr.c:1026)
==4462==    by 0x139F2B: retrieve_tree (recur.c:332)
==4462==    by 0x136064: main (main.c:2167)
```

It looks like `rdsize` and the size of `buf` are somehow out of sync.

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget/-/merge_requests/32#note_987863000
You're receiving this email because of your account on gitlab.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]