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 762955 - Crash in ephy_certificate_popover_set_address
Crash in ephy_certificate_popover_set_address
Status: RESOLVED OBSOLETE
Product: epiphany
Classification: Core
Component: General
3.16.x (obsolete)
Other Linux
: Normal critical
: ---
Assigned To: Iulian Radu
Epiphany Maintainers
Depends on: 769227
Blocks:
 
 
Reported: 2016-03-01 20:59 UTC by Michael Catanzaro
Modified: 2018-08-03 20:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Catanzaro 2016-03-01 20:59:53 UTC
A crash report from Diogo:

Clicked on the "lock icon", at right of the "URL bar" (after clicking to edit the URL).
I can not reproduce, however.

Version-Release number of selected component:
epiphany-runtime-3.16.2-2.fc22

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 ephy_certificate_popover_set_address at ephy-certificate-popover.c:69
 #1 ephy_certificate_popover_set_property at ephy-certificate-popover.c:177
 #2 object_set_property at gobject.c:1415
 #3 g_object_new_internal at gobject.c:1808
 #4 g_object_new_valist at gobject.c:2033
 #6 ephy_certificate_popover_new at ephy-certificate-popover.c:353
 #7 open_certificate_popover at ephy-window.c:3168
 #8 location_controller_lock_clicked_cb at ephy-window.c:3191
 #17 icon_button_press_event_cb at ephy-location-entry.c:884
 #22 gtk_entry_event at gtkentry.c:4310

It might be related to UTF-8, not sure.
Comment 1 Iulian Radu 2016-03-05 12:42:56 UTC
I managed to reproduce the problem when clicking the lock for the about:blank page. There's no host for that URI so g_markup_printf_escaped () fails.

>0x0000000000487453 in ephy_security_popover_set_address (popover=0x722900, address=0x107d350 "") at ephy-security-popover.c:74
>74	  uri_text = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>.", uri->host);

I had a look at the rest of the "about:" pages and they don't have the lock icon. The address for those pages is being normalized to "ephy-about:" and all pages with the "ephy-about" scheme are registered as local pages so there's no lock displayed for them. I'm not sure we don't normalize the about:blank page as well [0].

Looking for suggestions on how to fix this issue as I'm not sure why about:blank is treated differently or why we need both "ephy-about" and "about"

Please note that there are also problems when switching between tabs or when about tabs (not just about:blank, all of them) are restored when opening the browser. I think we need to make sure we normalize the pages in all cases, not just when we open the link by activating the LocationEntry.


[0] https://git.gnome.org/browse/epiphany/tree/embed/ephy-embed-utils.c#n201
Comment 2 Michael Catanzaro 2016-03-05 14:02:10 UTC
(In reply to Iulian Radu from comment #1)
> I managed to reproduce the problem when clicking the lock for the
> about:blank page. There's no host for that URI so g_markup_printf_escaped ()
> fails.

Good find. Hm, a SoupURI is guaranteed to have a non-null host, so I think soup_uri_new() must be returning NULL, do you agree? In the case of about:blank that's expected and the best fix is to make sure we don't show the lock icon. But about:blank can't be the cause of the original crash reports, though, as in 3.18 we did not show security indicators except on HTTPS pages.

We could choose to handle the case where soup_uri_new() returns NULL, but I think it should never return NULL for any address we pass to it. Looking at the downstream backtrace, I see now what I missed before: the address we pass to SoupURI is "", i.e. an empty string. That's not good.

We have a similar crash in ephy_certificate_dialog_set_address, by the way, which does only this:

  uri = soup_uri_new (address);
  gtk_window_set_title (GTK_WINDOW (dialog), uri->host);
  soup_uri_free (uri);

And that code hasn't changed since 2012. That crash stopped happening when I added the certificate popover, but I bet it'll return if we fix the certificate popover crash. Anyway, I'm not sure what to do here as I don't understand why we have an empty address. We can fix the about:blank case at least, though.

> Looking for suggestions on how to fix this issue as I'm not sure why
> about:blank is treated differently or why we need both "ephy-about" and
> "about"

Let's see if Carlos will comment, since he wrote that code. I'm not sure why that is.

> Please note that there are also problems when switching between tabs or when
> about tabs (not just about:blank, all of them) are restored when opening the
> browser. I think we need to make sure we normalize the pages in all cases,
> not just when we open the link by activating the LocationEntry.

Hm....
Comment 3 GNOME Infrastructure Team 2018-08-03 20:47:36 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/epiphany/issues/307.