harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer" <ndbe...@apache.org>
Subject Re: [drlvm] tests failing on Win2000 PIII
Date Thu, 05 Apr 2007 18:27:33 GMT
On 4/5/07, Rana Dasgupta <rdasgupt@gmail.com> wrote:
> On 4/5/07, Ilya Berezhniuk <ilya.berezhniuk@gmail.com> wrote:
> > I think it's not enough to wrap JNI functions with SEH, we should wrap every
> > newly created thread with SEH, for example in thread_start_proc() function.
> > I'm not sure that all features provided by VEH are provided by SEH, but I'll
> > try this approach soon.
> >
>
> Yes, I have some unknowns about this too. VEH is more functional than
> SEH and this may end up being a non trivial port. I am  much more keen
> about supporting PIII  than about W2K which is now a really old OS.
>
> > AFAIK, a method to serialize load/store operations should be used in any
> > multiprocessor/multicore/hyperthreading system, especially with separate
> > cache (like in multiprocessor system). So for multiprocessor P3 machines we
> > should find a way to serialize without mfence.
> >
>
> I think the bus snooping semantics take care of preserving the strong
> ordered model with muti procs as well, at least on genuine Intel, but
> experiments will tell and I am not sure about Intel compatibles etc.

This is the impression I have as well. I found this article about
locking in the HotSpot VM [1] and this comment stuck out to me.

"Lock:cmpxchg is serializing, providing bidirectional
mfence-equivalent semantics. (Fence or barrier instructions are never
needed for uniprocessors) This fact might also have contributed to the
myth that CAS is more expensive on MP systems."

-Nathan

[1] http://blogs.sun.com/dave/entry/biased_locking_in_hotspot

