Bug 100412 - gtk3 Assertion failed error when creating report with wizard
Summary: gtk3 Assertion failed error when creating report with wizard
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Stephan Bergmann
URL:
Whiteboard: target:5.3.0 target:5.2.0.1
Keywords: haveBacktrace
: 99745 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-15 18:54 UTC by Julien Nabet
Modified: 2016-10-17 18:39 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with symbols (16.28 KB, text/plain)
2016-06-15 18:54 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Nabet 2016-06-15 18:54:31 UTC
Created attachment 125678 [details]
bt with symbols

On pc Debian x86-64 with master sources updated today (38971bd6543143df41192b0552c51a8119d452a0) + enable-dbgutil and render=gtk3, I got a crash when I try to create a report with wizard

Steps to reproduce:
1) Launch Base
2) Create hsqldb db file
3) Click Reports panel
4) Click "Use Wizard to create Report..."
=> Crash
Comment 1 Julien Nabet 2016-06-15 18:59:32 UTC
Obviously I couldn't check if tdf#100325 was ok since I got another crash.
Comment 2 Michael Stahl (allotropia) 2016-06-15 20:06:22 UTC
can't reproduce this on Fedora 23

Assertion `yieldCount == 0' failed.

#4  0x00002aaac8606fd8 in GtkYieldMutex::ThreadsLeave (this=0x6d3dc0) at /home/julien/lo/libreoffice/vcl/unx/gtk3/../gtk/gtkinst.cxx:312
#5  0x00002aaac86061fb in GdkThreadsLeave () at /home/julien/lo/libreoffice/vcl/unx/gtk3/../gtk/gtkinst.cxx:58
#6  0x00002aaac8ca8375 in gtk_clipboard_wait_for_contents () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

this #32 has a SolarMutexGuard

#32 0x00002aaac8605493 in call_userEventFn (data=0x6e4780) at /home/julien/lo/libreoffice/vcl/unx/gtk3/gtk3gtkdata.cxx:829
#33 0x00002aaaacc9105a in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00002aaaacc91400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00002aaaacc91722 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#36 0x00002aaac8ca837e in gtk_clipboard_wait_for_contents () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0

so #36 must have GdkThreadsLeave?

lets see ... dnf debuginfo-install gtk3 ...
/usr/src/debug/gtk+-3.18.9/gtk/gtkclipboard.c

  if (g_main_loop_is_running (results.loop))
    {
      gdk_threads_leave ();
      g_main_loop_run (results.loop);
      gdk_threads_enter ();
    }

so it looks like the GtkYieldMutex isn't prepared for this sort of thing,
possibly a regression from

commit 07157e644fa9666850767ff6bd54c1511167a0a2
Author:     Stephan Bergmann <sbergman@redhat.com>
AuthorDate: Thu Feb 11 17:34:35 2016 +0100

    Keep track of ThreadsEnter/Leave acquire counts per thread
Comment 3 Stephan Bergmann 2016-06-16 07:54:41 UTC
Thanks for analysing!  So ThreadsLeave/-Enter can be called recursively, so <https://cgit.freedesktop.org/libreoffice/core/commit/?id=07157e644fa9666850767ff6bd54c1511167a0a2> "Keep track of ThreadsEnter/Leave acquire counts per thread" should have kept (per-thread) stacks of yield counts.
Comment 4 Commit Notification 2016-06-16 11:10:34 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ef1dc167cd3339b1e92d8e18b1f5c3c2cfbec6ab

tdf#100412: Cope with recursive gdk_threads_enter/_leave

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2016-06-16 12:15:00 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=81ed73d0867e0322b450314c474fd01404671f0e&h=libreoffice-5-2

tdf#100412: Cope with recursive gdk_threads_enter/_leave

It will be available in 5.2.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Julien Nabet 2016-06-16 19:06:50 UTC
With master sources updated today (5bf3ae663a2189e37959235cda8c6a4051e10a1a), it's ok now.
Thank you!
Comment 7 Maxim Monastirsky 2016-10-17 18:39:58 UTC
*** Bug 99745 has been marked as a duplicate of this bug. ***