Bug 30941 - Crash on updating package list
Summary: Crash on updating package list
Alias: None
Product: PackageKit
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Richard Hughes
QA Contact:
Depends on:
Reported: 2010-10-17 10:03 UTC by Matthias Klumpp
Modified: 2010-10-17 14:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

test patch (375 bytes, patch)
2010-10-17 11:44 UTC, Richard Hughes
Details | Splinter Review

Description Matthias Klumpp 2010-10-17 10:03:05 UTC
When I update the package list, the daemon sometimes crashes, throwing an arithmetic exception:

(gdb) backtrace full
#0  0x0000000000429784 in pk_time_get_gradient (pktime=0x672190) at pk-time.c:136
No locals.
#1  pk_time_get_remaining (pktime=0x672190) at pk-time.c:170
        i = <value optimized out>
        averaged = 0
        length = <value optimized out>
        grad = 1
        grad_ave = <value optimized out>
        estimated = <value optimized out>
        percentage_left = <value optimized out>
        elapsed = <value optimized out>
        item = <value optimized out>
        item_prev = 0x85dd70
        __PRETTY_FUNCTION__ = "pk_time_get_remaining"
        __FUNCTION__ = "pk_time_get_remaining"
#2  0x0000000000426127 in pk_backend_set_percentage (backend=0x66d010, percentage=98) at pk-backend.c:814
        remaining = <value optimized out>
        __PRETTY_FUNCTION__ = "pk_backend_set_percentage"
        __FUNCTION__ = "pk_backend_set_percentage"
#3  0x00007ffff27bc206 in AcqPackageKitStatus::Pulse(pkgAcquire*) ()
   from /usr/lib/packagekit-backend/libpk_backend_aptcc.so
No symbol table info available.
---Type <return> to continue, or q <return> to quit---
#4  0x00007ffff22de2e7 in pkgAcquire::Run(int) () from /usr/lib/libapt-pkg.so.4.10
No symbol table info available.
#5  0x00007ffff22d4a90 in ListUpdate(pkgAcquireStatus&, pkgSourceList&, int) () from /usr/lib/libapt-pkg.so.4.10
No symbol table info available.
#6  0x00007ffff27d8b4a in ?? () from /usr/lib/packagekit-backend/libpk_backend_aptcc.so
No symbol table info available.
#7  0x0000000000422d62 in pk_backend_thread_setup (thread_data=<value optimized out>) at pk-backend.c:2438
        ret = <value optimized out>
        helper = 0x6d1990
        __FUNCTION__ = "pk_backend_thread_setup"
#8  0x00007ffff60337e4 in ?? () from /lib/libglib-2.0.so.0
No symbol table info available.
#9  0x00007ffff7761971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
        __res = <value optimized out>
        pd = 0x7ffff1b51710
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737248565008, 1057769000915815089, 140737488347168, 
                140737248565712, 140737354125376, 3, -1057765201475941711, -1057750383533634895}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, 
              canceltype = 0}}}
        not_first_call = <value optimized out>
        robust = <value optimized out>
        freesize = <value optimized out>
---Type <return> to continue, or q <return> to quit---
        __PRETTY_FUNCTION__ = "start_thread"
#10 0x00007ffff56a292d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locals.
#11 0x0000000000000000 in ?? ()
No symbol table info available.

I use Ubuntu Maverick, the PK backend is APTcc, PackageKit version is the latest Git snapshot.
Comment 1 Richard Hughes 2010-10-17 11:44:09 UTC
Created attachment 39493 [details] [review]
test patch

Could you try this test patch please. Thanks.
Comment 2 Matthias Klumpp 2010-10-17 12:12:01 UTC
Works. (Tried it several times, it looks like the error is gone.)
Comment 3 Richard Hughes 2010-10-17 13:56:19 UTC
commit e205afe7a3630fd607d731671d5e18897424fc7a
Author: Richard Hughes <richard@hughsie.com>
Date:   Sun Oct 17 20:30:21 2010 +0100

    Prevent a segfault when estimating the time when the backend issues many ProgressChanged signals at one time. Fixes #30941
Comment 4 Matthias Klumpp 2010-10-17 14:21:47 UTC

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.