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 721589 - Epiphany crashes when launched from URL in external program twice in quick succession
Epiphany crashes when launched from URL in external program twice in quick su...
Status: RESOLVED OBSOLETE
Product: epiphany
Classification: Core
Component: General
3.10.x (obsolete)
Other Linux
: Normal critical
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 722766 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-01-05 18:00 UTC by Michael Catanzaro
Modified: 2014-06-02 02:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Catanzaro 2014-01-05 18:00:14 UTC
* With Epiphany closed, click on a URL in some program, maybe an email in Evolution or a page link in an About Dialog.
* Hope it doesn't crash, because it does roughly half the time.
* Stack trace available downstream [1] [2]

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1030727
[2] https://retrace.fedoraproject.org/faf/reports/215055/
Comment 1 Claudio Saavedra 2014-01-07 18:50:52 UTC
Looks like a race condition? Somewhere the database is being accessed simultaneously:

        msg = 0x7f7d140133d0 "Could not detect table existence: database is locked"
        msg_alloc = 0x7f7d140133d0 "Could not detect table existence: database is locked"
Comment 2 Claudio Saavedra 2014-01-07 18:52:05 UTC
Michael, are you sure ephy is really closed? It might be already running as the shell search provider.
Comment 3 Claudio Saavedra 2014-01-07 18:55:38 UTC


Thread 1 (Thread 0x7f7d65913700 (LWP 6758))

  • #0 g_logv
    at gmessages.c line 989
  • #1 g_log
    at gmessages.c line 1025
  • #2 ephy_sqlite_connection_table_exists
    at ephy-sqlite-connection.c line 176
  • #3 ephy_history_service_initialize_hosts_table
    at ephy-history-service-hosts-table.c line 34
  • #4 run_history_service_thread
    at ephy-history-service.c line 375
  • #5 g_thread_proxy
    at gthread.c line 798
  • #6 start_thread
    at pthread_create.c line 309
  • #7 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 111

Comment 4 Michael Catanzaro 2014-01-07 19:20:16 UTC
(In reply to comment #2)
> Michael, are you sure ephy is really closed? It might be already running as the
> shell search provider.

It probably is running actually; I only meant "there are no windows open."  I don't THINK this ever occurs if Epiphany already has an open window. (Could be wrong about that, though.)
Comment 5 Michael Catanzaro 2014-01-07 19:24:25 UTC
(In reply to comment #0)
> * Hope it doesn't crash, because it does roughly half the time.

That was an overestimate; I can't seem to reproduce this at all right now....
Comment 6 Michael Catanzaro 2014-01-08 03:03:53 UTC
(In reply to comment #4)
> 
> It probably is running actually; I only meant "there are no windows open."  I
> don't THINK this ever occurs if Epiphany already has an open window. (Could be
> wrong about that, though.)

It can crash when there is an Epiphany window open.  Sorry about that....
Comment 7 Michael Catanzaro 2014-01-22 14:32:54 UTC
Mike Gratton found a reproducer in Bug #722766:

"when Ephy is the default browser, from an external
program such as an email client, clicking two links in simultaneously results
in one being successfully loaded, and one instance of the spawned Ephy binary
crashing. Sounds like a sqlite locking issue to me."
Comment 8 Michael Catanzaro 2014-01-22 14:33:35 UTC
*** Bug 722766 has been marked as a duplicate of this bug. ***
Comment 9 Michael Gratton 2014-01-22 23:12:04 UTC
Yeah, to clarify - this occurs when there is an existing instance of Ephy running, and _more than one_ additional instances of Ephy are launched with URL arguments to be loaded at the same time. I'm not sure if I recall seeing the primary instance ever crash - it always seems to be one of the additional ones with URL args.
Comment 10 Michael Catanzaro 2014-01-23 04:02:24 UTC
So I guess in ephy-sqlite-connection.c:132, sqlite3_prepare_v2() returns SQLITE_BUSY (or perhaps SQLITE_LOCKED -- this is just a guess; I have not reproduced in gdb), but we were only expecting SQLITE_OK, so we then intentionally crash by calling g_error() in ephy_sqlite_connection_table_exists().

We should loop on the sqlite3 calls until they return real failure codes. I think 'while (sqlite3_whatever() != SQLITE_BUSY)' is typical?  Hopefully this class is never used from the UI thread?
Comment 11 Michael Gratton 2014-01-23 06:37:29 UTC
More to the point - why are such processes starting a history service when all it needs to do is notify the existing Ephy process and then exit?
Comment 12 Claudio Saavedra 2014-01-23 10:28:56 UTC
Is this also happening in the master branch?
Comment 13 Claudio Saavedra 2014-01-23 10:30:06 UTC
(In reply to comment #10)

> We should loop on the sqlite3 calls until they return real failure codes. I
> think 'while (sqlite3_whatever() != SQLITE_BUSY)' is typical?  Hopefully this
> class is never used from the UI thread?

No, it is not meant to be used from the main thread. The history service runs all sqlite3 calls in a dedicated thread.
Comment 14 Michael Catanzaro 2014-01-23 15:32:52 UTC
(In reply to comment #12)
> Is this also happening in the master branch?

In master, Epiphany does not crash anymore, but it doesn't work either: clicking on two links in close succession results in only one of them being opened.
Comment 15 Claudio Saavedra 2014-01-24 10:09:00 UTC
(In reply to comment #14)
> (In reply to comment #12)
> > Is this also happening in the master branch?
> 
> In master, Epiphany does not crash anymore,

In that case I'm not very keen in spending time trying to fix this in gnome-3-10, as clicking twice in quick doesn't strike me as a common action…

> but it doesn't work either:
> clicking on two links in close succession results in only one of them being
> opened.

That would be a different bug then, and a low priority one for similar reasons.
Comment 16 Michael Catanzaro 2014-01-24 21:30:33 UTC
> > (In reply to comment #12)
> > > Is this also happening in the master branch?
> > 
> > In master, Epiphany does not crash anymore,
> 
> In that case I'm not very keen in spending time trying to fix this in
> gnome-3-10, as clicking twice in quick doesn't strike me as a common action…

OK, but to be clear, you don't have to click twice on the same link (which would indeed be quite uncommon): more likely, you have a list of links in your email and want to load them all.
Comment 17 Michael Gratton 2014-01-25 02:15:54 UTC
(In reply to comment #16)
> (In reply to comment #15)
> > In that case I'm not very keen in spending time trying to fix this in
> > gnome-3-10, as clicking twice in quick doesn't strike me as a common action…
> 
> OK, but to be clear, you don't have to click twice on the same link (which
> would indeed be quite uncommon): more likely, you have a list of links in your
> email and want to load them all.

Yep, exactly. This happens to me every day, it's quite frustrating having only a fraction of the links I clicked on actually loading.

That master doesn't crash and now rather silently fails will make it more annoying, since at least when the Ubuntu crash handler pops up saying "The application Epiphany has crashed..." it reminds me to go back, undelete the email, find which links I was interested in, compare them to those that actually loaded, and then click - wait - click - wait - etc.
Comment 18 Michael Catanzaro 2014-01-29 23:07:53 UTC
I have the following situation:

* Epiphany and Evolution both open on one workspace
* No other Epiphany windows open

Every time I click a link in Evolution, a new instance of Epiphany is spawned and crashes with this stacktrace. It's not possible to open any link, even when opening only one at a time: Epiphany has somehow gotten itself into a state where it is guaranteed to crash.

After a few minutes, opening links started working fine again. I don't know how to reproduce this. The last time this happened to me was over a week ago.  I didn't realize until now it was the same crash.
Comment 19 Michael Gratton 2014-01-29 23:41:45 UTC
How many epiphany processes were actually running at the time? What did "ps -ef | grep epip" or similar show?
Comment 20 Michael Catanzaro 2014-01-30 01:57:39 UTC
I'll try that if it happens again.
Comment 21 Michael Catanzaro 2014-06-02 02:21:58 UTC
This is fixed in 3.12.