Base hangs when trying to close it

classic Classic list List threaded Threaded
10 messages Options
julien2412 julien2412
Reply | Threaded
Open this post in threaded view
|

Base hangs when trying to close it

This post was updated on .
Hello,

On master only (I don't have the problem on 3.5 branch), Base hangs when I try to close it. I must select "Tables"/"Queries" or others to have the problem. If I just open a file and close, i don't have this problem.

I attached the result of "thread apply all bt" made after Ctrl-C during the hang.
bt.txt

gcc (Debian 4.6.2-12) 4.6.2
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b24~pre2-1)

--with-system-boost
--enable-symbols
--enable-ext-barcode
--enable-ext-diagram
--enable-ext-google-docs
--enable-ext-hunart
--enable-ext-nlpsolver
--enable-ext-ct2n
--enable-ext-numbertext
--enable-ext-oooblogger
--enable-ext-pdfimport
--enable-postgresql-sdbc
--enable-ext-presenter-console
--enable-ext-presenter-minimizer
--enable-ext-report-builder
--enable-ext-scripting-beanshell
--enable-ext-scripting-javascript
--enable-ext-typo
--enable-ext-validator
--enable-ext-watch-window
--enable-ext-wiki-publisher
--enable-dbus
--enable-graphite
--enable-evolution2
--enable-werror
--enable-debug
--enable-dbgutil
--enable-crashdump
--enable-kde4
--enable-dependency-tracking
--enable-online-update

Before opening a bug on tracker, I made some research and wonder if it could be the result of :
2eaa1422a032d6a7ffc72a2abeb3dd3e6248a263 or 81921bec4b81b7e3e87c24a6b4e3cfdd0cced47d but it's just some guess.
Edit after a good night of sleeping :-) : Perhaps these commits had just revealed an existing problem.

Any idea ? Does anybody reproduce this behaviour ?

Julien.
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: Base hangs when trying to close it

Hi Julien,

On Sun, 2012-03-04 at 12:02 -0800, julien2412 wrote:
> On master only (I don't have the problem on 3.5 branch), Base hangs when I
> try to close it. I must select "Tables"/"Queries" or others to have the
> problem. If I just open a file and close, i don't have this problem.

        Riight ... so this is down to the solar mutex being held in two threads
by the database code :-)

> I attached the result of "thread apply all bt" made after Ctrl-C during the
> hang.
> http://nabble.documentfoundation.org/file/n3798832/bt.txt bt.txt

        Threads 1 and 2 are deadlocking over this during the join. The question
is - why does thread 1 still hold the solar mutex: prolly just because
it's an occupational hazard :-)

        The question is (given the fragile pile of poorly done threading code),
combined with the amazing bus-load of superstitious mutexes all around
the place, how best to fix it.

        I would say that the framework / UNO code -should- have no need of
holding the solar mutex, so ... I would be -tempted- to poke at:

        framework/source/dispatch/closedispatcher.cxx

        and split out the impl_asyncCallback thing into two pieces, one of
which is the LINK that we Post (and get called back into) from VCL. As
VCL calls us the solar mutex is locked, so we need in that version to
have a (brave):

        SolarMutexReleaser aReleaser;

        or somesuch around the call to what was the impl_asyncCallback.

        Hopefully, that will drop the (probably) un-necessary, and un-expected
solar mutex there, and - with luck, won't reveal yet more hidden nasties
inside the framework / dbaccess code.

        Any chance you could try that out ?

        Many thanks,

                Michael.


--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
julien2412 julien2412
Reply | Threaded
Open this post in threaded view
|

Re: Base hangs when trying to close it

Hi Michael,

I'm just a C++ beginner (and think i'll still be for years), it's far beyond my few skills sorry :-(
Now if someone propose a patch I can try to test again the closing of base.

Julien.
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: Base hangs when trying to close it


On Mon, 2012-03-05 at 12:56 -0800, julien2412 wrote:
> I'm just a C++ beginner (and think i'll still be for years), it's far beyond
> my few skills sorry

        Hah ! you're doing really well for a beginner :-)

> Now if someone propose a patch I can try to test again the closing of base.

        The attached might work, input / testing appreciated :-) particularly
of the other component's exit, and the results of 'make check' before
and after.

        Thanks,

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

0001-attempt-fix-of-hang-on-base-close-due-to-solarmutex-.patch (2K) Download Attachment
julien2412 julien2412
Reply | Threaded
Open this post in threaded view
|

Re: Base hangs when trying to close it

Michael Meeks-2 wrote
On Mon, 2012-03-05 at 12:56 -0800, julien2412 wrote:
        The attached might work, input / testing appreciated :-) particularly
of the other component's exit, and the results of 'make check' before
and after.
"make check" failed before I git update (and so didn't retrieve yet your commit which includes a possible fix).
I had this :
No core dump at
/home/julien/compile-libreoffice/libo/workdir/unxlngx6/JunitTest/sw_unoapi/user,
to create core dumps (and stack traces)
for crashed soffice instances, enable core dumps with:

    ulimit -c unlimited

E
Time: 341,824
There was 1 failure:
1) test(org.openoffice.test.UnoApiTest)
java.lang.AssertionError:
     at org.openoffice.test.UnoApiTest.test(UnoApiTest.java:45)

FAILURES!!!
Tests run: 1,  Failures: 1

see full error log at
/home/julien/compile-libreoffice/libo/workdir/unxlngx6/JunitTest/sw_unoapi/done.log
to rerun just this failed test without all others, run:

     make
/home/julien/compile-libreoffice/libo/workdir/unxlngx6/JunitTest/sw_unoapi/done

cd into the module dir to run the tests faster
Or to do interactive debugging, run two shells with (Linux only):

     make debugrun
     make gb_JunitTest_DEBUGRUN=T
/home/julien/compile-libreoffice/libo/workdir/unxlngx6/JunitTest/sw_unoapi/done

make[1]: ***
[/home/julien/compile-libreoffice/libo/workdir/unxlngx6/JunitTest/sw_unoapi/done]
Erreur 1
make: *** [subsequentcheck] Erreur 2

done.log.zip

Of course, it's a different thing.

Now :
- should I file a bug for initial problem (or is too late because you patch fixes it) ?
- if i git update, is it useful to run make check whereas I've got already an error (and so i should first try to fix this error) ?

Julien.
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

Re: Base hangs when trying to close it

Hi Julien,

On Tue, 2012-03-06 at 04:38 -0800, julien2412 wrote:
> "make check" failed before I git update (and so didn't retrieve yet your
> commit which includes a possible fix).

        :-) so - I didn't commit the patch I sent you, I'd love some testing /
feedback though.

> Of course, it's a different thing.

        Right :-) of course, did the patch fix the bug for you though ?

> - should I file a bug for initial problem (or is too late because
> you patch fixes it) ?

        Until we get a patch that works, it's still there.

> - if I git update, is it useful to run make check whereas I've got
> already an error (and so i should first try to fix this error) ?

        Not really, fixing 'make check' is fairly non-trivial :-)

        Thanks !

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
julien2412 julien2412
Reply | Threaded
Open this post in threaded view
|

Re: Base hangs when trying to close it

Michael Meeks-2 wrote
> "make check" failed before I git update (and so didn't retrieve yet your
> commit which includes a possible fix).
        :-) so - I didn't commit the patch I sent you, I'd love some testing /
feedback though.
Hi Michael,

Sorry, I thought http://cgit.freedesktop.org/libreoffice/core/commit/?id=5b2cb23c429e1be1099008473770c634ce96c969 was your commit, my mistake.

Michael Stahl created a tracker here : https://bugs.freedesktop.org/show_bug.cgi?id=47021.
Now we'll be able to keep on the investigation on bugzilla as you had suggested.

Thank you both of you !

Julien.
Michael Stahl-2 Michael Stahl-2
Reply | Threaded
Open this post in threaded view
|

[REVIEW][3-5] disarm bogus unoapi XPropertySet test

In reply to this post by julien2412
On 06/03/12 13:38, julien2412 wrote:
> see full error log at
> /home/julien/compile-libreoffice/libo/workdir/unxlngx6/JunitTest/sw_unoapi/done.log

> http://nabble.documentfoundation.org/file/n3803458/done.log.zip done.log.zip

your log says that the XPropertySet test for an SwXTextSection failed:

> ***** State for sw.SwXTextSection::com::sun::star::beans::XPropertySet ******
> [sw.SwXTextSection::com::sun::star::beans::XPropertySet::setPropertyValue()] is testcode: [setPropertyValue()] - PASSED.FAILED

specifically setting this property:

> LOG> setting property 'LinkRegion' failed

looking at my log file for this test, the properties are tested in a
completely different order, and setting the LinkRegion doesn't fail for
me; thus i conclude that this unoapi test framework tests properties in
a random order and expects that to actually work, which is yet more
evidence to back the hypothesis that unoapi tests are completely
braindamaged.

so i've decided to disable the check that the value of the property is
actually different after calling setPropertyValue:

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

please somebody review and apply it to libreoffice-3-5 as well.

> Of course, it's a different thing.
>
> Now :
> - should I file a bug for initial problem (or is too late because you patch
> fixes it) ?

i've filed fdo#47021 since the patch doesnt fix it :)

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks-2 Michael Meeks-2
Reply | Threaded
Open this post in threaded view
|

[PUSHED][3-5] disarm bogus unoapi XPropertySet test


On Wed, 2012-03-07 at 11:24 +0100, Michael Stahl wrote:
> looking at my log file for this test, the properties are tested in a
> completely different order, and setting the LinkRegion doesn't fail for
> me; thus i conclude that this unoapi test framework tests properties in
> a random order and expects that to actually work, which is yet more

        Ooh - a nasty randomness that causes some build to fail and others to
succeed ? :-)

> evidence to back the hypothesis that unoapi tests are completely
> braindamaged.

        Lol ;-)

> so i've decided to disable the check that the value of the property is
> actually different after calling setPropertyValue:

        No doubt sberg will have some thoughts when he gets back from vacation.

> http://cgit.freedesktop.org/libreoffice/core/commit/?id=73867da36960adf8b79ff34c7094c63aa5a05940
>
> please somebody review and apply it to libreoffice-3-5 as well.

        Pushed, thanks ! :-)

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
anwen anwen
Reply | Threaded
Open this post in threaded view
|

Re: Base hangs when trying to close it

In reply to this post by Michael Meeks-2
I am wondering if it is possible to release SolarMutex when I develop an extension for LibreOffice. I have a similar problem when I developing a Calc extension. Is there another method since this patch is reverted from release 3.6.0?

Thank you.

Michael Meeks-2 wrote
On Mon, 2012-03-05 at 12:56 -0800, julien2412 wrote:
> I'm just a C++ beginner (and think i'll still be for years), it's far beyond
> my few skills sorry

        Hah ! you're doing really well for a beginner :-)

> Now if someone propose a patch I can try to test again the closing of base.

        The attached might work, input / testing appreciated :-) particularly
of the other component's exit, and the results of 'make check' before
and after.

        Thanks,

                Michael.

--
[hidden email]  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice