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 735706 - Crasher when "save password?" pops up
Crasher when "save password?" pops up
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
3.13.x
Other Linux
: Normal critical
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 734898 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-08-30 10:51 UTC by Bastien Nocera
Modified: 2014-09-11 09:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ephy-web-view: Fix potential crashers (3.09 KB, patch)
2014-09-10 22:27 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2014-08-30 10:51:17 UTC
webkitgtk4-2.5.3-4.fc21.x86_64
epiphany-3.12.1-7.20140822gitb0af36e.fc21.x86_64

1. Go to fpaste.org
2. Paste something
3. Get asked to save the password (though there's no login name)
4. Go to fpaste.org
5. Paste something
6. Crash

                Stack trace of thread 4258:
                #0  0x00007fab40321ee2 g_type_check_instance_cast (libgobject-2.0.so.0)
                #1  0x000000000046401a form_auth_data_save_requested (epiphany)
                #2  0x00007fab383c4d60 ffi_call_unix64 (libffi.so.6)
                #3  0x00007fab383c47d1 ffi_call (libffi.so.6)
                #4  0x00007fab402fe6f4 g_cclosure_marshal_generic (libgobject-2.0.so.0)
                #5  0x00007fab402fded5 g_closure_invoke (libgobject-2.0.so.0)
                #6  0x00007fab40310202 signal_emit_unlocked_R (libgobject-2.0.so.0)
                #7  0x00007fab403190c1 g_signal_emit_valist (libgobject-2.0.so.0)
                #8  0x00007fab403192ef g_signal_emit (libgobject-2.0.so.0)
                #9  0x0000000000468270 ephy_web_extension_proxy_form_auth_save_requested (epiphany)
                #10 0x000000000045ec7c web_extension_form_auth_save_requested (epiphany)
                #11 0x00007fab4060e1c4 emit_signal_instance_in_idle_cb (libgio-2.0.so.0)
                #12 0x00007fab3fffeb6b g_main_dispatch (libglib-2.0.so.0)
                #13 0x00007fab3fffef08 g_main_context_iterate (libglib-2.0.so.0)
                #14 0x00007fab3fffefbc g_main_context_iteration (libglib-2.0.so.0)
                #15 0x00007fab405eaffc g_application_run (libgio-2.0.so.0)
                #16 0x000000000042de53 main (epiphany)
                #17 0x00007fab3f1630e0 __libc_start_main (libc.so.6)
                #18 0x000000000042e233 _start (epiphany)
Comment 1 Michael Catanzaro 2014-08-30 16:02:40 UTC
This probably has the same cause as bug #734898.
Comment 2 Michael Catanzaro 2014-08-30 16:46:38 UTC
Are you able to reproduce this? (Like bug #734898, I haven't managed to.)

When you're asked to save the password, do you accept or hit the close button?  When you "go to fpaste.org" in step four, are you opening a new tab, or reloading the page in the current tab, or just pasting something else into the page that's already loaded (for me, once you paste something it immediately returns me to the New Paste page, and I can paste again right away).
Comment 3 Frederic Peters 2014-08-30 17:00:25 UTC
I tried to reproduce and it crashed with that stack trace at step 3.  I restarted and haven't been able to make it crash after many attempts.  Just like bug 734898 I don't have a reproducible at all times scenario :/
Comment 4 Bastien Nocera 2014-09-10 22:15:08 UTC
Both Fred and I use the "shared-secondary-process" process model. And you probably need to close the web view between 3. and 4.
Comment 5 Bastien Nocera 2014-09-10 22:27:55 UTC
Created attachment 285868 [details] [review]
ephy-web-view: Fix potential crashers

The "form-auth-data-save-requested" signal was not properly disconnected
as the g_signal_handlers_disconnect_by_func() was using the wrong
object.

The "allow-tls-certificate" signal was not disconnected at all.

The "notify::favicon" was needlessly disconnected (it will be
disconnected when the web view disappears).

And the "cleared" signal for the history service was never disconnected.

g_signal_connect_object() should ensure that all the signals we connect
to that have the web view as data are disconnected when the web view is
destroyed.
Comment 6 Bastien Nocera 2014-09-10 22:28:23 UTC
Note, this isn't even compile tested.
Comment 7 Michael Catanzaro 2014-09-10 22:36:39 UTC
*** Bug 734898 has been marked as a duplicate of this bug. ***
Comment 8 Michael Catanzaro 2014-09-10 23:00:46 UTC
Thanks Bastien.  Our code is wrong if the EphyWebExtensionProxy outlives the EphyWebView, which happens if one web process is shared by all tabs.  If this is the case then allow_tls_certificate_cb and form_auth_data_save_requested are called on ALL web views (which is harmless as long as they still exist).

To reproduce:

* Switch the process model to single shared process before starting epiphany
* Navigate to https://www.cacert.org (or some other untrusted site) in one tab and click Load Anyway
* Open a second tab and navigate to https://cacert.com (or some other distinct untrusted site)
* Close the first tab
* Click Load Anyway in the second tab.

The same procedure with password forms would work just as well.
Comment 9 Michael Catanzaro 2014-09-10 23:05:32 UTC
Review of attachment 285868 [details] [review]:

Looks good and fixes my reproducer in comment #8.

(Note that the problem with form_auth_data_save_requested was that it was connected to the EphyWebExtensionProxy but disconnected from the EphyEmbedShell.)
Comment 10 Carlos Garcia Campos 2014-09-11 07:06:55 UTC
Comment on attachment 285868 [details] [review]
ephy-web-view: Fix potential crashers

Thanks!
Comment 11 Bastien Nocera 2014-09-11 09:17:16 UTC
Committed to gnome-3-12 and master

Attachment 285868 [details] pushed as 3604801 - ephy-web-view: Fix potential crashers