AppCenter crashes when typing

Bug #1646020 reported by mistrani
94
This bug affects 17 people
Affects Status Importance Assigned to Milestone
AppCenter
Fix Released
High
Corentin Noël

Bug Description

When typing for searching the AppCenter exits. Same when searching by categories.

Related branches

Revision history for this message
mistrani (mistrani) wrote :

If I try and reinstall software-center I have following error:

ERROR:root:DebFileApplication import
Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/db/__init__.py", line 6, in <module>
    from .debfile import DebFileApplication, DebFileOpenError
  File "/usr/share/software-center/softwarecenter/db/debfile.py", line 25, in <module>
    from softwarecenter.db.application import Application, AppDetails
  File "/usr/share/software-center/softwarecenter/db/application.py", line 28, in <module>
    import softwarecenter.distro
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 201, in <module>
    distro_instance = _get_distro()
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 176, in _get_distro
    module = __import__(distro_module_name, globals(), locals(), [], level)
ImportError: No module named "elementary"
Traceback (most recent call last):
  File "/usr/sbin/update-software-center", line 38, in <module>
    from softwarecenter.db.update import rebuild_database
  File "/usr/share/software-center/softwarecenter/db/update.py", line 33, in <module>
    from softwarecenter.backend.scagent import SoftwareCenterAgent
  File "/usr/share/software-center/softwarecenter/backend/scagent.py", line 30, in <module>
    from softwarecenter.distro import get_distro, get_current_arch
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 201, in <module>
    distro_instance = _get_distro()
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 176, in _get_distro
    module = __import__(distro_module_name, globals(), locals(), [], level)
ImportError: No module named "elementary"

Revision history for this message
mistrani (mistrani) wrote :

Sorry, previous post is wrong.
When launching from Terminal I have the following:

[INFO 09:24:52.803410] Application.vala:155: Centro applicazioni version: 0.1.2
[INFO 09:24:52.803437] Application.vala:157: Kernel version: 4.4.0-47-generic
Errore di segmentazione (core dump creato)

i.e. Segmentation fault (core dumped)

Revision history for this message
Zisu Andrei (matzipan) wrote :

Hello,

Can you please run:

gdb appcenter
run

Reproduce the crash, and then when that happens, run:

bt

And post the output here?

Changed in appcenter:
status: New → Incomplete
Revision history for this message
Zisu Andrei (matzipan) wrote :

Ok, I've managed to reproduce this issue.

Backtrace:
(gdb) bt
#0 0x0000000000410220 in ?? ()
#1 0x00007ffff57995ab in g_ptr_array_foreach () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x0000000000411a50 in app_center_core_client_search_applications ()
#3 0x0000000000420804 in app_center_views_search_view_search ()
#4 0x0000000000417c41 in ?? ()
#5 0x00007ffff5a9c1d4 in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6 0x00007ffff5ab69a6 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7 0x00007ffff5ab708f in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#8 0x00007ffff6cc239a in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#9 0x00007ffff57c5ac3 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff57c505a in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff57c5400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff57c54ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff75adcdd in g_application_run () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#14 0x00007ffff7b6f280 in granite_application_run () from /usr/lib/x86_64-linux-gnu/libgranite.so.3
#15 0x0000000000417898 in _vala_main ()
#16 0x00007ffff5130830 in __libc_start_main (main=0x40e3c0 <main>, argc=1, argv=0x7fffffffddc8, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffddb8)
    at ../csu/libc-start.c:291
#17 0x000000000040e409 in _start ()

Changed in appcenter:
status: Incomplete → Confirmed
Revision history for this message
Joaquin Nigro (jnigro) wrote :

It happens to me too. I've realized that AppCenter crash only when I start to type in search box and write only two characters. If I write fast more than two letters, AppCenter no crashs

Sorry for my english

Thank you!

Revision history for this message
mistrani (mistrani) wrote :

