Bug 1166974 - packagekitd segfault
Summary: packagekitd segfault
Keywords:
Status: CLOSED DUPLICATE of bug 1164330
Alias: None
Product: Fedora
Classification: Fedora
Component: PackageKit
Version: rawhide
Hardware: x86_64
OS: All
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Hughes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-22 07:32 UTC by Ömer Fadıl Usta
Modified: 2014-11-26 10:39 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-26 10:39:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ömer Fadıl Usta 2014-11-22 07:32:40 UTC
[   96.297203] packagekitd[2549]: segfault at 0 ip 00007f144a29b417 sp 00007fff9c531ed8 error 4 in libc-2.20.90.so[7f144a154000+1bc000]
[  136.390596] packagekitd[2920]: segfault at 0 ip 00007f5468fa4417 sp 00007fff4a0fc7d8 error 4 in libc-2.20.90.so[7f5468e5d000+1bc000]
[  208.488656] packagekitd[3059]: segfault at 0 ip 00007f4556e42417 sp 00007fff4ce6d838 error 4 in libc-2.20.90.so[7f4556cfb000+1bc000]
[  233.478116] packagekitd[3110]: segfault at 0 ip 00007f1e1a9f1417 sp 00007fff5ac49b58 error 4 in libc-2.20.90.so[7f1e1a8aa000+1bc000]
[  459.800663] packagekitd[3342]: segfault at 0 ip 00007fe3a846c417 sp 00007fff3cf4b658 error 4 in libc-2.20.90.so[7fe3a8325000+1bc000]
[  496.143515] packagekitd[3431]: segfault at 0 ip 00007f0f87549417 sp 00007fffc1b17868 error 4 in libc-2.20.90.so[7f0f87402000+1bc000]

Comment 1 Mykola Dvornik 2014-11-25 10:06:36 UTC
The same happens to me in F21. Here is the stack dump:

Process 9116 (packagekitd) of user 0 dumped core.
                                                 
                                                 Stack trace of thread 9116:
                                                 #0  0x00007fe56bb771f7 __strncasecmp_l_avx (libc.so.6)
                                                 #1  0x00007fe561a4a77b hif_source_is_local (libhif.so.1)
                                                 #2  0x00007fe561a483ec hif_repos_refresh (libhif.so.1)
                                                 #3  0x00007fe561a48bfc hif_repos_get_sources (libhif.so.1)
                                                 #4  0x00007fe561a43fc9 hif_context_setup (libhif.so.1)
                                                 #5  0x00007fe561c63c37 pk_backend_initialize (libpk_backend_hif.so)
                                                 #6  0x00007fe56d6a7991 pk_backend_load (packagekitd)
                                                 #7  0x00007fe56d6b4f07 pk_engine_load_backend (packagekitd)
                                                 #8  0x00007fe56d69bda1 main (packagekitd)
                                                 #9  0x00007fe56ba52fe0 __libc_start_main (libc.so.6)
                                                 #10 0x00007fe56d69bf75 _start (packagekitd)
                                                 
                                                 Stack trace of thread 9117:
                                                 #0  0x00007fe56bb281dd poll (libc.so.6)
                                                 #1  0x00007fe56c26ce24 g_main_context_iterate.isra.29 (libglib-2.0.so.0)
                                                 #2  0x00007fe56c26d1b2 g_main_loop_run (libglib-2.0.so.0)
                                                 #3  0x00007fe56c887d96 gdbus_shared_thread_func (libgio-2.0.so.0)
                                                 #4  0x00007fe56c2937b5 g_thread_proxy (libglib-2.0.so.0)
                                                 #5  0x00007fe56bdf752a start_thread (libpthread.so.0)
                                                 #6  0x00007fe56bb3377d __clone (libc.so.6)
                                                 
                                                 Stack trace of thread 9118:
                                                 #0  0x00007fe56bb2de89 syscall (libc.so.6)
                                                 #1  0x00007fe56c2b1447 g_cond_wait_until (libglib-2.0.so.0)
                                                 #2  0x00007fe56c241c09 g_async_queue_pop_intern_unlocked (libglib-2.0.so.0)
                                                 #3  0x00007fe56c294120 g_thread_pool_thread_proxy (libglib-2.0.so.0)
                                                 #4  0x00007fe56c2937b5 g_thread_proxy (libglib-2.0.so.0)
                                                 #5  0x00007fe56bdf752a start_thread (libpthread.so.0)
                                                 #6  0x00007fe56bb3377d __clone (libc.so.6)
                                                 
                                                 Stack trace of thread 9119:
                                                 #0  0x00007fe56bb281dd poll (libc.so.6)
                                                 #1  0x00007fe56c26ce24 g_main_context_iterate.isra.29 (libglib-2.0.so.0)
                                                 #2  0x00007fe56c26cf3c g_main_context_iteration (libglib-2.0.so.0)
                                                 #3  0x00007fe56c26cf79 glib_worker_main (libglib-2.0.so.0)
                                                 #4  0x00007fe56c2937b5 g_thread_proxy (libglib-2.0.so.0)
                                                 #5  0x00007fe56bdf752a start_thread (libpthread.so.0)
                                                 #6  0x00007fe56bb3377d __clone (libc.so.6)

Comment 2 Ömer Fadıl Usta 2014-11-25 22:11:55 UTC
Thanks to @Mykola Dvornik stack dump :
I have seen this in libhif in hif_source_is_local this part might
be the reason of problem :

First hif_source_is_local full part :

hif_source_is_local (HifSource *source)
{
	HifSourcePrivate *priv = GET_PRIVATE (source);

	/* media */
	if (priv->keyfile == NULL ||
	    hif_source_get_kind (source) == HIF_SOURCE_KIND_MEDIA) {
		return TRUE;
	}

	/* file:// */
	if (g_key_file_has_key (priv->keyfile, priv->id, "baseurl", NULL) &&
	    !g_key_file_has_key (priv->keyfile, priv->id, "mirrorlist", NULL) &&
	    !g_key_file_has_key (priv->keyfile, priv->id, "metalink", NULL)) {
		_cleanup_strv_free_ gchar **baseurls = NULL;
		baseurls = g_key_file_get_string_list (priv->keyfile,
						       priv->id, "baseurl",
						       NULL, NULL);
		if (baseurls != NULL && baseurls[0] != NULL) {
			_cleanup_free_ gchar *url = NULL;
			url = lr_prepend_url_protocol (baseurls[0]);
			if (strncasecmp (url, "file://", 7) == 0)
				return TRUE;
		}
	}
	return FALSE;
}


** it looks like the if (url != NULL ) {  part is missing ( which must be just after url = lr_prepend_url_protocol (baseurls[0]);

***AND also strncasecmp's last parameter have to be 6 instead of 7
(not sure about it)

Comment 3 Mykola Dvornik 2014-11-26 10:03:05 UTC
> ** it looks like the if (url != NULL ) {  part is missing ( which must be
> just after url = lr_prepend_url_protocol (baseurls[0]);

It seems like baseurl could be malformed, so that the path is specified on the following line (e.g. look at bumblebee .repo file). Then baseurl[0] only contains EOL leading to the strncasecmp failure. dnf and yum are both fine with malformed baseurl. So I would suggest to mimic the way they parse baseurl.

> ***AND also strncasecmp's last parameter have to be 6 instead of 7
> (not sure about it)

strlen("file://") = 7, so it is CORRECT.

Comment 4 Richard Hughes 2014-11-26 10:39:22 UTC

*** This bug has been marked as a duplicate of bug 1164330 ***


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