JavaFX and Sandboxing

Scott Kovatch scott.kovatch at oracle.com
Mon Aug 6 08:25:17 PDT 2012


Yes, the stack is different. Jessica's bug is against 7u5, so it would have to have Fx 2.1, I think.  My test was with 7u6-b21, with the latest JavaFx.

We should look into why we need to call setprogname or setProcessName if we are a bundled app. If the app is bundled the OS should take care of everything for us.

-- Scott

On Aug 6, 2012, at 5:51 AM, Artem Ananiev <artem.ananiev at oracle.com> wrote:

> Scott, Jessica,
> 
> this stack below is different from what reported in RT-23949: initially reported one doesn't contain setprogname(). This call preceded by [NSProcessInfo setProcessName], which seems to be the right way for sandboxed applications. I'm not an OS X expert, so I can't say why we have both calls in JFX and whether it will be enough to leave the first one only.
> 
> Thanks,
> 
> Artem
> 
> On 8/3/2012 8:54 PM, Scott Kovatch wrote:
>> I recently tried sandboxing with JavaFx and got the same violation, but I assumed it was in the networking code in the JDK.
>> 
>> Looks like sandboxd doesn't like it when we set the name of the process:
>> 
>> #0  0x00007fff92d3972c in sysctl ()
>> #1  0x00007fff92d38aad in setprogname ()
>> #2  0x0000000113203481 in -[GlassApplication runLoop:] ()
>> #3  0x00007fff939588a7 in __NSThreadPerformPerform ()
>> #4  0x00007fff93eea841 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
>> #5  0x00007fff93eea165 in __CFRunLoopDoSources0 ()
>> #6  0x00007fff93f0d4e5 in __CFRunLoopRun ()
>> #7  0x00007fff93f0cdd2 in CFRunLoopRunSpecific ()
>> 
>> I don't see a workaround, either.
>> 
>> Thanks for reporting it, though!
>> 
>> -- Scott K.
>> 
>> On Aug 3, 2012, at 8:37 AM, Jessica Finley<jfinley at tech4learning.com>  wrote:
>> 
>>> Thanks, I've submitted the issue:
>>> http://javafx-jira.kenai.com/browse/RT-23949
>>> 
>>> -Jess
>>> 
>>> On Aug 3, 2012, at 9:21 AM, Scott Palmer<swpalmer at gmail.com>  wrote:
>>> 
>>>> 
>>>> On 2012-08-03, at 11:15 AM, Jessica Finley<jfinley at tech4learning.com>  wrote:
>>>> 
>>>>> Hiya,
>>>>> 
>>>>> It appears that JavaFX causes sandbox violations using Oracle's 1.7.0_5.  I've written a test application that simply instantiates a JFXPanel and it causes the following violation:
>>>>> 
>>>>> JavaAppLauncher(1716) deny sysctl-write
>>>>> 
>>>>> Process:         JavaAppLauncher [1716]
>>>>> Path:            /Users/jfinley/JDev/JavaFX/JFXSandboxTest/JFXSandboxTest/JFXSandboxTest.app/Contents/MacOS/JavaAppLauncher
>>>>> Load Address:    0x101b86000
>>>>> Identifier:      com.test.JFXSandboxTest
>>>>> Version:         1.0 (4.0)
>>>>> Code Type:       x86_64 (Native)
>>>>> Parent Process:  launchd [144]
>>>>> 
>>>>> Date/Time:       2012-08-03 08:52:47.933 -0600
>>>>> OS Version:      Mac OS X 10.8 (12A269)
>>>>> Report Version:  8
>>>>> 
>>>>> Thread 0:
>>>>> 0   libsystem_kernel.dylib        	0x00007fff907385f2 __sysctl + 10
>>>>> 1   libglass.dylib                	0x000000016a2a3481 -[GlassApplication runLoop:] + 2049
>>>>> 2   Foundation                    	0x00007fff90de68a7 __NSThreadPerformPerform + 225
>>>>> 3   CoreFoundation                	0x00007fff971b4841 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
>>>>> 4   CoreFoundation                	0x00007fff971b4165 __CFRunLoopDoSources0 + 245
>>>>> 5   CoreFoundation                	0x00007fff971d74e5 __CFRunLoopRun + 789
>>>>> 6   CoreFoundation                	0x00007fff971d6dd2 CFRunLoopRunSpecific + 290
>>>>> 7   HIToolbox                     	0x00007fff8fd27774 RunCurrentEventLoopInMode + 209
>>>>> 8   HIToolbox                     	0x00007fff8fd27512 ReceiveNextEventCommon + 356
>>>>> 9   HIToolbox                     	0x00007fff8fd273a3 BlockUntilNextEventMatchingListInMode + 62
>>>>> 10  AppKit                        	0x00007fff9661cfa3 _DPSNextEvent + 685
>>>>> 11  AppKit                        	0x00007fff9661c862 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
>>>>> 12  libosxapp.dylib               	0x00000001625d282c -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
>>>>> 13  AppKit                        	0x00007fff96613c03 -[NSApplication run] + 517
>>>>> 14  libosxapp.dylib               	0x00000001625d274b +[NSApplicationAWT runAWTLoopWithApp:] + 156
>>>>> 15  liblwawt.dylib                	0x0000000162531748 -[AWTStarter starter:] + 1587
>>>>> 16  Foundation                    	0x00007fff90de68a7 __NSThreadPerformPerform + 225
>>>>> 17  CoreFoundation                	0x00007fff971b4841 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
>>>>> 18  CoreFoundation                	0x00007fff971b4165 __CFRunLoopDoSources0 + 245
>>>>> 19  CoreFoundation                	0x00007fff971d74e5 __CFRunLoopRun + 789
>>>>> 20  CoreFoundation                	0x00007fff971d6dd2 CFRunLoopRunSpecific + 290
>>>>> 21  libjli.dylib                  	0x0000000101cf391c CreateExecutionEnvironment + 871
>>>>> 22  libjli.dylib                  	0x0000000101cee10c JLI_Launch + 1952
>>>>> 23  JavaAppLauncher               	0x0000000101b889cb launch + 5035
>>>>> 24  JavaAppLauncher               	0x0000000101b874f6 main + 102
>>>>> 25  JavaAppLauncher               	0x0000000101b87484 start + 52
>>>>> 
>>>>> Binary Images:
>>>>>     0x101b86000 -        0x101b88ff7  com.test.JFXSandboxTest (4.0 - 1.0)<C94F476C-C7EC-3E7C-842D-177171B7D950>  /Users/jfinley/JDev/JavaFX/JFXSandboxTest/JFXSandboxTest/JFXSandboxTest.app/Contents/MacOS/JavaAppLauncher
>>>>>     0x101ced000 -        0x101cf6fff  com.oracle.java.7u05.jdk (1.0 - 1.7.0_05)<8F4E1D7E-D38A-377D-83D0-C12334A097A4>  /Users/jfinley/JDev/JavaFX/JFXSandboxTest/JFXSandboxTest/JFXSandboxTest.app/Contents/PlugIns/1.7.0.jre/Contents/MacOS/libjli.dylib
>>>>>     0x162524000 -        0x162590fff  liblwawt.dylib (1)<B491DADC-13EF-3046-86CB-FE4B61313DAB>  /Users/jfinley/JDev/JavaFX/JFXSandboxTest/JFXSandboxTest/JFXSandboxTest.app/Contents/PlugIns/1.7.0.jre/Contents/Home/jre/lib/lwawt/liblwawt.dylib
>>>>>     0x1625d1000 -        0x1625d6fff  libosxapp.dylib (1)<6B723FF5-4D8A-341E-A28B-D49F6D76CFA2>  /Users/jfinley/JDev/JavaFX/JFXSandboxTest/JFXSandboxTest/JFXSandboxTest.app/Contents/PlugIns/1.7.0.jre/Contents/Home/jre/lib/libosxapp.dylib
>>>>>     0x16a2a0000 -        0x16a2d1fef  libglass.dylib (0)<E2AA004E-7964-663E-863B-F5614D2E067A>  /Users/jfinley/JDev/JavaFX/JFXSandboxTest/JFXSandboxTest/JFXSandboxTest.app/Contents/PlugIns/1.7.0.jre/Contents/Home/jre/lib/libglass.dylib
>>>>>  0x7fff8fcc8000 -     0x7fff8fff7ff7  com.apple.HIToolbox (2.0)<49C4A53E-9239-3B9A-95DC-8C7B398E491D>  /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
>>>>>  0x7fff90726000 -     0x7fff90741ff7  libsystem_kernel.dylib (2050.7.9)<E0447BF5-E104-35B0-B28B-4156887D58F1>  /usr/lib/system/libsystem_kernel.dylib
>>>>>  0x7fff90d54000 -     0x7fff910b0ff7  com.apple.Foundation (6.8 - 945)<0C972F73-0C07-3384-98F2-B176E0289494>  /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
>>>>>  0x7fff964c6000 -     0x7fff970f0fff  com.apple.AppKit (6.8 - 1187)<C9309F5C-9441-3E5B-A120-B03FEDDA63F9>  /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
>>>>>  0x7fff971a2000 -     0x7fff9738bfff  com.apple.CoreFoundation (6.8 - 744)<47AEA7C7-EF9B-3FC6-AEBF-CE02FC650301>  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>>>>> 
>>>>> 
>>>>> Does anyone else experience this problem?  This seems like something that needs to be addressed, but I'm not sure if this is the correct venue in which to mention it.  The test app and its source are available here: www.jmorganryan.com/JFXSandboxTest.zip
>>>>> 
>>>>> Thanks,
>>>>> Jess
>>>> 
>>>> 
>>>> I haven't tried sandboxing any of my FX pas yet, but have you filed an issue for this at http://javafx-jira.kenai.com/
>>>> ?
>>>> 
>>>> Scott P.
>>>> 
>>> 
>>> 
>> 



More information about the macosx-port-dev mailing list