You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Varlamov (JIRA)" <ji...@apache.org> on 2006/07/25 08:53:13 UTC

[jira] Created: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

[drlvm] StackOverflowError in native code is handled inaccurately
-----------------------------------------------------------------

                 Key: HARMONY-971
                 URL: http://issues.apache.org/jira/browse/HARMONY-971
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
            Reporter: Alexey Varlamov


On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
The stack trace is:
>	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
 	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
 	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
 	ntdll.dll!7c84f937() 	

Test to reproduce:

public class TestStackOverflow{

	static int i1 = 0;
	static int i2 = 0;

    public static void main(String[] argv) {
   		try {
   			method1(0);
   			System.err.println("Test failed: no stack overflow reported");
   		} catch (StackOverflowError e) {
   			System.err.println("Test passed");
			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
			//e.printStackTrace();
   		} catch (Throwable t) {
   			System.err.println("Test failed: "+t);
   		}
   		System.err.println("i1="+i1+" i2="+i2);
   	}
    	    
   	private static void method1(int p) {
   		
   		System.err.print(".");
   		method2(++i1);
   	}
   	private static void method2(int p) {
   		
   		System.err.print(",");
   		method1(++i2);
   	}
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12434479 ] 
            
Alexey Varlamov commented on HARMONY-971:
-----------------------------------------

Rana,

You may want to look at HARMONY-1363 patch which contains draft implementation of deffered (aka lazy) exception instantiation support in VM. I did not look closer, but this issue may be resolved partially.

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-971?page=all ]

Geir Magnusson Jr reopened HARMONY-971:
---------------------------------------

             

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12437210 ] 
            
Geir Magnusson Jr commented on HARMONY-971:
-------------------------------------------

this patch doesn't apply cleanly (not surprising, given recent changes).  I'm going to try to do it anyway.  If a clean one is *easy*, that would be appreciated, but I don't want to put you out...

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>         Attachments: soefix
>
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12429770 ] 
            
Geir Magnusson Jr commented on HARMONY-971:
-------------------------------------------

ok - re-opened.  Anyone have a patch?


> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Rana Dasgupta (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12434475 ] 
            
Rana Dasgupta commented on HARMONY-971:
---------------------------------------

Am working on this

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Rana Dasgupta (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12437599 ] 
            
Rana Dasgupta commented on HARMONY-971:
---------------------------------------

Please don't apply this patch for now. I need to review the changes to stack overflow handling that slipped in with BBC, and will post back about if this is necessary, and if so, redo the patch

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>         Attachments: soefix
>
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12439339 ] 
            
Geir Magnusson Jr commented on HARMONY-971:
-------------------------------------------

ok - let us know either way so we can close if necessary


> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>         Attachments: soefix
>
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12429647 ] 
            
Alexey Varlamov commented on HARMONY-971:
-----------------------------------------

Geir, the release build passed just because asserts are off. 
AFAIU, no moves were done to fix this issue, and it is still reproducible with debug build.
However, mere mortals like me cannot change JIRAs, comment only.

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-971?page=all ]

Geir Magnusson Jr resolved HARMONY-971.
---------------------------------------

    Resolution: Fixed

This test passes w/ current DRLVM release build.

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-971?page=all ]

Geir Magnusson Jr closed HARMONY-971.
-------------------------------------


Please re-open if I am mistaken about problem being fixed.

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-971?page=all ]

Geir Magnusson Jr closed HARMONY-971.
-------------------------------------

    Resolution: Fixed

Closing at the request of Rana

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>         Attachments: soefix
>
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-971?page=all ]

Geir Magnusson Jr reassigned HARMONY-971:
-----------------------------------------

    Assignee: Geir Magnusson Jr

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Rana Dasgupta (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12431103 ] 
            
Rana Dasgupta commented on HARMONY-971:
---------------------------------------

I checked this out in the debugger. The SOE exception does happen, but twice, and during the second exception, it asserts . The first time, suspend is enabled. Since the top frame is not unwindable, as per the design, the exception gets created and put on the stack. But due to the tight space on windows stacks, the exception gets raised again soon after, before the proactive checking for the exception has occurred. This time, suspension is not enabled and it asserts as in the bug report.

We can add some code to capture exception state when suspension is disabled and check it later. But that is not guaranteed solve problems like this where the exception happens in native code.  The problem does not happen in RI. But I think that the RI uses a seperate stack for native code, which is not a great thing. 

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Rana Dasgupta (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-971?page=all ]

Rana Dasgupta updated HARMONY-971:
----------------------------------

    Attachment: soefix

Adding a fix for this bug + some additional work. 
To prevent this situation of the exception object being needed in suspend_disabled mode, I precreate an SOE exception object at init time and use it only when needed in situations like this.
I also, for now,  delay the restoring of the stack guard till after the exception has been thrown...to give the exception handling more room on the stack

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>         Attachments: soefix
>
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-971) [drlvm] StackOverflowError in native code is handled inaccurately

Posted by "Rana Dasgupta (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-971?page=comments#action_12439389 ] 
            
Rana Dasgupta commented on HARMONY-971:
---------------------------------------

We don't need this patch. This patch was a workaround for handling SOE when raised in suspend disabled mode. The BBC patch includes enough lazy exception handling in VM code functionality to handle this problem and the patch is no longer necessary. The bug does not repro and the suggestion is that we close it.

> [drlvm] StackOverflowError in native code is handled inaccurately
> -----------------------------------------------------------------
>
>                 Key: HARMONY-971
>                 URL: http://issues.apache.org/jira/browse/HARMONY-971
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Alexey Varlamov
>         Assigned To: Geir Magnusson Jr
>         Attachments: soefix
>
>
> On msvc debug build, the following test fails on assert(tmn_is_suspend_enabled());  exceptions.cpp: 143
> The stack trace is:
> >	vmcore.dll!create_exception(const char * exception_name=0x102932ec)  Line 143 + 0x20	C++
>  	vmcore.dll!exn_raise_by_name(const char * exception_name=0x102932ec)  Line 325 + 0x9	C++
>  	vmcore.dll!vectored_exception_handler(_EXCEPTION_POINTERS * nt_exception=0x06052c4c)  Line 317 + 0xa	C++
>  	ntdll.dll!7c84f937() 	
> Test to reproduce:
> public class TestStackOverflow{
> 	static int i1 = 0;
> 	static int i2 = 0;
>     public static void main(String[] argv) {
>    		try {
>    			method1(0);
>    			System.err.println("Test failed: no stack overflow reported");
>    		} catch (StackOverflowError e) {
>    			System.err.println("Test passed");
> 			//System.err.println("Stack depth was = " + (i1 + i2) /*e.getStackTrace().length*/);
> 			//e.printStackTrace();
>    		} catch (Throwable t) {
>    			System.err.println("Test failed: "+t);
>    		}
>    		System.err.println("i1="+i1+" i2="+i2);
>    	}
>     	    
>    	private static void method1(int p) {
>    		
>    		System.err.print(".");
>    		method2(++i1);
>    	}
>    	private static void method2(int p) {
>    		
>    		System.err.print(",");
>    		method1(++i2);
>    	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira