Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

classic Classic list List threaded Threaded
15 messages Options
slacka slacka
Reply | Threaded
Open this post in threaded view
|

Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

Noel,
Ever since:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=9cceba9a
make DBG_TESTSOLARMUTEX available in assert builds

Windows builds with "--enable-debug" are failing with the following error:

D:/core/vcl/source/app/svmain.cxx(371): error C3861: 'DbgGUIInitSolarMutexCheck': identifier not found
make[1]: *** [D:/core/solenv/gbuild/LinkTarget.mk:293: D:/core/workdir/CxxObject/vcl/source/app/svmain.o] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:286: build] Error 2


Should your change be limited to Linux or something else going on here?

-Luke


_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Noel Grandin-3 Noel Grandin-3
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

On 2018/07/31 5:54 AM, Luke Benes wrote:

> Noel,
> Ever since:
> https://cgit.freedesktop.org/libreoffice/core/commit/?id=9cceba9a
> make DBG_TESTSOLARMUTEX available in assert builds
>
> Windows builds with "--enable-debug" are failing with the following error:
>
> D:/core/vcl/source/app/svmain.cxx(371): error C3861: 'DbgGUIInitSolarMutexCheck': identifier not found
> make[1]: *** [D:/core/solenv/gbuild/LinkTarget.mk:293: D:/core/workdir/CxxObject/vcl/source/app/svmain.o] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make: *** [Makefile:286: build] Error 2
>


thanks, should be fixed with cba7acca97ac0245b93e27ba46351285fd7c5ff2,
was a simple oversight

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

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

In reply to this post by slacka
Noel,

That fix and subsequent fixes are not enough. Windows debug builds are still failing. Currently they fail on CppunitTest_services:


https://ci.libreoffice.org/job/lo_tb_master_win_dbg/18045/consoleFull#-1107669237d893063f-7f3d-4b7e-b56f-4e0f225817cd

/usr/bin/sh: line 1:  6252 Segmentation fault      ( PATH="C:\cygwin\home\tdf\lode\jenkins\workspace\lo_tb_master_win_dbg\instdir\program;C:\cygwin\home\tdf\lode\jenkins\workspace\lo_tb_master_win_dbg\instdir\program;C:\cygwin\home\tdf\lode\jenkins\workspace\lo_tb_master_win_dbg\workdir\LinkTarget\Library;C:\cygwin\home\tdf\lode\jenkins\workspace\lo_tb_master_win_dbg\workdir\UnpackedTarball\cppunit\src\cppunit\ReleaseDll;$PATH" PYTHONDONTWRITEBYTECODE=1 $W/LinkTarget/Executable/cppunittester.exe $W/LinkTarget/CppunitTest/test_services.dll --headless "-env:BRAND_BASE_DIR=file:///$S/instdir" "-env:BRAND_SHARE_SUBDIR=share" "-env:BRAND_SHARE_RESOURCE_SUBDIR=program/resource" "-env:UserInstallation=file:///$W/CppunitTest/services.test.user" "-env:CONFIGURATION_LAYERS=xcsxcu:file:///$I/share/registry xcsxcu:file:///$W/unittest/registry" "-env:UNO_TYPES=file:///$I/program/types.rdb file:///$I/program/types/offapi.rdb file:///$I/program/types/oovbaapi.rdb" "-env:UNO_SERVICES=file:///$W/Rdb/ure/services.rdb file:///$W/Rdb/services.rdb file:///$W/Rdb/pyuno.rdb" -env:URE_MORE_JAVA_TYPES=file:///$I/program/classes/unoil.jar -env:URE_INTERNAL_LIB_DIR=file:///$I/program -env:LO_LIB_DIR=file:///$I/program -env:LO_JAVA_DIR=file:///$I/program/classes --protector $W/LinkTarget/Library/unoexceptionprotector.dll unoexceptionprotector --protector $W/LinkTarget/Library/unobootstrapprotector.dll unobootstrapprotector --protector $W/LinkTarget/Library/vclbootstrapprotector.dll vclbootstrapprotector "-env:CPPUNITTESTTARGET=$W/CppunitTest/services.test" ) > $W/CppunitTest/services.test.log 2>&1

From Jenkins you can see that every tb_master_win_dbg build after

https://cgit.freedesktop.org/libreoffice/core/commit/?id=9cceba9a928cf3b3447f293020be2fe76c035ed5

fails. Release builds are fine. 
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

On Sun, 2018-08-05 at 16:48 +0000, Luke Benes wrote:
> Noel,
>
> That fix and subsequent fixes are not enough. Windows debug builds
> are still failing. Currently they fail on CppunitTest_services:

This is the bt...

#0  0x00007faf569074fd in ImplDbgTestSolarMutex() () at
/mnt/instdir/program/libvcllo.so
#1  0x00007faf56904df9 in vcl::EventPoster::~EventPoster() () at
/mnt/instdir/program/libvcllo.so
#2  0x00007faf4392b452 in (anonymous
namespace)::AutoRecovery::~AutoRecovery() () at
/mnt/instdir/program/libfwklo.so
#3  0x00007faf4392b589 in (anonymous
namespace)::AutoRecovery::~AutoRecovery() () at
/mnt/instdir/program/libfwklo.so
#4  0x00007faf5d03dfc8 in __run_exit_handlers () at /lib64/libc.so.6
#5  0x00007faf5d03e01a in  () at /lib64/libc.so.6
#6  0x00007faf5d023891 in __libc_start_main () at /lib64/libc.so.6
#7  0x000000000040337a in _start ()