>
> > --
> > Ilya
> >
> >
> > 2007/4/5, Alexey Varlamov <alexey.v.varlamov@gmail.com>:
> > >
> > > 2007/4/5, Nathan Beyer <ndbeyer@apache.org>:
> > > > Commenting out the AddVectoredExceptionHandler helped a bit. Here's
> > > > what else (diff below) I had to remove from DRLVM to get "java
> > > > -version" to work. I still can't get a simple HelloWorld class to run,
> > > > even with just the interpreter. I wouldn't be surprised that my little
> > > > hack isn't completely correct.
> > >
> > > Nathan, I guess those you needed to remove are for _compiling_ on w2k,
> > > not for simple running pre-build binaries?
> > > At least for the stack_dump.cpp changes, referenced dbghelp.dll is
> > > freely(?) redistributable and you can try run DRLVM with this dll
> > > downloaded or taken from WinXP. If it works, we may need to update
> > > build scripts to include this dll to snapshots as we do with
> > > msvcr71.dll.
> > >
> > > >
> > > > Index: port/src/vmem/win/port_vmem.c
> > > > ===================================================================
> > > > --- port/src/vmem/win/port_vmem.c       (revision 525583)
> > > > +++ port/src/vmem/win/port_vmem.c       (working copy)
> > > > @@ -236,12 +236,12 @@
> > > >  }
> > > >
> > > >  APR_DECLARE(size_t) port_vmem_max_size(){
> > > > -    PERFORMANCE_INFORMATION pi;
> > > > -    if ( GetPerformanceInfo( &pi, sizeof(pi)) ) {
> > > > -        return (pi.CommitLimit - pi.CommitTotal) * pi.PageSize +
> > > > port_vmem_committed_size();
> > > > -    } else {
> > > > +//    PERFORMANCE_INFORMATION pi;
> > > > +//    if ( GetPerformanceInfo( &pi, sizeof(pi)) ) {
> > > > +//        return (pi.CommitLimit - pi.CommitTotal) * pi.PageSize +
> > > > port_vmem_committed_size();
> > > > +//    } else {
> > > >         return (size_t)0;
> > > > -    }
> > > > +//    }
> > > >  }
> > > >
> > > >  #ifdef __cplusplus
> > > > Index: vmcore/src/stack/stack_dump.cpp
> > > > ===================================================================
> > > > --- vmcore/src/stack/stack_dump.cpp     (revision 525583)
> > > > +++ vmcore/src/stack/stack_dump.cpp     (working copy)
> > > > @@ -85,11 +85,11 @@
> > > >     PSYMBOL_INFO pSymb = (PSYMBOL_INFO)smBuf;
> > > >     pSymb->SizeOfStruct = sizeof(smBuf);
> > > >     pSymb->MaxNameLen = 2048;
> > > > -    DWORD64 funcDispl;
> > > > -    if(SymFromAddr(GetCurrentProcess(), (DWORD64)ip, &funcDispl,
> > > pSymb)) {
> > > > -        info->method_name = (char*) STD_MALLOC(strlen(pSymb->Name)
+
> > > 1);
> > > > -        strcpy(info->method_name, pSymb->Name);
> > > > -    }
> > > > +    //DWORD64 funcDispl;
> > > > +    //if(SymFromAddr(GetCurrentProcess(), (DWORD64)ip, &funcDispl,
> > > pSymb)) {
> > > > +    //    info->method_name = (char*) STD_MALLOC(strlen(pSymb->Name)
+
> > > 1);
> > > > +    //    strcpy(info->method_name, pSymb->Name);
> > > > +    //}
> > > >     DWORD lineOffset;
> > > >     IMAGEHLP_LINE lineInfo;
> > > >     if (SymGetLineFromAddr(GetCurrentProcess(), (DWORD)ip,
> > > > &lineOffset, &lineInfo)) {
> > > > Index: vmcore/src/util/win/nt_platform_utils.cpp
> > > > ===================================================================
> > > > --- vmcore/src/util/win/nt_platform_utils.cpp   (revision 525583)
> > > > +++ vmcore/src/util/win/nt_platform_utils.cpp   (working copy)
> > > > @@ -60,16 +60,16 @@
> > > >     assert(ok);
> > > >
> > > >     // add VEH to catch NPE's from bytecode
> > > > -    TRACE2("signals", "Adding vectored exception handler...");
> > > > -    veh = AddVectoredExceptionHandler(0, vectored_exception_handler);
> > > > -    assert(veh);
> > > > +    // TRACE2("signals", "Adding vectored exception handler...");
> > > > +    // veh = AddVectoredExceptionHandler(0,
> > > vectored_exception_handler);
> > > > +    // assert(veh);
> > > >  }
> > > >
> > > >  void shutdown_signals() {
> > > > -    TRACE2("signals", "Removing vectored exception handler...");
> > > > -    ULONG res;
> > > > -    res = RemoveVectoredExceptionHandler(veh);
> > > > -    assert(res);
> > > > +    // TRACE2("signals", "Removing vectored exception handler...");
> > > > +    // ULONG res;
> > > > +    // res = RemoveVectoredExceptionHandler(veh);
> > > > +    // assert(res);
> > > >  } //shutdown_signals
> > > >
> > > >  //The following is for socket error handling
> > > >
> > > >
> > > > -Nathan
> > > >
> > > > On 4/4/07, Gregory Shimansky <gshimansky@gmail.com> wrote:
> > > > > On Friday 02 March 2007 21:56 Geir Magnusson Jr. wrote:
> > > > > > I thought it used to work.  Also, I thought that someone had
shown
> > > > > > that Win2k was still widely deployed.  maybe that's win2k+3?
 (I can
> > > > > > never keep the windows platform family straight anymore...)
> > > > >
> > > > > Resurrecting this old thread about w2k, Nathan, what happens if you
> > > just
> > > > > comment out the line with AddVectoredExceptionHandler? In this case
> > > you'll
> > > > > lose a handler registration, so you will not have hardware NPEs (I
am
> > > not
> > > > > sure about the JIT status for ia32, are hardware NPEs enabled for
this
> > > > > architecture?), you won't have JVMTI breakpoints in JIT mode, so
> > > debugging
> > > > > won't work. But the rest of VM should work on w2k with the exception
> > > of the
> > > > > code which uses P4 specific instructions.
> > > > >
> > > > > If this helps to at least start running the VM, I think it could
be
> > > possible
> > > > > to move from vectored exceptions to older structured ones on w2k
and
> > > make it
> > > > > a supported platform.
> > > > >
> > > > > If you get illegal instruction like mfence on w2k as well, probably
> > > the
> > > > > modifications which Evgueni Brevnov is going to offer for P3 backport
> > > on
> > > > > Linux could help you running at least something...
> > > > >
> > > > > I am asking because I don't have either w2k or P3 processor, so all
I
> > > can do
> > > > > to help right now is give some suggestions.
> > > > >
> > > > > > geir
> > > > > >
> > > > > > On Feb 26, 2007, at 8:31 PM, Nathan Beyer wrote:
> > > > > > > Thanks for details.
> > > > > > >
> > > > > > > So I guess I'll ask the question again, is there a desire
for
> > > Win2K
> > > > > > > support? I'm not sure I really have an opinion one way
or the
> > > other.
> > > > > > > In relation to the previous discussion, I do think we should
> > > maintain
> > > > > > > a single code base, so I guess this means either coding
to the
> > > > > > > lowest-common spec, some sort of test-and-branch or C macros
(?).
> > > > > > >
> > > > > > > I do think it would be helpful to spit out a "OS not supported"
> > > error
> > > > > > > condition in these cases.
> > > > > > >
> > > > > > > -Nathan
> > > > > > >
> > > > > > > On 2/26/07, Alex Astapchuk <alex.astapchuk@gmail.com>
wrote:
> > > > > > >> Btw, the w2k issue has been raised before. Start of
the tread is
> > > > > > >> here:
> > > > > > >>
> > > > > > >>
> > > http://mail-archives.apache.org/mod_mbox/harmony-dev/200608.mbox/%
> > > > > > >> 3c44D36A45.802@pobox.com%3e
> > > > > > >>
> > > > > > >> then it turns into 'platform support':
> > > > > > >>
> > > > > > >>
> > > http://mail-archives.apache.org/mod_mbox/harmony-dev/200608.mbox/%
> > > > > > >> 3c44D9A4C7.1010607@gmail.com%3e
> > > > > > >>
> > > > > > >> and HARMONY-1145 was filed against the issue.
> > > > > > >>
> > > > > > >> --
> > > > > > >> Thanks,
> > > > > > >>    Alex
> > > > > > >>
> > > > > > >> Alex Astapchuk wrote:
> > > > > > >> > Hi Nathan,
> > > > > > >> >
> > > > > > >> >  > Failed to open JVM DLL:
> > > > > > >> >
> > > > > > >> > C:\bt-trunk\cc\projects\drlvm\trunk\build\win_ia32_msvc_debug
> > > > > > >>
> > > > > > >> \deploy\jdk\jre\bin\default\harmonyvm
> > > > > > >>
> > > > > > >> > DRLVM can not be run on Win2000: it uses 'vectored
exception
> > > > > > >> > handler' [1] (instead of old-fashion structured
exception
> > > handler),
> > > > > > >> > and this feature requires at least WinXP/Win2k3
[2].
> > > > > > >> >
> > > > > > >> > There may be more XP-specific functions I'm not
aware about,
> > > but
> > > > > > >> > at least this one will make the loading fail because
the loader
> > > > > > >> > can not find AddVectoredExceptionHandler export
in kernel32.dll
> > > .
> > > > > > >> >
> > > > > > >> > [1] vm\vmcore\src\util\win\nt_platform_utils.cpp
> > > > > > >> >      grep for AddVectoredExceptionHandler around
the line 63.
> > > > > > >> >
> > > > > > >> > [2] http://msdn2.microsoft.com/en-us/library/ms679274.aspx
> > > > > > >> >
> > > > > > >> > Requirements
> > > > > > >> > Client Requires Windows Vista or Windows XP.
> > > > > > >> > Server Requires Windows Server "Longhorn" or Windows
Server
> > > 2003.
> > > > > > >> > Header Declared in Winbase.h; include Windows.h.
> > > > > > >> > Library Use Kernel32.lib.
> > > > > > >> > DLL Requires Kernel32.dll.
> > > > >
> > > > > --
> > > > > Gregory
> > > > >
> > > >
> > >
> >
>

Mime
View raw message