After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698642 - g-c-c crashes with SIGSEGV when adding a printer
g-c-c crashes with SIGSEGV when adding a printer
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Printers
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-23 10:18 UTC by Andreas Trepczik
Modified: 2013-04-24 13:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdb gnome-control-center - combined backtrace (20.00 KB, text/plain)
2013-04-23 10:18 UTC, Andreas Trepczik
  Details
valgrind gnome-control-center printers (46.55 KB, text/plain)
2013-04-23 16:00 UTC, Andreas Trepczik
  Details
don't crash without system-config-printer (1.50 KB, patch)
2013-04-24 12:12 UTC, Marek Kašík
committed Details | Review

Description Andreas Trepczik 2013-04-23 10:18:16 UTC
Created attachment 242199 [details]
gdb gnome-control-center - combined backtrace

GNOME Control Center crashes with a segmentation fault when selecting a printer from the list of available printers and clicking on "Add". Sometimes the crash occurs in magazine_chain_pop_head, sometimes it's g_slist_copy_deep. A gdb backtrace with both cases is attached.

Setup:
---
Arch Linux x86_64
glib2 2.36.1-1
gnome-control-center 3.8.1
gtk3 3.8.1-1
Comment 1 Marek Kašík 2013-04-23 13:51:31 UTC
Hi Andreas,

thank you for this report. Does it crash during addition of a local USB printer or a network printer? What model is it?

Regards

Marek
Comment 2 Bastien Nocera 2013-04-23 13:55:26 UTC
(In reply to comment #0)
> Created an attachment (id=242199) [details]
> gdb gnome-control-center - combined backtrace
> 
> GNOME Control Center crashes with a segmentation fault when selecting a printer
> from the list of available printers and clicking on "Add". Sometimes the crash
> occurs in magazine_chain_pop_head, sometimes it's g_slist_copy_deep. A gdb
> backtrace with both cases is attached.

That smells like a memory corruption issues, which would be best debugged by running the application under valgrind.

Running:
G_SLICE=always-malloc valgrind --tool=memcheck gnome-control-center printers
and reproducing the problem should help.
Comment 3 Andreas Trepczik 2013-04-23 16:00:08 UTC
Created attachment 242254 [details]
valgrind gnome-control-center printers
Comment 4 Andreas Trepczik 2013-04-23 16:00:27 UTC
Hi,

@Marek
It crashes during addition of any printer. In my case, I tried both a network printer (Epson Stylus Office BX600FW) and a virtual PDF printer.

I have run g-c-c in valgrind as suggested and have attached the log to this report.
Comment 5 Jeremy Bicha 2013-04-23 16:13:05 UTC
Do you have system-config-printer installed?
If not, please ask the Arch Linux maintainers to have gnome-control-center depend on it for the Add Printer feature to work correctly.
Comment 6 Andreas Trepczik 2013-04-23 16:25:27 UTC
That was it! Installing system-config-printer solved the crash issues. I have opened a ticket on Arch Linux bug tracking system to add this package as a dependency of gnome-control-center.

Thanks for your help everyone.
Comment 7 Jeremy Bicha 2013-04-23 16:42:48 UTC
Thanks Andreas. I'm going to go ahead and close this bug now.
Comment 8 Bastien Nocera 2013-04-23 16:54:54 UTC
Even then, we shouldn't be crashing.
Comment 9 Marek Kašík 2013-04-24 12:12:47 UTC
Created attachment 242316 [details] [review]
don't crash without system-config-printer

Hi,

thank you for the info. The problem is in handling of error during addition of new printer. Attached patch fixes the problem.
It also applies to 3.6.

Regards

Marek
Comment 10 Bastien Nocera 2013-04-24 13:06:25 UTC
Review of attachment 242316 [details] [review]:

Looks good.
Comment 11 Marek Kašík 2013-04-24 13:57:27 UTC
Comment on attachment 242316 [details] [review]
don't crash without system-config-printer

Thank you for the review. I've pushed the patch to gnome-3-6, gnome-3-8 and master.