so its clear its the teardown of the AutoRecovery singleton, and its
EventPoster object
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Noel Grandin-3 Noel Grandin-3
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

On 2018/08/05 10:32 PM, Caolán McNamara wrote:
> On Sun, 2018-08-05 at 16:48 +0000, Luke Benes wrote:
>> Noel,
>>
>> That fix and subsequent fixes are not enough. Windows debug builds
>> are still failing. Currently they fail on CppunitTest_services:
>
> This is the bt...
>


thanks for the bt caolan.

Should be fixed now with

https://cgit.freedesktop.org/libreoffice/core/commit/?id=2c3b5e0691322bcd541e3259eeb05df641ef5751
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
slacka slacka
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

Thanks Noel,
That last patch fixed the segfault, but the subsequent Unit Tests are still failing at:

[build CUT] cppuhelper_qa_misc
`anonymous namespace'::Test::testCatchThrow finished in: 10ms
D:/core/cppuhelper/qa/misc/test_misc.cxx:69:`anonymous namespace'::Test::testgetCaughtException
assertion failed
- Expression: bool(aSavedException)

`anonymous namespace'::Test::testgetCaughtException finished in: 160ms
D:/core/cppuhelper/qa/misc/test_misc.cxx(69) : error : Assertion
Test name: `anonymous namespace'::Test::testgetCaughtException
assertion failed
- Expression: bool(aSavedException)

Failures !!!
Run: 2   Failure total: 1   Failures: 1   Errors: 0

Error: a unit test failed, please do one of:
make CppunitTest_cppuhelper_qa_misc CPPUNITTRACE=TRUE # which is a shortcut for the following line
make CppunitTest_cppuhelper_qa_misc CPPUNITTRACE="'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/devenv.exe' /debugexe" # for interactive debugging in Visual Studio
make CppunitTest_cppuhelper_qa_misc CPPUNITTRACE="drmemory -free_max_frames 20" # for memory checking (install Dr.Memory first, and put it to your PATH)

You can limit the execution to just one particular test by:

make CppunitTest_cppuhelper_qa_misc CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params...

make[1]: *** [D:/core/solenv/gbuild/CppunitTest.mk:117: D:/core/workdir/CppunitTest/cppuhelper_qa_misc.test] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:286: build] Error 2

Do you have access to a Windows machine or do you me to gather any additional debug info for you?



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

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

On 07/08/18 06:28, Luke Benes wrote:
> [build CUT] cppuhelper_qa_misc
> `anonymous namespace'::Test::testCatchThrow finished in: 10ms
> D:/core/cppuhelper/qa/misc/test_misc.cxx:69:`anonymous
> namespace'::Test::testgetCaughtException
> assertion failed
> - Expression: bool(aSavedException)

That's a newly introduced test
(<https://cgit.freedesktop.org/libreoffice/core/commit/?id=6ddecf61ecada646fbd6f8809270d47289727e8a>
"fillUnoException not working on std::rethrow_exception exceptions"),
testing C++11 std::current_exception and std::rethrow_exception (which
started to get used in our code base recently).

What exact version of MSVC are you using (see the first line reported by
`cl /?`)?  Is that LO build configured --enable-debug or --enable-dbgutil?
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
slacka slacka
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

Here is my build environment:

$ cat autogen.input
--enable-debug

$ cl /?
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x86

Do you need anything else?



--
Sent from: http://document-foundation-mail-archive.969070.n3.nabble.com/Dev-f1639786.html
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
slacka slacka
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

