Closed Bug 131295 Opened 23 years ago Closed 21 years ago

java.io inside javaScript causes crash

Categories

(Core Graveyard :: Java: OJI, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: curlypaul924, Assigned: yuanyi21)

References

()

Details

(Keywords: hang, Whiteboard: redesign)

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020311 BuildID: 2002031115 The following html can cause mozilla to crash: <html> <script> var url = 'http://www.google.com/'; var dest = new java.net.URL(url); var dis = new java.io.DataInputStream(dest.openStream()); alert('got a socket!'); killme(); </script> </html> This does not occur every single time; you have to reload the page a few times to get it to crash. Reproducible: Sometimes Steps to Reproduce: 1. Create a page with the above html 2. View the page 3. If you don't yet see a crash, goto step 2 Actual Results: The web browser will crash. Expected Results: I'm not sure.
Attached file Reporter's testcase
Using debug trunk build 2002-03-14 WinNT. Reassigning to LiveConnect. When I load the testcase, I see this error in the JavaScript Console: Error: uncaught exception: java.security.PrivilegedActionException <<java.lang.reflect.InvocationTargetException>> and this error in the Java Console: java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException: java.security.AccessControlException: access denied (java.net.SocketPermission www.google.com resolve) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkConnect(Unknown Source) at sun.plugin.protocol.jdk12.http.HttpURLConnection.connectStep1(Unknown Source) at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.URL.openStream(Unknown Source) at java.lang.reflect.Method.invoke(Native Method) at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)
Component: JavaScript Engine → Live Connect
Using Mozilla trunk binaries 20020314xx on WinNT, Linux, and Mac9.1 Mac9.1 The test runs fine. No errors in the Java Console, and the test completes successfully: I get an alert saying, "got a socket!" WinNT (using Java Plug-in 1.3.0_01) Same result as with the debug WinNT build: I get errors in the JS and Java Consoles, and the test does not complete (no alertbox). However, I am not able to crash... Linux (using Java Plug-in 1.3.0_01) The test crashes! Confirming bug. Unfortunately, I haven't been able to build on Linux in recent days. Will have to try for a stack trace on someone else's machine.
Assignee: rogerl → beard
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: crash
Sending to OJI. Compare these bugs, where similar Java exceptions are raised: bug 113122 "applet error" (this has links to other similar bugs) bug 121370 "Java exception" (crashes on Linux, only an error on Windows) cc'ing Patrick -
Assignee: beard → joe.chou
Component: Live Connect → OJI
QA Contact: pschwartau → pmac
The Mac OS X plugin throws similar exceptions, but doesn't crash. It would be helpful to see a stack crawl of the actual machine crash if possible.
With default security permissions I see 'access denied sun.net.SocketPermission "www.google.com" resolve' (or smth like this. This is normal. But when I add grant { permission java.net.SocketPermission "*", "resolve, connect"; }; to $HOME/.java.policy, mozilla crashes (Solaris and Linux, java 1.3.1) Last words on stdout were: Server: ConvertJavaToJValue type=jobject Server: Returning object: 19D360 Server: handle_code(): [1046 17]**** >>>> JAVA_PLUGIN_GET_ARRAY_LENGTH Server: handle_code(): [1047 17]**** >>>> JAVA_PLUGIN_RELEASE_LOCAL_REF Server: handle_code(): [1048 17]**** >>>> JAVA_PLUGIN_SECURE_CALL Server: trace_call_secure(): [pipe= 17] Nargs=0 Return Type=jobject Obj/Clss= 1974CC Unnamed Met/Fld=19BD40 openStream sig=NULL ctx=697C88 origin='file://' UniversalBrowserRead=0 UniversalJavaPerm=0 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x0 Function name=(N/A) Library=(N/A) NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at sun.plugin.navig.motif.Worker.setX11Property(Native Method) at sun.plugin.navig.motif.Worker.pushRequest(Worker.java:69) at sun.plugin.navig.motif.Worker.getProxySettings(Worker.java:181) at sun.plugin.ActivatorProxyHandler.findProxyForURL(Native Method) at sun.plugin.ActivatorProxyHandler.getProxyInfo(ActivatorProxyHandler.java:253) at sun.plugin.protocol.jdk12.http.HttpURLConnection.connectStep2(HttpURLConnection.java:215) at sun.plugin.protocol.jdk12.http.HttpURLConnection.connect(HttpURLConnection.java:145) at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(HttpURLConnection.java:321) at java.net.URL.openStream(URL.java:798) at java.lang.reflect.Method.invoke(Native Method) at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(SecureInvocation.java:585) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation.CallMethod(SecureInvocation.java:276) Dynamic libraries: <skipped> Local Time = Wed Mar 20 17:10:59 2002 Elapsed Time = 12 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.3.1-b24 mixed mode) # # An error report file has been saved as hs_err_pid13718.log. # Please refer to the file for further information. # INTERNAL ERROR on Browser End: Pipe closed during read? State may be corrupt System error?:: Resource temporarily unavailable Last few lines from plugin_java131.trace: Read the event window id:125829121 Set window ID Plugin: Reading next code... VM Received Command >>>JAVA_PLUGIN_ATTACH_THRE Attach Thread Starting watcher Registering thread: Thread[Thread-3,5,main] with AThread Thread[Thread-3,5,main] Plugin: Reading next code... getProxySettings. Using key:http:www.google.com:-1 Entering request for:Proxy Worker pushRequest:FindProxy
Worksforme on Build ID: 2002042510 (0.9.9+) trunk Windows 98. Tried to reload 5 times, no crash. Reporter, could you install 0.9.9 and Sun Java JRE 1.4, and see if it still crashes?
QA Contact: pmac → petersen
reassign to me
Assignee: joe.chou → joshua.xia
var dest = new java.net.URL(url); success var dis = new java.io.DataInputStream(dest.openStream()); exception happen
I changed var url = 'http://www.google.com/'; to be our internal website and open All Permission, the script runs well. The exception happened because that script has not set proxy, dest.openStream() without proxy will fail. I think this is not bug, or JPI should use default proxy?
Reproduce the hang on Linux(RH8.0) mozilla1.2 JRE1.4.1_01 even I open all permission
Keywords: crashhang
It will hang sun_mozilla1.2.1_03 on JRE1.4.1_01,Gnome2.0 fcs -10 ----------------------------------------------Jennifer.hao@sun.com 2003-01-22
Can't reproduce this bug by using the JRE 1.4.2 beta-b16 and the latest mozilla.
Investigated: reason is: a exception happened on JPI 's JVM server side, so JPI return a invaild random value to js/liveconnect as jobject and liveconnect use this value to get jclass. so this lead to crash. Mozilla can't check this exception, so this have to be fixed on JPI side. random value: depend on OS and runtime memory, so it can't reproduce everytime.
Status: NEW → ASSIGNED
Whiteboard: redesign
->kyle
Assignee: joshua.xia → kyle.yuan
Status: ASSIGNED → NEW
works for me, mozilla1.4(debug build) + jre1.5(beta) on both Linux (SuSE) & Windows 2000. I got the following message in console: JavaScript error: line 0: uncaught exception: java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException no crash, no hang.
please get latest jre from java.sun.com and try it again.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: