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 754248 - Add new printer dialog crashes when you put '%' in it
Add new printer dialog crashes when you put '%' in it
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Printers
3.16.x
Other Linux
: High critical
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-28 15:18 UTC by Hamid Noroozi
Modified: 2015-09-15 09:43 UTC
See Also:
GNOME target: 3.18
GNOME version: ---


Attachments
printers: avoid crashes when searching for printers w/ special chars (1.05 KB, patch)
2015-09-03 11:28 UTC, Felipe Borges
none Details | Review
printers: avoid crashes when searching for printers w/ special chars (1.08 KB, patch)
2015-09-14 15:00 UTC, Felipe Borges
committed Details | Review

Description Hamid Noroozi 2015-08-28 15:18:08 UTC
When you try to add a new printer, if the name contains '%', it will crash immediately.

We have a network printer named "SafeCom Unix"

We use the whole URI to find it like : 
smb://ipaddress/SafeCom%20Unix

Right after inserting '%', the dialog crashes.
Comment 1 Bastien Nocera 2015-08-31 12:32:55 UTC
Thanks for taking the time to report this.
Without a stack trace from the crash it's very hard to determine what caused it.
Can you get us a stack trace and mention which version of gnome-control-center you're using? Please see https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces for more information on how to do so. When pasting a stack trace in this bug report, please reset the status of this bug report from NEEDINFO to its previous status. Thanks in advance!
Comment 2 Matthias Clasen 2015-08-31 18:14:46 UTC
putting crashes on the blocker list for now - although I haven't been able to reproduce this in quick testing.
Comment 3 Hamid Noroozi 2015-09-01 20:07:58 UTC
I'm using gnome-control-center 3.16.2 on fedora 22.

Here is the stack trace :

(gdb) bt full
  • #0 g_hostname_is_non_ascii
  • #1 g_simple_proxy_resolver_lookup
  • #2 g_proxy_resolver_gnome_lookup_internal
  • #3 g_proxy_resolver_gnome_lookup_async
  • #4 g_socket_client_connect_to_host_async
  • #5 pp_host_get_jetdirect_devices_async
  • #6 search_for_remote_printers
  • #7 g_timeout_dispatch
  • #8 g_main_context_dispatch
  • #9 g_main_context_iterate.isra
  • #10 g_main_context_iteration
  • #11 g_application_run
  • #12 main

Comment 4 Hamid Noroozi 2015-09-01 20:09:28 UTC
Semms I cannot change the status of the bug to anything other than resolved!
Comment 5 Bastien Nocera 2015-09-01 21:01:16 UTC
(In reply to Hamid Noroozi from comment #3)
> I'm using gnome-control-center 3.16.2 on fedora 22.
> 
> Here is the stack trace :

Can you please install at least glib2-debuginfo and control-center-debuginfo (make sure the versions match what you have installed).
Comment 6 Felipe Borges 2015-09-03 11:28:37 UTC
Created attachment 310583 [details] [review]
printers: avoid crashes when searching for printers w/ special chars

Since the dialog considers just  the hostname part from the URL,
unespacing the url avoids a backend crash.
Comment 7 Bastien Nocera 2015-09-03 11:30:45 UTC
(In reply to Felipe Borges from comment #6)
> Created attachment 310583 [details] [review] [review]
> printers: avoid crashes when searching for printers w/ special chars
> 
> Since the dialog considers just  the hostname part from the URL,
> unespacing the url avoids a backend crash.

A reproducer would be useful.
Comment 8 Felipe Borges 2015-09-03 11:32:59 UTC
To reproduce it, just click the + button to add a new printer and type the % symbol at the search entry box.
Comment 9 Bastien Nocera 2015-09-09 11:05:41 UTC
(In reply to Felipe Borges from comment #8)
> To reproduce it, just click the + button to add a new printer and type the %
> symbol at the search entry box.

Right, that crashes, the example in comment 0 didn't.
Comment 10 Bastien Nocera 2015-09-09 11:06:40 UTC
Review of attachment 310583 [details] [review]:

That looks fine. Please cherry-pick as necessary to master, gnome-3-16 and gnome-3-14.
Comment 11 Marek Kašík 2015-09-13 19:02:23 UTC
You are leaking the "resulting_host" string in the patch.
Comment 12 Bastien Nocera 2015-09-14 13:00:42 UTC
Review of attachment 310583 [details] [review]:

As Marek mentioned, it's leaking the "resulting_host" string.
Comment 13 Felipe Borges 2015-09-14 15:00:42 UTC
Created attachment 311291 [details] [review]
printers: avoid crashes when searching for printers w/ special chars

Since the dialog considers just  the hostname part from the URL,
unespacing the url avoids a backend crash.
Comment 14 Bastien Nocera 2015-09-14 15:11:23 UTC
Review of attachment 311291 [details] [review]:

Please request a freeze break, and commit to master for GNOME 3.18 and backport as required.