In reply to this post by sberg
Here is my build environment:

$ cat autogen.input
--enable-debug

$ cl /?
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x86

Do you need anything else? I'll try reverting Noel's patches to check if
that is the cause or not.









--
Sent from: http://document-foundation-mail-archive.969070.n3.nabble.com/Dev-f1639786.html
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

In reply to this post by slacka
On 07/08/18 17:48, slacka wrote:
> Here is my build environment:
>
> $ cat autogen.input
> --enable-debug
>
> $ cl /?
> Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x86

Isn't that a completely outdated version?  According to
<https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering>,
17.xx would be Visual Studio 2012, but on master we only support Visual
Studio 2017 now.  And my Visual Studio 2017's `cl /?` reports
19.00.24215.1.  (Please make sure to actually execute cl from the Visual
Studio 2017 installation.)

> Do you need anything else?

As we speak, I happen to run into your CppunitTest_cppuhelper_qa_misc
failure with my MSVC build (with latest Visual Studio 2017, see above)
too, will investigate.  (The test currently only runs (late) during
`make check`, see <https://gerrit.libreoffice.org/#/c/58696/> "No need
for CppunitTest_cppuhelper_qa_misc to be a subsequentcheck".)
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

On 07/08/18 18:14, Stephan Bergmann wrote:

> On 07/08/18 17:48, slacka wrote:
>> Here is my build environment:
>>
>> $ cat autogen.input
>> --enable-debug
>>
>> $ cl /?
>> Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x86
>
> Isn't that a completely outdated version?  According to
> <https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering>,
> 17.xx would be Visual Studio 2012, but on master we only support Visual
> Studio 2017 now.  And my Visual Studio 2017's `cl /?` reports
> 19.00.24215.1.  (Please make sure to actually execute cl from the Visual

sorry, "19.14.26433" is what mine reports

> Studio 2017 installation.)
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
slacka slacka
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

Sorry I was in the wrong folder: this is the correct one

Microsoft (R) C/C++ Optimizing Compiler Version 19.14.26433 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.



--
Sent from: http://document-foundation-mail-archive.969070.n3.nabble.com/Dev-f1639786.html
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

In reply to this post by sberg
On 07/08/18 18:14, Stephan Bergmann wrote:
> As we speak, I happen to run into your CppunitTest_cppuhelper_qa_misc
> failure with my MSVC build (with latest Visual Studio 2017, see above)
> too, will investigate.  (The test currently only runs (late) during
> `make check`, see <https://gerrit.libreoffice.org/#/c/58696/> "No need
> for CppunitTest_cppuhelper_qa_misc to be a subsequentcheck".)

Mike is working on a fix at <https://gerrit.libreoffice.org/#/c/58730/>
"Don't break __CxxDetectRethrow contract"
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Kaganski Mike Kaganski Mike
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

Hi!

On 8/8/2018 3:56 PM, Stephan Bergmann wrote:
> On 07/08/18 18:14, Stephan Bergmann wrote:
>> As we speak, I happen to run into your CppunitTest_cppuhelper_qa_misc
>> failure with my MSVC build (with latest Visual Studio 2017, see above)
>> too, will investigate.  (The test currently only runs (late) during
>> `make check`, see <https://gerrit.libreoffice.org/#/c/58696/> "No need
>> for CppunitTest_cppuhelper_qa_misc to be a subsequentcheck".)
>
> Mike is working on a fix at <https://gerrit.libreoffice.org/#/c/58730/>
> "Don't break __CxxDetectRethrow contract"

I seem to be unable to come with a solution, so I decided to summarize
my findings here.

So, with commit 6ddecf61ecada646fbd6f8809270d47289727e8a, Caolán has
uncovered a hidden bug that must have been there for some time. Function
cpp_call() in bridges/source/cpp_uno/msvc_win32_*/uno2cpp.cxx uses SEH
(__try-__except statement) to guard the called method;
CPPU_CURRENT_NAMESPACE::mscx_filterCppException() is used there as the
__except expression; and the latter uses CRT's *internal*
__CxxDetectRethrow() function to check if the handled C++ exception is
being re-thrown. __CxxDetectRethrow() checks the opaque exception
descriptor passed by pointer (which has internal EHExceptionRecord*
type), and basically detects if two conditions are true: the exception
is C++ exception (using PER_IS_MSVC_EH macro), and that it has no
exception information (using PER_PTHROW macro); see comment in
ExFilterRethrow in MSVCRT's crt/src/vcruntime/frame.cpp for the same check.

Unfortunately, the function __CxxDetectRethrow() modifies global state:
it increments an internal variable (__ProcessingThrow++), which is used
throughout CRT's exception handling code to detect that unwinding is in
progress when its value is non-zero (one comment says "we are
unwinding... possibly called from a dtor()"). In that case, e.g.,
std::current_exception() returns empty exception_ptr (related code is in
CRT's __ExceptionPtr::_CurrentException() method). As documented in the
beginning of the crt/src/vcruntime/mgdframe.cpp, where
__CxxDetectRethrow() is defined, the function is used internally when
C++ exceptions are handled in COM+. It is designed to be used in
specific conditions, and after some other companion functions have been
called (specifically, __CxxExceptionFilter and
__CxxRegisterExceptionObject); finally, __CxxUnregisterExceptionObject
must be called. All the mentioned functions also modify
__ProcessingThrow; they also modify other internal variables (global
state), allocate and release memory; and __CxxUnregisterExceptionObject
also destructs the exception object.

All of the described complexity made me unable to come with a proper way
to call those functions: they expect some state of SEH; they modify the
state; not calling __CxxExceptionFilter leads to still unpaired
decrements of __ProcessingThrow; trying to finally call
__CxxUnregisterExceptionObject destroys the object that we tested in our
mscx_filterCppException, which leads to use-after-delete. So the problem
now remains: it's not enough to just revert the Caolán's commit
mentioned above, since we obviously break CRT state now and then, and
the revert would just hide this, not solve.

The related code (using __CxxDetectRethrow to check for the exception
being rethrown) was introduced with commit
37d3cdd8d280f509ffa37e47c4706213f4dcda7c from 2003; but I don't know if
the function already had current behaviour back then.

Just for reference, I paste here the reference code given in
crt/src/vcruntime/mgdframe.cpp as the example of how the functions work
together:

////////////////////////////////////////////////////////////////////////////////
// Model of C++ eh in COM+
//
// void func()
// {
//     try {
//         TryBody();
//     } catch (cpp_object o)
//     {
//         CatchOBody();
//     } catch (...)
//     {
//         CatchAllBody();
//     }
// }
//
// Turns into this:
//
//
// void func()
// {
//     int rethrow;
//     // One per try block
//     int isCxxException;
//     // One per catch(...)
//     __try {
//         TryBody();
//     }
//     __except(__CxxExceptionFilter(exception,
//                                   typeinfo(cpp_object),
//                                   flags,
//                                   &o))
//     // This is how it's done already
//     {
//     // Begin catch(object) prefix
//     char *storage = _alloca(__CxxQueryExceptionSize());
//     rethrow = false;
//     __CxxRegisterExceptionObject(exception,
//                                  storage);
//     __try {
//         __try {
//             // End catch(object) prefix
//             CatchOBody();
//             // Begin catch(object) suffix
//         } __except(rethrow = __CxxDetectRethrow(exception),
//                    EXCEPTION_CONTINUE_SEARCH)
//         {}
//     }
//     __finally
//     {
//         __CxxUnregisterExceptionObject(storage,
//                                        rethrow);
//     }
//     // End catch(object) suffix
//     }
//     __except(1)
//     {
//         // Begin catch(...) prefix
//         char *storage = _alloca(__CxxQueryExceptionSize());
//         rethrow = false;
//         isCxxException = __CxxRegisterExceptionObject(exception,
//                                                       storage);
//         __try
//         {
//             __try
//             {
//             // End catch(...) prefix
//             CatchAllBody();
//             // Begin catch(...) suffix
//         } __except(rethrow = __CxxDetectRethrow(exception),
//                    EXCEPTION_CONTINUE_SEARCH)
//         {}
//     } __finally
//     {
//         if (isCxxException)
//         __CxxUnregisterExceptionObject(storage, rethrow);
//     }
//     // End catch(...) suffix
//     }
// }
//
////////////////////////////////////////////////////////////////////////////////

--
Best regards,
Mike Kaganski
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Kaganski Mike Kaganski Mike
Reply | Threaded
Open this post in threaded view
|

Re: Windows Debug builds failure: 'DbgGUIInitSolarMutexCheck': identifier not found

I forgot to mention that the problem with CppunitTest_cppuhelper_qa_misc
manifests itself because it happens to have two tests: testCatchThrow
first, which triggers the described behaviour and modifies global state,
and testgetCaughtException second, that tries to test exception handling
and fails because it's already broken at this stage. Trying to run only
the latter (using CPPUNIT_TEST_NAME) will succeed.

--
Best regards,
Mike Kaganski
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice