Bug 1135740 - [abrt] PackageKit: hy_repo_get_string(): packagekitd killed by SIGSEGV
Summary: [abrt] PackageKit: hy_repo_get_string(): packagekitd killed by SIGSEGV
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: PackageKit
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Hughes
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:4bf57b0ad8c1bbf81d1c56af0dd...
: 1066170 1247753 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-31 03:54 UTC by Guillaume Poirier-Morency
Modified: 2015-08-11 11:50 UTC (History)
20 users (show)

Fixed In Version: libhif-0.1.8-4.fc21
Clone Of:
Environment:
Last Closed: 2015-02-05 05:24:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (16.95 KB, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: cgroup (200 bytes, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: core_backtrace (7.25 KB, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: dso_list (8.36 KB, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: environ (234 bytes, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: exploitable (110 bytes, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: limits (1.29 KB, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: maps (37.78 KB, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: open_fds (2.01 KB, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: proc_pid_status (1.03 KB, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details
File: var_log_messages (1.30 KB, text/plain)
2014-08-31 03:54 UTC, Guillaume Poirier-Morency
no flags Details

Description Guillaume Poirier-Morency 2014-08-31 03:54:47 UTC
Version-Release number of selected component:
PackageKit-0.9.4-4.fc21

Additional info:
reporter:       libreport-2.2.3
backtrace_rating: 4
cmdline:        /usr/libexec/packagekitd
crash_function: hy_repo_get_string
executable:     /usr/libexec/packagekitd
kernel:         3.17.0-0.rc2.git2.1.fc22.x86_64
runlevel:       N 5
type:           CCpp
uid:            0

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 hy_repo_get_string at /usr/src/debug/hawkey/py3/src/repo.c:200
 #1 load_yum_repo at /usr/src/debug/hawkey/py3/src/sack.c:548
 #2 hy_sack_load_yum_repo at /usr/src/debug/hawkey/py3/src/sack.c:980
 #3 hif_sack_add_source at hif-sack.c:109
 #4 hif_sack_add_sources at hif-sack.c:154
 #5 hif_context_setup_sack at hif-context.c:803
 #6 hif_context_setup at hif-context.c:912
 #7 pk_backend_initialize at pk-backend-hif.c:203
 #8 pk_backend_load at pk-backend.c:588
 #9 pk_engine_load_backend at pk-engine.c:1059

Potential duplicate: bug 1066170

Comment 1 Guillaume Poirier-Morency 2014-08-31 03:54:49 UTC
Created attachment 933027 [details]
File: backtrace

Comment 2 Guillaume Poirier-Morency 2014-08-31 03:54:50 UTC
Created attachment 933028 [details]
File: cgroup

Comment 3 Guillaume Poirier-Morency 2014-08-31 03:54:51 UTC
Created attachment 933029 [details]
File: core_backtrace

Comment 4 Guillaume Poirier-Morency 2014-08-31 03:54:52 UTC
Created attachment 933030 [details]
File: dso_list

Comment 5 Guillaume Poirier-Morency 2014-08-31 03:54:52 UTC
Created attachment 933031 [details]
File: environ

Comment 6 Guillaume Poirier-Morency 2014-08-31 03:54:53 UTC
Created attachment 933032 [details]
File: exploitable

Comment 7 Guillaume Poirier-Morency 2014-08-31 03:54:54 UTC
Created attachment 933033 [details]
File: limits

Comment 8 Guillaume Poirier-Morency 2014-08-31 03:54:55 UTC
Created attachment 933034 [details]
File: maps

Comment 9 Guillaume Poirier-Morency 2014-08-31 03:54:56 UTC
Created attachment 933035 [details]
File: open_fds

Comment 10 Guillaume Poirier-Morency 2014-08-31 03:54:57 UTC
Created attachment 933036 [details]
File: proc_pid_status

Comment 11 Guillaume Poirier-Morency 2014-08-31 03:54:57 UTC
Created attachment 933037 [details]
File: var_log_messages

Comment 12 Kalev Lember 2014-10-05 19:04:34 UTC
Looks like a hawkey crash. Reassigning.

Comment 13 Michal Luscon 2014-10-24 12:22:35 UTC
Thread 1, frame #2 - PackageKit called hy_sack_load_yum_repo with NULL repo parameter.

-> reassigning back to Packagekit.

Comment 14 Michal Luscon 2014-10-24 12:28:09 UTC
*** Bug 1066170 has been marked as a duplicate of this bug. ***

Comment 15 Robert McBroom 2015-01-12 13:03:52 UTC
Another user experienced a similar problem:

Initial system start. 

reporter:       libreport-2.3.0
backtrace_rating: 4
cmdline:        /usr/libexec/packagekitd
crash_function: hy_repo_get_string
executable:     /usr/libexec/packagekitd
kernel:         3.17.7-300.fc21.x86_64
package:        PackageKit-1.0.3-4.fc21
reason:         packagekitd killed by SIGSEGV
runlevel:       N 3
type:           CCpp
uid:            0

Comment 16 Yupeng Chang 2015-01-13 03:58:32 UTC
Another user experienced a similar problem:

Packagekitd just crashed itself.

reporter:       libreport-2.3.0
backtrace_rating: 4
cmdline:        /usr/libexec/packagekitd
crash_function: hy_repo_get_string
executable:     /usr/libexec/packagekitd
kernel:         3.17.7-300.fc21.x86_64
package:        PackageKit-1.0.3-4.fc21
reason:         packagekitd killed by SIGSEGV
runlevel:       N 5
type:           CCpp
uid:            0

Comment 17 Jean-Paul Lambrechts 2015-01-13 05:44:59 UTC
Another user experienced a similar problem:

It happened during startup.

reporter:       libreport-2.3.0
backtrace_rating: 4
cmdline:        /usr/libexec/packagekitd
crash_function: hy_repo_get_string
executable:     /usr/libexec/packagekitd
kernel:         3.17.8-300.fc21.i686
package:        PackageKit-1.0.3-4.fc21
reason:         packagekitd killed by SIGSEGV
runlevel:       N 5
type:           CCpp
uid:            0

Comment 18 Jean-Paul Lambrechts 2015-01-14 06:51:00 UTC
Another user experienced a similar problem:

PackageKit keeps crashing without apparent reason.

reporter:       libreport-2.3.0
backtrace_rating: 4
cmdline:        /usr/libexec/packagekitd
crash_function: hy_repo_get_string
executable:     /usr/libexec/packagekitd
kernel:         3.17.8-300.fc21.i686
package:        PackageKit-1.0.3-4.fc21
reason:         packagekitd killed by SIGSEGV
runlevel:       N 5
type:           CCpp
uid:            0

Comment 19 DO NOT USE account not monitored (old adamwill) 2015-01-23 02:13:06 UTC
Just saw this too on an F21 system, looks to happen when I launch Software; I can restart packagekit.service and see it running, launch Software, and it crashes.

I had some issues with offline updates just prior to encountering this.

Comment 20 DO NOT USE account not monitored (old adamwill) 2015-01-23 02:16:11 UTC
hum - this seems to be 100%

Comment 21 Adam Williamson 2015-01-23 02:17:26 UTC
This seems to be 100% reproducible for me ATM - I can trigger it every time by launching gnome-software, even after a 'pkcon repair' and a reboot.

Comment 22 Adam Williamson 2015-01-23 19:26:26 UTC
Looking through the code and the backtrace I've got a theory that I caused this by doing:

rm -f /etc/yum.repos.d/fedora-rawhide-kernel-nodebug.repo

because I didn't want to use that repo any more. I suspect that hawkey and/or hif still know about that repo somehow, so they're trying to set it up. It seems plausible that the hif_source_get_repo (src) call in hif_sack_add_source() might return null in this case, then we wind up calling hy_sack_load_repo() with a null second parameter.

I'm not sure where to check and see what repos hawkey/hif 'think' exist, though. I don't know where they get that information.

Comment 23 Adam Williamson 2015-01-23 19:53:54 UTC
OK, yeah, I'm starting to like my theory. My backtrace does end up in the same problem, but it comes down a different path:

#8  0x00007f91b8db1eda in pk_backend_job_thread_setup (thread_data=0x7f91bb267ab0) at pk-backend-job.c:815

#7  0x00007f91ad35cf07 in pk_backend_search_thread (job=0x7f91bb260370 [PkBackendJob], params=<optimized out>, user_data=<optimized out>)
    at pk-backend-hif.c:899

#6  0x00007f91ad35bcfe in hif_utils_create_sack_for_filters (job=job@entry=0x7f91bb260370 [PkBackendJob], filters=<optimized out>, create_flags=<optimized out>,
    create_flags@entry=HIF_CREATE_SACK_FLAG_USE_CACHE, state=0x7f91bb017400 [HifState], error=error@entry=0x7f91927c5da8) at pk-backend-hif.c:678

#5  0x00007f91ad35bcfe in hif_utils_create_sack_for_filters (error=0x7f91927c5da8, state=<optimized out>, flags=13, sack=0x7f918c1a1410, job=0x7f91bb260370 [PkBackendJob]) at pk-backend-hif.c:490

#4  0x00007f91accf7ee4 in hif_sack_add_sources (sack=sack@entry=0x7f918c1a1410, sources=0x7f91bafd4e40, permissible_cache_age=4294967295, flags=flags@entry=13, state=state@entry=0x7f91bb017240 [HifState], error=error@entry=0x7f91927c5da8)
    at hif-sack.c:160

#3  0x00007f91accf7d8e in hif_sack_add_source (sack=sack@entry=0x7f918c1a1410, src=src@entry=0x7f91bb17a2f0 [HifSource], permissible_cache_age=permissible_cache_age@entry=4294967295, flags=flags@entry=13, state=0x7f91bb205f90 [HifState], error=error@entry=0x7f91927c5da8) at hif-sack.c:109

#2  0x00007f91acade39d in hy_sack_load_yum_repo (sack=sack@entry=0x7f918c1a1410, repo=0x0, flags=flags@entry=3) at /usr/src/debug/hawkey/py3/src/sack.c:980

#1  0x00007f91acade39d in hy_sack_load_yum_repo (hrepo=0x0, sack=0x7f918c1a1410) at /usr/src/debug/hawkey/py3/src/sack.c:548

So looking in hif_utils_create_sack_for_filters() it's clear that it will use a cached 'sack' sometimes. In /var/cache/PackageKit/hif/ I see some very cache-y looking bits, including:

fedora-rawhide-kernel-nodebug.solv

though it's rather old:

"Sep 21 22:27"

but in /var/cache/PackageKit/hawkey there's some similar bits, much newer:

Jan 21 07:01 fedora-rawhide-kernel-nodebug.solv

so my bet here is that this code path isn't safe when a repo has been deleted out from under it; the cached sack has a source backed by a repo that doesn't actually exist any more, so when hif_source_get_repo() is called on that source the result is null, and that gets passed to hy_sack_load_repo(), causing the crash.

Comment 24 Adam Williamson 2015-01-23 20:07:25 UTC
So I figured moving /var/cache/PackageKit/hawkey out of the way, restarting packagekit.service, and running gnome-software would work around this bug, but actually, it seems to cause the same crash. Richard's going to look into it further on Monday.

Comment 25 Kamil Páral 2015-02-03 15:00:52 UTC
I easily reproduced this with this repo file:
http://paste.fedoraproject.org/180902/29755291/

It seems it's enough when you point a repo with file:// baseurl into a nonexistent directory.

Comment 26 Richard Hughes 2015-02-03 15:28:37 UTC
commit 43188b72c5b88e0ec427dc0b24acae5f91c72390
Author: Richard Hughes <richard>
Date:   Tue Feb 3 15:15:49 2015 +0000

    If the enabled local source does not exist do not add it to the sack
    
    You can reproduce the problem setting baseurl=file:///notgoingtoexist in an
    enabled .repo file.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1135740

Builds here: http://koji.fedoraproject.org/koji/taskinfo?taskID=8810185

Comment 27 Fedora Update System 2015-02-03 15:55:13 UTC
libhif-0.1.8-3.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/libhif-0.1.8-3.fc21

Comment 28 Fedora Update System 2015-02-04 07:59:38 UTC
Package libhif-0.1.8-4.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libhif-0.1.8-4.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-1644/libhif-0.1.8-4.fc21
then log in and leave karma (feedback).

Comment 29 Fedora Update System 2015-02-05 05:24:22 UTC
libhif-0.1.8-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 30 Radek Holy 2015-08-11 11:50:19 UTC
*** Bug 1247753 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.