harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrico Migliore <enrico.migli...@fatti.com>
Subject Re: [sablevm] SIGSEGV signal received from Cygwin
Date Thu, 06 Apr 2006 16:16:51 GMT
Hi Etienne,

>Enrico Migliore wrote:
>  
>
>>I'm doing some testing on SableVM, and noticed that is receives the very
>>same segmentation fault signal that JCHEVM does, from
>>pthread_key_create() which is embedded in:
>>
>>/usr/bin/cygwin1.dll
>>
>>I read around that this problem could be fixed, but the error means that
>>the Cygwin platform can only be used for developing, studying and
>>testing and not for real world use.
>>    
>>
>
>Can you expand a little on this.  I am not sure what you mean.
>
>  
>
I debugged the classical HelloWorld class with DDD and found the problem 
in the following function:

_svmf_init(void)
{
 pthread_once(...);    <---- SEGSEGV  signal
....
}


>>problem 1:  POSIX dependancy
>>---------------------------------
>>The code contains a certain number of POSIX calls (dependancies). Much
>>of them can be easily replaced, but some might be hard to replace.
>>    
>>
>
>I think that moving to Harmony's port library should solve this.  I
>agree that it shouldn't be hard to fix.
>  
>
Are you referring to the work-in-progress that is adapting SableVM to 
the VMI?

>  
>
>>problem 2:  GCC extensions
>>-----------------------------
>>The code contains some GCC extensions which are not ANSI.
>>    
>>
>
>When compiling a switch interpreter (--with-treading=switch), there
>shouldn't be GCC extensions.  The only exception is atomic operations
>which cannot be expressed in C.  Yet, I've found an elegant solution to
>this: use Hans Boehm's atomic_ops library to get this code out of
>SableVM.  See:
>
> http://sablevm.org/bugs/179
>  
>
Ok

>  
>
>>problem 3:  Which compiler?
>>-----------------------------
>>GCC seems to be the best candidate but MSVC is more popular.
>>    
>>
>
>Ideally, I'd like both to work.  Getting the faster direct/inlined
>interpreters to work with MSVC might be tricky (require inline assembly
>or linking to an asm library), but the switch interpreter shouldn't be a
>problem.
>
>  
>
I see what you're saying....

>>problem 4:  Native code dependancies
>>---------------------------------------
>>The Harmony class library depends on the port layer:
>>
>>http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/harmony/enhanced/classlib/trunk/doc/vm_doc/html/index.html
>>    
>>
>
>Yep, using this layer and atomic_ops should hopefully be sufficient to
>remove all system-specific dependencies.  If anything is missing, we
>should probably abstract it into the port layer.
>
>  
>
In any case, before starting the port, I think that I and the people who 
would like to help, will have analyze the code file by file.

>Now, the interesting thing would be for Harmony native code to compile
>and work on something other than ia32.  SableVM already works on pretty
>much anything (using gcc, so far), as long as libffi and GNU classpath
>compiles on the target.  The only other limitation is 2 operations that
>cannot be expressed in C: compare_and_swap and clear_cache.
>
>Etienne
>
>  
>
That's another reasonable goal :-)

Enrico




---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message