Bug 111970 - assertion at dbggui.cxx:47, solar mutex locked
Summary: assertion at dbggui.cxx:47, solar mutex locked
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Stahl (CIB)
URL:
Whiteboard: target:6.0.0
Keywords: haveBacktrace
Depends on:
Blocks: Assert
  Show dependency treegraph
 
Reported: 2017-08-22 13:47 UTC by Terrence Enger
Modified: 2017-09-02 20:46 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
output from bibisect in daily Linux dbgutil repository (2.29 KB, text/plain)
2017-08-22 13:47 UTC, Terrence Enger
Details
typescript of make debugrun (56.24 KB, text/plain)
2017-08-22 13:50 UTC, Terrence Enger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Terrence Enger 2017-08-22 13:47:43 UTC
Created attachment 135732 [details]
output from bibisect in daily Linux dbgutil repository

STR

(1) Open attachment to tdf#109353, Inventar_Physik.odb.
(2) Open form Gegenstand
(3) Drop down the drop-down list Raum
(4) Click second entry, "B 005".  Program fails with terminal output
    (lines rewrapped):

        soffice.bin:
            /home/vmiklos/git/libreoffice/master/vcl/source/app/dbggui.cxx:47:
            void ImplDbgTestSolarMutex():
            Assertion `ImplGetSVData()->mpDefInst->CheckYieldMutex() &&
                          "SolarMutex not locked"
                      ' failed.
        Application Error
        Fatal exception: Signal 6

Working on debian-stretch in the daily Linux dbgutil bibisect
repository, I find that the bug started somewhere in the 55 commits to
master:

          commit    date        s-h
          --------  ----------  --------
    good  478c063d  2017-06-12  6a241608  
    bad   00bcd29f  2017-06-13  a1ace08b

In this range, this commit message mentions Mutex:

    commit a7532d8f061986c2e828df32f47f1fee1a339a14
    Author: Arnaud Versini <arnaud.versini@gmail.com>
    Date:   Mon Jun 5 16:12:27 2017 +0200

        Remove VCLExternalSolarLock and IMutex.
    
        Next step is to remove OContextEntryGuard.
    
        Change-Id: I9460fb67fba6f3bfb3c809b730c33f38d225a64e
        Reviewed-on: https://gerrit.libreoffice.org/38411
        Tested-by: Jenkins <ci@libreoffice.org>
        Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Comment 1 Terrence Enger 2017-08-22 13:50:17 UTC
Created attachment 135733 [details]
typescript of make debugrun

line  what
----  --------------------------
  36  run
 246  assertion
 252  info threads
 273  thread apply all backtrace
 512  backtrace full

This is from a local-build LibreOffice, commit 461ba1db, 2017-08-04
22:57 UTC, configured:

    CC=ccache /usr/bin/gcc
    CXX=ccache /usr/bin/g++
    --enable-option-checking=fatal
    --enable-dbgutil
    --enable-debug
    --without-system-postgresql
    --without-myspell-dicts
    --with-extra-buildid
    --without-doxygen
    --with-external-tar=/home/terry/lo_hacking/git/src
    --without-package-format

built and running on debian-stretch.
Comment 2 Terrence Enger 2017-08-22 13:54:25 UTC
I observed, perhaps coincidentally, that the "good" versions I tested
while bibisecting each did not show values in the drop-down boxes or
in the opened drop-down lists.  The "bad" versions did show values.
Comment 3 Terrence Enger 2017-08-22 15:33:45 UTC
Whoops.  The tale is more complicated: I managed to raise the same
assertion in drop-down list Regal in earlier version dbgutil
2017-05-19.

In the -till53 dbgutil repository, I narrowed the appearance of the
assertion on drop-down list Regal to the 64 source commits
42062d99..0d2797fd.  In that range, I see

    commit c00d8271ba443c4f0acf657c226eea4824597f95
    Author: Michael Meeks <michael.meeks@collabora.com>
    Date:   Tue Oct 18 21:38:34 2016 +0100

        vcl: assert solar mutex is held for various timer / scheduler ops.
    
        Bringing paranoia to some source-code near you.
    
        ...

although, funnily enough, dbggui.cxx:47 is git blame'd to 2014.

I conclude that the problem is somewhere else, and that my good/bad
determinations while trying to bibisect are mere noise.  I am removing
keywords bibisected, regression.
Comment 4 Michael Stahl (CIB) 2017-09-01 21:57:44 UTC
i think this assertion doesn't happen any more on master as the Scheduler no longer uses SolarMutex.

but the locking in that FmXFormShell class is still a disaster so i've hit it with the big hammer.
Comment 5 Commit Notification 2017-09-01 21:58:42 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#111970 svx: use SolarMutex for locking in FmXFormShell

It will be available in 6.0.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 6 Terrence Enger 2017-09-02 20:46:27 UTC
Indeed the problem is gone on debian-stretch in some recent versions
from the daily Linux dbgutil bibisect repository.  I am setting status
VERIFIED FIXED.