You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Fursov (JIRA)" <ji...@apache.org> on 2007/06/09 15:03:26 UTC

[jira] Commented: (HARMONY-1859) [drlvm][jit] StackOverflowError handling leads to Segmentation fault on Linux with -Xem:opt and jet and is handled incorrectly with -Xint on both Win and Linux

    [ https://issues.apache.org/jira/browse/HARMONY-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503071 ] 

Mikhail Fursov commented on HARMONY-1859:
-----------------------------------------

I moved soe.fix into another JIRA: HARMONY-4118
Reason:
the problem with initial test from the first post is not JIT-only problem.
When a SOE handler is located near of the place where SOE happens "set_guard_stack" fails to restore page protection because it works on the page it wants to protect:

Stack trace:

 	ntdll.dll!7c90eb94() 	
 	ntdll.dll!7c90dec2() 	
 	kernel32.dll!7c801a7d() 	
 	kernel32.dll!7c801ae8() 	
>	harmonyvm.dll!set_guard_stack()  Line 183 + 0x22	C++
 	harmonyvm.dll!exception_catch_callback()  Line 537	C++
 	harmonyvm.dll!exception_catch_callback_wrapper()  Line 216	C++
 	harmonyvm.dll!asm_exception_catch_callback()  Line 81	C++
 	030a00c8()	

Guarded page hit happens by the 0x00610033  address:

00610033  call        dword ptr [__imp__VirtualProtect@16 (778450h)] 
00610039  cmp         esi,esp 
0061003B  call        _RTC_CheckEsp (73A7C0h) 
00610040  test        eax,eax 
00610042  jne         set_guard_stack+0BFh (61005Fh) 

in harmonyvm.dll!set_guard_stack()  Line 183  
function.



I propose reassigning this issue to VM subcomponent.


> [drlvm][jit] StackOverflowError  handling leads to Segmentation fault on Linux with -Xem:opt and jet and is handled incorrectly with -Xint on both Win and Linux
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1859
>                 URL: https://issues.apache.org/jira/browse/HARMONY-1859
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vera Aristova
>            Priority: Minor
>         Attachments: soe.fix
>
>
> Simple recursive method calling leads to Segmentation fault instead of StackOverflowError throwing on Linux with -Xem:opt and jet.
> It is handled incorrectly with -Xint on both Win and Linux .
> On Windows with -Xem:opt and jet StackOverflowError is thrown correctly.
> test for reproducing:
> public class test {
>     public static void main(String [] args) {
>             try {
>                         main(args);
>                   } catch (Throwable e) {
>                      System.out.println("was caught  " + e);
>                  }
>      }
>  }
> to reproduce run script: bash run_lnx.sh
> To reproduce bash run.sh:
> -----------------------------------------------------------------------
> export HY=../ drl_20061013_lnx_ia32_0002_icc_r_H
>  export LD_LIBRARY_PATH=$HY/bin
> export SUN=../jdk1.5.0_06
> $SUN/bin/javac -cp . test.java
> echo --------SUN----------
> $SUN/bin/java -cp . test
> echo ----------HY -Xem:jet---------
> $HY/bin/java -showversion
> $HY/bin/java -cp . -Xem:jet  test
> echo ----------HY -Xem:opt---------
> $HY/bin/java -cp . -Xem:opt test
> echo -----------HY -Xint --------------
> $HY/bin/java -cp . -Xint test
> OUTPUT on Linux:
> --------SUN----------
> was caught java.lang.StackOverflowError
> ----------HY -Xem:jet---------
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its l
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r454528, (Oct 13 2006), Linux/ia32/icc 900, release build
> http://incubator.apache.org/harmony
> run_lnx.sh: line 10: 32502 Segmentation fault      $HY/bin/java -cp . -Xem:jet test
> ----------HY -Xem:opt---------
> SIGSEGV in VM code.
> Stack trace:
>         1: ?? (??:-1)
>         2: ?? (??:-1)
>         3: ?? (??:-1)
>         4: ?? (??:-1)
>         5: ?? (??:-1)
>         6: ?? (??:-1)
>         7: ?? (??:-1)
>         8: ?? (??:-1)
>         9: ?? (??:-1)
>         10: ?? (??:-1)
>         11: ?? (??:-1)
>         12: ?? (??:-1)
>         13: ?? (??:-1)
>         14: ?? (??:-1)
>         15: ?? (??:-1)
>         16: ?? (??:-1)
>         17: ?? (??:-1)
>         18: ?? (??:-1)
>         19: JIT_execute_method_default(void*, _jmethodID*, jvalue*, jvalue*) (??:-1)
>         20: DrlEMImpl::executeMethod(_jmethodID*, jvalue*, jvalue*) (??:-1)
> <end of stack trace>
> run_lnx.sh: line 12: 32538 Segmentation fault      $HY/bin/java -cp . -Xem:opt test
> ----------HY -Xint -----------
> java/lang/StackOverflowError : (null)
>  at test.main (test.java: 15)
>  at test.main (test.java: 7)
>  at test.main (test.java: 7)
>  at test.main (test.java: 7)
>  at test.main (test.java: 7)
>  ....
> OUTPUT on Windows:
> --------SUN----------
> was caught java.lang.StackOverflowError
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> ----------HY with -Xem:jet---------
> was caught java.lang.StackOverflowError
> ----------HY with -Xem:opt---------
> was caught java.lang.StackOverflowError
> ----------HY with -Xint
> java/lang/StackOverflowError : (null)
>  at test.main (test.java: 15)
>  at test.main (test.java: 7)
>  at test.main (test.java: 7)
>  at test.main (test.java: 7)
>  at test.main (test.java: 7)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.