Issue 127967 - MacOS: Running via Java causes exception on MacOSX Mojave
Summary: MacOS: Running via Java causes exception on MacOSX Mojave
Status: CLOSED DUPLICATE of issue 127965
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 4.1.6
Hardware: Mac All
: P5 (lowest) Critical
Target Milestone: 4.2.0
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-20 15:12 UTC by ronyf
Modified: 2019-01-21 19:46 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Java program that creates an empty swriter document (source) (2.39 KB, text/plain)
2018-12-30 16:25 UTC, ronyf
no flags Details
Java program that creates an empty swriter document (binary, Java 1.6/6) (2.73 KB, application/x-java)
2018-12-30 16:26 UTC, ronyf
no flags Details
Crash info with Java stack traces (running Java 1.8.0_162-b12) that look useful. (13.94 KB, text/plain)
2018-12-31 14:49 UTC, ronyf
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description ronyf 2018-12-20 15:12:59 UTC
An observation that pertains to Apple only: interacting with AOO using the Java archives (juh.jar, unoil.jar, ridl.jar, jurt.jar) from Java now causes a runtime exception on Apple with Java 9. This used to work in the past (a simple application which creates a swriter document and enters text into it) and works on other platforms (tested successfully on Windows and Linux with AOO 4.1.6).

Not sure whether this is the Apple AOO or the Java responsibility (it used to work in the past years).

Here the trace of the exception (RexxDispatcher.java is the Java program that will invoke the ooRexx scripting engine which itself uses a Java bridge that interacts with AOO via Java):

    wu114215:test rony$ rexxj.sh OpenOfficeTest.rex 
    *CE> 2018-12-18 16:06:25.356 soffice[6648:119551] WARNING: NSWindow drag regions should only be
    invalidated on the Main Thread! This will throw an exception in the future. Called from (***CE> 	0   AppKit                              0x00007fff381bdccc -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 386
    CE> 	1   AppKit                              0x00007fff381bb07c -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1488
    CE> 	2   AppKit                              0x00007fff381baaa6 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
    CE> 	3   libvcl.dylib                        0x00000001118d5286 -[SalFrameWindow initWithSalFrame:] + 262
    CE> 	4   libvcl.dylib                        0x000000011160e273 _ZN12AquaSalFrame17initWindowAndViewEv + 643
    CE> 	5   libvcl.dylib                        0x000000011160deb7 _ZN12AquaSalFrameC2EP8SalFramem + 519
    CE> 	6   libvcl.dylib                        0x00000001115e93f0 _ZN15AquaSalInstance11CreateFrameEP8SalFramem + 48
    CE> 	7   libvcl.dylib                        0x000000011189f567 _ZN6Window8ImplInitEPS_lP16SystemParentData + 1159
    CE> 	8   libvcl.dylib                        0x0000000111823184 _ZN16ImplBorderWindow8ImplInitEP6WindowltP16SystemParentData + 404
    CE> 	9   libvcl.dylib                        0x00000001118234c5 _ZN16ImplBorderWindowC1EP6WindowP16SystemParentDatalt + 69
    CE> 	10  libvcl.dylib                        0x00000001118bef78 _ZN10WorkWindow8ImplInitEP6WindowlP16SystemParentData + 88
    CE> 	11  libvcl.dylib                        0x00000001118bf320 _ZN10WorkWindowC1EP6Windowl + 80
    CE> 	12  libootk.dylib                       0x00000001109420c0 _ZN11VCLXToolkit16ImplCreateWindowEPP10VCLXWindowRKN3com3sun4star3awt16WindowDescriptorEP6Windowl + 5712
    CE> 	13  libootk.dylib                       0x0000000110940454 _ZN11VCLXToolkit16ImplCreateWindowERKN3com3sun4star3awt16WindowDescriptorEl + 452
    CE> 	14  libootk.dylib                       0x00000001109407b4 _ZThn80_N11VCLXToolkit12createWindowERKN3com3sun4star3awt16WindowDescriptorE + 20
    CE> 	15  libfwk.dylib                        0x0000000113f2d84e _ZN9framework18TaskCreatorService28implts_createContainerWindowERKN3com3sun4star3uno9ReferenceINS3_3awt7XWindowEEERKNS6_9RectangleEh + 1022
    CE> 	16  libfwk.dylib                        0x0000000113f2cecc _ZN9framework18TaskCreatorService27createInstanceWithArgumentsERKN3com3sun4star3uno8SequenceINS4_3AnyEEE + 924
    CE> 	17  libfwk.dylib                        0x0000000113f2ecd2 _ZThn16_N9framework18TaskCreatorService27createInstanceWithArgumentsERKN3com3sun4star3uno8SequenceINS4_3AnyEEE + 18
    CE> 	18  libfwk.dylib                        0x0000000113e34591 _ZN9framework11TaskCreator10createTaskERKN3rtl8OUStringEh + 3089
    CE> 	19  libfwk.dylib                        0x0000000113efbd9a _ZN9framework7Desktop9findFrameERKN3rtl8OUStringEi + 778
    CE> 	20  libfwk.dylib                        0x0000000113efc3b2 _ZThn56_N9framework7Desktop9findFrameERKN3rtl8OUStringEi + 18
    CE> 	21  libfwk.dylib                        0x0000000113eb53ce _ZN9framework7LoadEnv16impl_loadContentEv + 766
    CE> 	22  libfwk.dylib                        0x0000000113eb0e56 _ZN9framework7LoadEnv12startLoadingEv + 438
    CE> 	23  libfwk.dylib                        0x0000000113eafef3 _ZN9framework7LoadEnv20loadComponentFromURLERKN3com3sun4star3uno9ReferenceINS3_5frame16XComponentLoaderEEERKNS5_INS3_4lang20XMultiServiceFactoryEEERKN3rtl8OUStringESJ_iRKNS4_8SequenceINS3_5beans13PropertyValueEEE + 227
    CE> 	24  libfwk.dylib                        0x0000000113efad37 _ZN9framework7Desktop20loadComponentFromURLERKN3rtl8OUStringES4_iRKN3com3sun4star3uno8SequenceINS7_5beans13PropertyValueEEE + 327
    CE> 	25  libfwk.dylib                        0x0000000113efae82 _ZThn24_N9framework7Desktop20loadComponentFromURLERKN3rtl8OUStringES4_iRKN3com3sun4star3uno8SequenceINS7_5beans13PropertyValueEEE + 18
    CE> 	26  libs5abi_uno.dylib                  0x0000000117d5aada _ZN7bridges7cpp_uno6shared25unoInterfaceProxyDispatchEP14_uno_InterfacePK24_typelib_TypeDescriptionPvPS7_PP8_uno_Any + 4042
    CE> 	27  libs5abi_uno.dylib                  0x0000000117d5a430 _ZN7bridges7cpp_uno6shared25unoInterfaceProxyDispatchEP14_uno_InterfacePK24_typelib_TypeDescriptionPvPS7_PP8_uno_Any + 2336
    CE> 	28  libs5abi_uno.dylib                  0x0000000117d59df0 _ZN7bridges7cpp_uno6shared25unoInterfaceProxyDispatchEP14_uno_InterfacePK24_typelib_TypeDescriptionPvPS7_PP8_uno_Any + 736
    CE> 	29  binaryurp.uno.dylib                 0x0000000118f17864 _ZNK9binaryurp15IncomingRequest13execute_throwEPNS_9BinaryAnyEPNSt3__16vectorIS1_NS3_9allocatorIS1_EEEE + 2068
    CE> 	30  binaryurp.uno.dylib                 0x0000000118f16b4b _ZNK9binaryurp15IncomingRequest7executeEv + 155
    CE> 	31  binaryurp.uno.dylib                 0x0000000118f1b7af request + 15
    CE> 	32  libuno_cppu.dylib.3                 0x000000010fb69d76 _ZN15cppu_threadpool8JobQueue5enterElh + 150
    CE> 	33  libuno_cppu.dylib.3                 0x000000010fb6a171 _ZN15cppu_threadpool14ORequestThread3runEv + 97
    CE> 	34  libuno_cppu.dylib.3                 0x000000010fb6a0ce cppu_requestThreadWorker + 14
    CE> 	35  libuno_sal.dylib.3                  0x000000010f5cd875 osl_setThreadTextEncoding + 309
    CE> 	36  libsystem_pthread.dylib             0x00007fff6801c305 _pthread_body + 126
    CE> 	37  libsystem_pthread.dylib             0x00007fff6801f26f _pthread_start + 70
    CE> 	38  libsystem_pthread.dylib             0x00007fff6801b415 thread_start + 13
    CE> )
    *CE> 2018-12-18 16:06:26.326 soffice[6648:119551] *** Terminating app due to uncaught exception
    'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from
    the Main Thread!'****CE> *** First throw call stack:*
    CE> (
    CE> 	0   CoreFoundation                      0x00007fff3aca2ecd __exceptionPreprocess + 256
    CE> 	1   libobjc.A.dylib                     0x00007fff66d5a720 objc_exception_throw + 48
    CE> 	2   AppKit                              0x00007fff3813bbe0 NSAlwaysMatchRequestedMaskOf1DefaultValueFunction + 0
    CE> 	3   libvcl.dylib                        0x00000001115e939f _ZN15AquaSalInstance8AnyInputEt + 191
    CE> 	4   libvcl.dylib                        0x0000000111623baf _ZN11Application8AnyInputEt + 31
    CE> 	5   libsw.dylib                         0x0000000136e9d26a _ZN11SwLayAction11FormatCntntEPK9SwPageFrm + 858
    CE> 	6   libsw.dylib                         0x0000000136e9b2d0 _ZN11SwLayAction14InternalActionEv + 1808
    CE> 	7   libsw.dylib                         0x0000000136e9a987 _ZN11SwLayAction6ActionEv + 295
    CE> 	8   libsw.dylib                         0x000000013711a93d _ZN9ViewShell13ImplEndActionEh + 333
    CE> 	9   libsw.dylib                         0x0000000136cc563b _ZN11SwCrsrShell9EndActionEh + 139
    CE> 	10  libsw.dylib                         0x000000013734d20d _ZN6SwView16OuterResizePixelERK5PointRK4Size + 1309
    CE> 	11  libsfx.dylib                        0x000000010fec13cc _ZN12SfxViewFrame6ResizeEh + 300
    CE> 	12  libvcl.dylib                        0x00000001118a747f _ZN6Window17ImplPosSizeWindowEllllt + 2063
    CE> 	13  libvcl.dylib                        0x00000001118a737c _ZN6Window17ImplPosSizeWindowEllllt + 1804
    CE> 	14  libvcl.dylib                        0x00000001118b02da _ZN6Window15SetPosSizePixelEllllt + 186
    CE> 	15  libsfx.dylib                        0x000000010fe98ac3 _ZN8SfxFrame28SetToolSpaceBorderPixel_ImplERK8SvBorder + 291
    CE> 	16  libsfx.dylib                        0x000000010fcad181 _ZN20SfxFrameWorkWin_Impl18ArrangeChilds_ImplEh + 257
    CE> 	17  libsfx.dylib                        0x000000010fe994d5 _ZN8SfxFrame6ResizeEv + 709
    CE> 	18  libvcl.dylib                        0x00000001118a747f _ZN6Window17ImplPosSizeWindowEllllt + 2063
    CE> 	19  libvcl.dylib                        0x00000001118a737c _ZN6Window17ImplPosSizeWindowEllllt + 1804
    CE> 	20  libvcl.dylib                        0x00000001118b02da _ZN6Window15SetPosSizePixelEllllt + 186
    CE> 	21  libootk.dylib                       0x000000011094b68e _ZN10VCLXWindow10setPosSizeEiiiis + 158
    CE> 	22  libfwk.dylib                        0x0000000113e4db82 _ZN9framework26DockingAreaDefaultAcceptor19setDockingAreaSpaceERKN3com3sun4star3awt9RectangleE + 482
    CE> 	23  libfwk.dylib                        0x0000000113e85e1a _ZN9framework13LayoutManager15implts_doLayoutEhh + 1274
    CE> 	24  libfwk.dylib                        0x0000000113e81f19 _ZN9framework13LayoutManager22implts_doLayout_notifyEh + 25
    CE> 	25  libfwk.dylib                        0x0000000113e8164a _ZN9framework13LayoutManager35implts_updateUIElementsVisibleStateEh + 762
    CE> 	26  libfwk.dylib                        0x0000000113e8c4d8 _ZN9framework13LayoutManager11windowShownERKN3com3sun4star4lang11EventObjectE + 520
    CE> 	27  libootk.dylib                       0x0000000110a64868 _ZN25WindowListenerMultiplexer11windowShownERKN3com3sun4star4lang11EventObjectE + 888
    CE> 	28  libootk.dylib                       0x00000001109496b6 _ZN10VCLXWindow18ProcessWindowEventERK14VclWindowEvent + 3606
    CE> 	29  libootk.dylib                       0x00000001109485d0 _ZN10VCLXWindow27LinkStubWindowEventListenerEPvS0_ + 80
    CE> 	30  libvcl.dylib                        0x000000011162c451 _ZNK17VclEventListeners4CallEP14VclSimpleEvent + 273
    CE> 	31  libvcl.dylib                        0x00000001118ad063 _ZN6Window18CallEventListenersEmPv + 163
    CE> 	32  libvcl.dylib                        0x00000001118a1c38 _ZN6Window20ImplSetReallyVisibleEv + 168
    CE> 	33  libvcl.dylib                        0x00000001118a1cb7 _ZN6Window20ImplSetReallyVisibleEv + 295
    CE> 	34  libvcl.dylib                        0x00000001118a64e7 _ZN6Window4ShowEht + 983
    CE> 	35  libvcl.dylib                        0x00000001118a6589 _ZN6Window4ShowEht + 1145
    CE> 	36  libfwk.dylib                        0x0000000113ebb518 _ZN9framework7LoadEnv27impl_makeFrameWindowVisibleERKN3com3sun4star3uno9ReferenceINS3_3awt7XWindowEEEh + 744
    CE> 	37  libfwk.dylib                        0x0000000113eb659f _ZN9framework7LoadEnv25impl_reactForLoadingStateEv + 639
    CE> 	38  libfwk.dylib                        0x0000000113eb7195 _ZN9framework7LoadEnv14impl_setResultEh + 69
    CE> 	39  libfwk.dylib                        0x0000000113eb5fe2 _ZN9framework7LoadEnv16impl_loadContentEv + 3858
    CE> 	40  libfwk.dylib                        0x0000000113eb0e56 _ZN9framework7LoadEnv12startLoadingEv + 438
    CE> 	41  libfwk.dylib                        0x0000000113eafef3 _ZN9framework7LoadEnv20loadComponentFromURLERKN3com3sun4star3uno9ReferenceINS3_5frame16XComponentLoaderEEERKNS5_INS3_4lang20XMultiServiceFactoryEEERKN3rtl8OUStringESJ_iRKNS4_8SequenceINS3_5beans13PropertyValueEEE + 227
    CE> 	42  libfwk.dylib                        0x0000000113efad37 _ZN9framework7Desktop20loadComponentFromURLERKN3rtl8OUStringES4_iRKN3com3sun4star3uno8SequenceINS7_5beans13PropertyValueEEE + 327
    CE> 	43  libfwk.dylib                        0x0000000113efae82 _ZThn24_N9framework7Desktop20loadComponentFromURLERKN3rtl8OUStringES4_iRKN3com3sun4star3uno8SequenceINS7_5beans13PropertyValueEEE + 18
    CE> 	44  libs5abi_uno.dylib                  0x0000000117d5aada _ZN7bridges7cpp_uno6shared25unoInterfaceProxyDispatchEP14_uno_InterfacePK24_typelib_TypeDescriptionPvPS7_PP8_uno_Any + 4042
    CE> 	45  libs5abi_uno.dylib                  0x0000000117d5a430 _ZN7bridges7cpp_uno6shared25unoInterfaceProxyDispatchEP14_uno_InterfacePK24_typelib_TypeDescriptionPvPS7_PP8_uno_Any + 2336
    CE> 	46  libs5abi_uno.dylib                  0x0000000117d59df0 _ZN7bridges7cpp_uno6shared25unoInterfaceProxyDispatchEP14_uno_InterfacePK24_typelib_TypeDescriptionPvPS7_PP8_uno_Any + 736
    CE> 	47  binaryurp.uno.dylib                 0x0000000118f17864 _ZNK9binaryurp15IncomingRequest13execute_throwEPNS_9BinaryAnyEPNSt3__16vectorIS1_NS3_9allocatorIS1_EEEE + 2068
    CE> 	48  binaryurp.uno.dylib                 0x0000000118f16b4b _ZNK9binaryurp15IncomingRequest7executeEv + 155
    CE> 	49  binaryurp.uno.dylib                 0x0000000118f1b7af request + 15
    CE> 	50  libuno_cppu.dylib.3                 0x000000010fb69d76 _ZN15cppu_threadpool8JobQueue5enterElh + 150
    CE> 	51  libuno_cppu.dylib.3                 0x000000010fb6a171 _ZN15cppu_threadpool14ORequestThread3runEv + 97
    CE> 	52  libuno_cppu.dylib.3                 0x000000010fb6a0ce cppu_requestThreadWorker + 14
    CE> 	53  libuno_sal.dylib.3                  0x000000010f5cd875 osl_setThreadTextEncoding + 309
    CE> 	54  libsystem_pthread.dylib             0x00007fff6801c305 _pthread_body + 126
    CE> 	55  libsystem_pthread.dylib             0x00007fff6801f26f _pthread_start + 70
    CE> 	56  libsystem_pthread.dylib             0x00007fff6801b415 thread_start + 13
    CE> )
    *CE> libc++abi.dylib: terminating with unexpected exception of type NSException*
    *RexxDispatcher.java*: Throwable of type 'org.rexxla.bsf.engines.rexx.RexxException' thrown while invoking Rexx:
    getLocalizedMessage(): [BSF4ooRexx/routine/jniRexxRunProgram(), error 9:
           *-* Compiled routine "BSF".
    Error 40 running /usr/local/bin/UNO.CLS line 1843:  Incorrect call to routine.
    Error 40.900:  BSF4ooRexx/routine/BSF(), error 3: Java exception occurred: [org.apache.bsf.BSFException: BSF4ooRexx subfunction "invoke": 
    	bean:        [class org.oorexx.uno.RgfReflectUNO] --> type: <org.oorexx.uno.RgfReflectUNO>
    	method:      [FINDINTERFACEWITHMEMBER] not found or execution error!

    	-> check method name=[FINDINTERFACEWITHMEMBER] (caseless o.k., but correct spelling?)
    	-> check supplied arguments (correct number, correct types?):
    		arg # 1: Rexx argument=[com.sun.proxy.$Proxy6@757942a1] --> Java value="[Proxy:1970881185,118ee9670;s5abi[0];cdafe8392c93469da813cccb46c..." type=<com.sun.proxy.$Proxy6>
    		arg # 2: Rexx argument=[LOADCOMPONENTFROMURL] --> Java value="LOADCOMPONENTFROMURL" type=<java.lang.String>
    		arg # 3: Rexx argument=[0] --> Java value="0" type=<java.lang.String>
    		arg # 4: Rexx argument=[0] --> Java value="0" type=<java.lang.String>
    		arg # 5: Rexx argument=[1] --> Java value="1" type=<java.lang.String>
    ].]
    wu114215:test rony$
Comment 1 ronyf 2018-12-21 14:14:31 UTC
Was able to test this on LibreOffice 6.0.7.3 on the same Apple machine (same Java version, same ooRexx interpreter) and the same ooRexx program works without an error there!

So indeed it seems to be an AOO 4.1.6 specific problem that did not exist in the past (but not sure which exact AOO version for MacOSX I tested the last time successfully).
Comment 2 Peter 2018-12-21 15:01:09 UTC
thanks for your testing.
Comment 3 ronyf 2018-12-30 16:25:29 UTC
Created attachment 86577 [details]
Java program that creates an empty swriter document (source)

The same runtime exception is caused by running a pure Java program from the commandline. Just compile the supplied Java program and run it in the Terminal with:

    java CreateSWriter
Comment 4 ronyf 2018-12-30 16:26:48 UTC
Created attachment 86578 [details]
Java program that creates an empty swriter document (binary, Java 1.6/6)

This is the compiled version for Java 1.6/6 (using Java 8 to compile with "javac -source 1.6 and -target 1.6").

This program runs on Windows, but causes the reported runtime error on MacOSX.
Comment 5 Peter 2018-12-30 21:38:56 UTC
Can you repeat the test with Java 1.8?
Comment 6 ronyf 2018-12-31 14:43:28 UTC
(In reply to Peter from comment #5)
> Can you repeat the test with Java 1.8?

Just ran with jk1.8.0_162 on Apple, same warning and crash at the end with the last line reading: "CE> libc++abi.dylib: terminating with unexpected exception of type NSException".
Comment 7 ronyf 2018-12-31 14:49:51 UTC
Created attachment 86582 [details]
Crash info with Java stack traces (running Java 1.8.0_162-b12) that look useful.
Comment 8 ronyf 2019-01-04 13:18:49 UTC
The issue with Java programs on MacOS that interact with the GUI that all of a sudden cause crashes on MacOS (<https://bz.apache.org/ooo/show_bug.cgi?id=127967>) is still present on AOO 4.1.6 (LO does not have that problem).

What may be interesting to locate the cause is the information, that AOO/LO macros including ooRexx get dispatched via Java and they work. (MacOS seems to have a quite "special" setup for processing GUI events compared to other platforms, causing this crash.)

It seems that the AOO Java bridge, if used from outside of AOO, dispatches UNO Java on the wrong thread, causing the crash when GUI interactions occur on it.
Comment 9 ronyf 2019-01-20 19:05:39 UTC
Just tested this with Jim's latest version for 4.2 and the issue got solved, *great* & many thanks!
Comment 10 Peter 2019-01-21 07:36:40 UTC
I put this then on duplicate to 127965. since it seems to be the root cause.

*** This issue has been marked as a duplicate of issue 127965 ***