https://issues.apache.org/ooo/show_bug.cgi?id=124170

--- Comment #13 from [email protected] ---
The last two days I was able to research this more, using among other things
the latest beanshell script provider Java code (from which I inferred the
script provider for ooRexx many years ago).

The findings:

- the crash in the awt thread seems to not be related to the MacOSX AppKit
thread; the beanshell provider uses "com.sun.star.script.framework.provider.
SwingInvocation" (<http://searchcode.com/codesearch/view/18259454>) which
creates a new Java thread and SwingUtilities.invokeLater() to run the code on a
separate thread from the AppKit thread (the ooRexx script provider does
essentially the same without using the SwingInvocation Java class)

- the crash occurs in the awt thread at the point where via the Java native
interface (JNI) the ooRexx interpreter gets loaded, which is coded in C++ and
which sets itself up using the process environment information, notably the
PATH environment variable; here is the stack trace reaching into ooRexx 4.2.0:

------------ cut here ------------
Process:         soffice [92432]
Path:            /Applications/OpenOffice Beta.app/Contents/MacOS/soffice
Identifier:      org.openoffice.script
Version:         4.1.0 (???)
Code Type:       X86-64 (Native)
Parent Process:  launchd [254]
Responsible:     soffice [92432]
User ID:         501

Date/Time:       2014-03-24 20:44:16.238 +0100
OS Version:      Mac OS X 10.9.2 (13C64)
Report Version:  11
Anonymous UUID:  E2667C29-B337-0D61-D55C-512C7C88AD32

Sleep/Wake UUID: 5C125262-4B0C-411C-A290-DF7A9D64F65B

Crashed Thread:  35  Java: AWT-EventQueue-0

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
-->
    __TEXT                 000000010209e000-000000010209f000 [    4K] r-x/rwx
SM=COW  /Applications/OpenOffice Beta.app/Contents/MacOS/soffice

Application Specific Information:
Java information:
 Exception type: Bus Error (0xa) at pc=7fff8d3a1732

 Java VM: Java HotSpot(TM) 64-Bit Server VM (20.65-b04-462 mixed mode
macosx-amd64)

... cut ...

Thread 35 Crashed:: Java: AWT-EventQueue-0
0   libsystem_c.dylib                 0x00007fff8d3a1732 strlen + 18
1   librexx.4.dylib                   0x000000011ee56ea9
SysFileSystem::searchPath(char const*, char const*, char*) + 41
(SysFileSystem.cpp:520)
2   librexx.4.dylib                   0x000000011ee56ea9
SysFileSystem::searchPath(char const*, char const*, char*) + 41
(SysFileSystem.cpp:520)
3   librexx.4.dylib                   0x000000011ee56dbe
SysFileSystem::primitiveSearchName(char const*, char const*, char const*,
char*) + 270 (SysFileSystem.cpp:449)
4   librexx.4.dylib                   0x000000011ee55ab6
SystemInterpreter::loadImage(char**, unsigned long*) + 102 (FileSystem.cpp:154)
5   librexx.4.dylib                   0x000000011ee1de6a
RexxMemory::restoreImage() + 58 (RexxMemory.cpp:813)
6   librexx.4.dylib                   0x000000011ee1dd97
RexxMemory::initialize(bool) + 839 (RexxMemory.cpp:202)
7   librexx.4.dylib                   0x000000011ee5da62
Interpreter::startInterpreter(Interpreter::InterpreterStartupMode) + 66
(Interpreter.cpp:135)
8   librexx.4.dylib                   0x000000011ee5de9d
Interpreter::createInterpreterInstance(RexxOption*) + 45 (SysSemaphore.hpp:82)
9   librexx.4.dylib                   0x000000011ee5de18
Interpreter::createInstance(RexxInstance_*&, RexxThreadContext_*&, RexxOption*)
+ 24 (Interpreter.cpp:261)
10  librexx.4.dylib                   0x000000011edf98d9 RexxCreateInterpreter
+ 9 (InterpreterAPI.cpp:382)
11  libBSF4ooRexx.dylib               0x0000000109687178
Java_org_rexxla_bsf_engines_rexx_RexxAndJava_jniRexxCreateInterpreterInstance +
2536
12  ???                               0x0000000115741eee 0 + 4654898926
13  ???                               0x00000001157369b3 0 + 4654852531
14  ???                               0x00000001157369b3 0 + 4654852531
15  ???                               0x0000000115736e8d 0 + 4654853773
16  ???                               0x0000000115731438 0 + 4654830648
17  libclient64.dylib                 0x0000000114f01ef4 0x114e6b000 + 618228
18  libclient64.dylib                 0x0000000114f01cb8 0x114e6b000 + 617656
19  libclient64.dylib                 0x0000000114f0d427 JVM_DoPrivileged +
1037
20  libjvmlinkage.dylib               0x000000011557211d JVM_DoPrivileged + 93

... cut ...
------------ cut here ------------


Asking at the ooRexx developer list the chief developer, Rick McGuire stated
(cf. <http://sourceforge.net/p/oorexx/mailman/message/32140007/>):

------------ cut here ------------
Well, the error clearly indicates a null pointer exception, and going back up
the call stack, it's clear that this is caused by getenv("PATH") returning a
null value for some reason. 

Rick
------------ cut here ------------


If anyone is interested to check out that code, here is the URL to the release
4.2.0 version that I used:
<http://sourceforge.net/p/oorexx/code-0/HEAD/tree/main/releases/4.2.0/trunk/>.

So: the crash is not caused by the awt-thread running on the AppKit thread.
(Using SwingInvocation makes sure that a non-AppKit-thread is used to satisfy
Java on MacOSX if awt is needed.) 

Rather the problem seems to be that on the MacOSX getnv("PATH") returns a null
value for unknown reasons. As this has worked in the past (in the OOo 3.x days)
I would assume this to be a regression.

As a result, I would like to invalidate this issue and create a new issue.

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.
You are watching all issue changes.

Reply via email to