#0 0x00000000004104a0 in ?? ()
#1 0x00007ffff579c5ab in g_ptr_array_foreach () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x0000000000411d90 in app_center_core_client_search_applications ()
#3 0x0000000000420a34 in app_center_views_search_view_search ()
#4 0x0000000000417ef1 in ?? ()
#5 0x00007ffff5a9f1d4 in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6 0x00007ffff5ab99a6 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7 0x00007ffff5aba08f in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#8 0x00007ffff6cc439a in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#9 0x00007ffff57c8ac3 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff57c805a in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff57c8400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff57c84ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff75afcdd in g_application_run () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#14 0x00007ffff7b70f30 in granite_application_run () from /usr/lib/x86_64-linux-gnu/libgranite.so.3
#15 0x0000000000417b48 in _vala_main ()
#16 0x00007ffff5133830 in __libc_start_main (main=0x40e4d0 <main>, argc=1, argv=0x7fffffffd708, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=0x7fffffffd6f8) at ../csu/libc-start.c:291
#17 0x000000000040e519 in _start ()

Revision history for this message
James McManus (mcbits) wrote :

I'm not sure how to make and offer a patch yet, but in Core/Client.vala, there are several places where it appears AppStream.Component.get_pkgnames returns a null (surprisingly?) and is dereferenced without checking first.

I added null+length checks and this crash went away, along with the categories crash in bug #1646164.

Revision history for this message
James McManus (mcbits) wrote :

Here is a patch in case it's helpful.

This might just be a bandaid over a deeper issue (how does a package have no names?), but at least it stops the bleeding. I didn't put the validation around *all* get_pkgnames calls because they don't seem to be running into the problem.

Revision history for this message
Corentin Noël (tintou) wrote :

mcbits: Oh I was fixing the category crash bug and then saw this bug, we both found the same cause of the bug, it's really weird that some components have no package…

Changed in appcenter:
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Corentin Noël (tintou)
Revision history for this message
Corentin Noël (tintou) wrote :

Okay I also fixed the empty components, it seems that AppStream was also indexing the installed .desktop files and thus finding some that doesn't belong to a package. So now it won't search there for AppCenter.

Changed in appcenter:
status: In Progress → Fix Committed
milestone: none → juno-beta1
Revision history for this message
Ramiz Demiurge (ramiz.demiurge) wrote :

So, I found a bug. AppCenter crashes when you type two symbols. Just two, like `tv`.
It's on Loki: stable repositories, they are actual.

GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
---Type <return> to continue, or q <return> to quit---run
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from appcenter...(no debugging symbols found)...done.
(gdb)
(gdb) run
Starting program: /usr/bin/appcenter
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[INFO 14:22:52.683361] Application.vala:155: App Center version: 0.1.2
[INFO 14:22:52.683434] Application.vala:157: Kernel version: 4.4.0-51-generic
[New Thread 0x7fffe70f6700 (LWP 12406)]
[New Thread 0x7fffe68f5700 (LWP 12407)]
[New Thread 0x7fffe4d4e700 (LWP 12408)]
[New Thread 0x7fffd7fff700 (LWP 12409)]
[FATAL 14:22:58.708035] Client.vala:241: The package id's '' are not valid

Thread 1 "appcenter" received signal SIGSEGV, Segmentation fault.
0x00000000004104a0 in ?? ()

Cody Garver (codygarver)
Changed in appcenter:
milestone: juno-beta1 → 0.1.3
status: Fix Committed → Fix Released
Revision history for this message
Bjoern (bjoern0) wrote :

Problem solved with the latest update, thanks to all who cared!

Revision history for this message
Protik Datta (protikdatta9) wrote : Re: [Bug 1646020] Re: AppCenter crashes when typing

Thank you sir, but my linux suddenly started to install prorgams, and
the appcentre is nowhere to be found. Would be obliged if the team
looks into that. And by the way, is the replacement called "Software".
Because the AppCenter can't be found but I am able to use the aforesaid
application.
On Tue, Dec 6, 2016 at 12:57 AM, Bjoern <email address hidden>
wrote:
> Problem solved with the latest update, thanks to all who cared!
>
> --
> You received this bug notification because you are subscribed to the
> bug
> report.
> https://bugs.launchpad.net/bugs/1646020
>
> Title:
> AppCenter crashes when typing
>
> Status in AppCenter:
> Fix Released
>
> Bug description:
> When typing for searching the AppCenter exits. Same when searching
> by
> categories.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/appcenter/+bug/1646020/+subscriptions

Revision history for this message
Jan Koci (cicindel) wrote :

I know the fix was released but all the update did for me was getting rid of the segmentation fault. Now launching from terminal doesn't show any errors but the appcenter still hangs after two letters have been typed into the search field, consuming one whole CPU core.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.