bugGNU Wget - Bugs: bug #43593, assert fail in creating progress...

 
 

bug #43593: assert fail in creating progress line

Submitted by:  Sami Farin <Safari>
Submitted on:  Wed 12 Nov 2014 09:44:04 PM UTC  
 
Category: Crash/Freeze/InfloopSeverity: 3 - Normal
Priority: 7 - HighStatus: Fixed
Privacy: PublicAssigned to: Darshit Shah <darnir>
Originator Name: Open/Closed: Closed
Release: trunkOperating System: GNU/Linux
Reproducibility: IntermittentFixed Release: None
Planned Release: 1.16.1Regression: Yes
Work Required: NonePatch Included: Yes

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 16 Nov 2014 06:35:54 AM UTC, comment #4:

I fixed the assert failure.

Also, a new configure option, --disable-assert is now available for users to remove assertions from compiled code.

Darshit Shah <darnir>
Project AdministratorIn charge of this item.
Fri 14 Nov 2014 01:08:01 PM UTC, comment #3:

I put there "Release: trunk", for me it means latest git.
I am running Fedora.

This "custom patch" is added by me, I wanted to see what count_cols returns.

Sami Farin <Safari>
Fri 14 Nov 2014 10:58:30 AM UTC, comment #2:

Can you please provide more details of your Wget build?
What distro are you using?

The assert failure that you are facing does indeed exist. However that code is not part of any release of Wget right now. My intention is to fix that issue and also remove all asserts from production code before we flag Wget's next release.

You are facing the assertion failure, means that you're running non-stable code on your machine. The development version of Wget may sometimes break while we work on fixing them. My suggestion would be that you try and revert to a stable release version of Wget if you do not want to be bugged by such issues.

However, for those who still like the bleeding edge versions, I've attached a patch that simply comments out the assertion. This is the patch I use on wget-git, the rolling package on Arch Linux's AUR. In 99% of use cases, this should cause no issues at all. There is one documented corner case where the the progress bar starts printing on a new line for each refresh effectively cluttering the whole screen.

What is interesting is also the fact that your version of Wget seems to have a custom patch. Since the original code is supposed to be:

assert (count_cols (bp->buffer) <= bp->width);

and not:

int colos = count_cols (bp->buffer);
assert (colos <= bp->width);

as your report states.

(file #32431)

Darshit Shah <darnir>
Project AdministratorIn charge of this item.
Thu 13 Nov 2014 06:01:05 PM UTC, comment #1:

lines 1161-1162 are now:
int colos = count_cols (bp->buffer);
assert (colos <= bp->width);

Sami Farin <Safari>
Wed 12 Nov 2014 09:44:04 PM UTC, original submission:

wget --no-proxy --no-cache -O /dev/null http://kernel.nic.funet.fi/pub/linux/kernel/v3.x/linux-3.16.tar.gz
...
Saving to: ‘/dev/null’

/dev/null 0%[ ] 744.92K 210KB/s eta 9m 54swget: progress.c:1162: create_image: Assertion `colos <= bp->width' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6a7f887 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0 0x00007ffff6a7f887 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff6a80f78 in __GI_abort () at abort.c:89
#2 0x00007ffff6a787e6 in __assert_fail_base (fmt=0x7ffff6bc5be8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x46a047 "colos <= bp->width",
file=file@entry=0x469f30 "progress.c", line=line@entry=1162, function=function@entry=0x46a0bb <__PRETTY_FUNCTION__.6737> "create_image") at assert.c:92
#3 0x00007ffff6a78892 in __GI___assert_fail (assertion=0x46a047 "colos <= bp->width", file=0x469f30 "progress.c", line=1162,
function=0x46a0bb <__PRETTY_FUNCTION__.6737> "create_image") at assert.c:101
#4 0x000000000042ee7f in create_image (bp=0x48a870, dl_total_time=4.1304230479999999, done=false) at progress.c:1162
#5 0x000000000042dd0a in bar_draw (progress=0x48a870) at progress.c:656
#6 0x000000000042cfb3 in progress_update (progress=0x48a870, howmuch=1408, dltime=4.1304230479999999) at progress.c:187
#7 0x000000000043272e in fd_read_body (downloaded_filename=0x484730 "/dev/null", fd=4, out=0x484370, toread=121736154, startpos=0, qtyread=0x7fffffffba80,
qtywritten=0x7fffffffba30, elapsed=0x7fffffffba88, flags=1, out2=0x0) at retr.c:413
#8 0x000000000041f0e9 in read_response_body (hs=0x7fffffffba30, sock=4, fp=0x484370, contlen=121736154, contrange=0, chunked_transfer_encoding=false,
url=0x484270 "http://kernel.nic.funet.fi/pub/linux/kernel/v3.x/linux-3.16.tar.gz", warc_timestamp_str=0x7fffffffb470 "\300\265\377\377\377\177",
warc_request_uuid=0x7fffffffb440 "\220\255\245\366\377\177", warc_ip=0x0, type=0x4883d0 "application/x-gzip", statcode=200,
head=0x4885a0 "HTTP/1.1 200 OK\r\nDate: Wed, 12 Nov 2014 21:21:55 GMT\r\nServer: Apache/2.2.25 (Unix)\r\nLast-Modified: Sun, 03 Aug 2014 22:38:37 GMT\r\nETag: \"8be265-7418bda-4ffc148809540\"\r\nAccept-Ranges: bytes\r\nContent-Le"...) at http.c:1587
#9 0x0000000000422cbd in gethttp (u=0x4840d0, hs=0x7fffffffba30, dt=0x7fffffffbd7c, proxy=0x0, iri=0x4841b0, count=1) at http.c:2974
#10 0x00000000004233ac in http_loop (u=0x4840d0, original_url=0x4840d0, newloc=0x7fffffffbbc8, local_file=0x7fffffffbbb8, referer=0x0, dt=0x7fffffffbd7c, proxy=0x0,
iri=0x4841b0) at http.c:3172
#11 0x00000000004331bf in retrieve_url (orig_parsed=0x4840d0, origurl=0x484160 "http://kernel.nic.funet.fi/pub/linux/kernel/v3.x/linux-3.16.tar.gz", file=0x7fffffffbd88,
newloc=0x7fffffffbd80, refurl=0x0, dt=0x7fffffffbd7c, recursive=false, iri=0x4841b0, register_status=true) at retr.c:795
#12 0x000000000042bf11 in main (argc=6, argv=0x7fffffffbf68) at main.c:1665
(gdb) frame 4
#4 0x000000000042ee7f in create_image (bp=0x48a870, dl_total_time=4.1304230479999999, done=false) at progress.c:1162
1162 assert (colos <= bp->width);
(gdb) p colos
$1 = 175
(gdb) p *bp
$2 = {f_download = 0x484730 "/dev/null", initial_length = 0, total_length = 121736154, count = 805376, last_screen_update = 3.9303991489999999, dltime = 4.1304230479999999,
width = 174, buffer = 0x48aa40 "/dev/null", ' ' <repeats 37 times>, "0%[", ' ' <repeats 93 times>, "] 786.50K 211KB/s eta 10m 20s", tick = 21, hist = {pos = 5,
times = {0.15999829399999976, 0.15027624799999995, 0.15001283700000023, 0.16986830699999977, 0.15056181800000035, 0.15220666300000008, 0.15756232899999989,
0.17999204599999996, 0.16904025200000006, 0.16064593300000007, 0.15080275999999992, 0.15794232799999985, 0.15061962399999995, 0.15139164900000024, 0.15025713100000004,
0.15835376499999976, 0.16987030500000033, 0.15034667800000001, 0.17917241699999975, 0.1602484620000002}, bytes = {26752, 23759, 28337, 29568, 29903, 33792, 26417,
60879, 30976, 53504, 33457, 52096, 36943, 29568, 40832, 15616, 50560, 40497, 21120, 19712}, total_time = 3.1791698460000002, total_bytes = 684288},
recent_start = 4.0809609670000002, recent_bytes = 12672, stalled = false, last_eta_time = 4.1304230479999999, last_eta_value = 620}

Sami Farin <Safari>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32431:  0001-Remove-assert-that-keeps-failing.patch added by darnir (760B - text/x-patch - Patch that can be applied to prevent assert failure)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by darnir (Updated the item)
  • -unavailable- added by Safari (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 16 Nov 2014 06:35:54 AM UTCdarnirStatusNeeds Investigation=>Fixed
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>1.16.1
    Fri 14 Nov 2014 11:00:18 AM UTCdarnirPriority5 - Normal=>7 - High
      StatusNone=>Needs Investigation
      Assigned toNone=>darnir
      Patch IncludedNo=>Yes
    Fri 14 Nov 2014 10:58:30 AM UTCdarnirAttached File-=>Added 0001-Remove-assert-that-keeps-failing.patch, #32431

    Back to the top


    Powered by Savane 3.1-cleanup1