harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Egor Pasko <egor.pa...@gmail.com>
Subject Re: [drlvm] apr_dso_load error (path address out of bounds)
Date Wed, 04 Oct 2006 06:07:47 GMT
On the 0x1F8 day of Apache Harmony Armand Navabi wrote:
> Sorry about the last email, but there is something I think I should mention.
> 
> I recently checked out a clean copy and rebuilt from scratch.  I did not
> notice BUT since then, helloworld does actually run!!  It just hangs after
> it runs.  Now the behavior is very similar to  when I run "./java
> -showversion" (i.e. prints out version information and then hangs).  I plan
> to look into this.

You mean, it hangs right before the exit? And prints OK? Then the
library should load OK.

> But when I run gdb, I still see:
> apr_dso_load (res_handle=0x102, path=0x102 <Address 0x102 out of bounds>,
> pool=0x808fc78) at dso.c:139
> 139         os_handle = dlopen(path, flags);

And.. I suppose you applied the "gdb enabling" patch for that?
hm, I cannot believe this is a GDB problem... :(

There are some modes you can try for fun:
-Xem:opt -- use only agressive compiler (OPT)
-Xem:jet -- use only fast JIT (JET)
-Xint    -- do not use compilers, use interpreter (no libjitrino.so
            sould be loaded in this mode)

> Despite this, it seems to still run fine after that point (i.e. Hello World
> executes after all the libraries are loaded, even though every single load
> seems to fail because of the address not found problem).

Can you pass the library load in GDB? Does it work fine if it is not
single stepped?

> Anyway, I'm running hello world now, and so I'm happy.

not very much, though
Are you collecting HelloWorlds? :)

> Thanks,
> Armand
> 
> -----Original Message-----
> From: Armand Navabi [mailto:anavabi@purdue.edu] 
> Sent: Tuesday, October 03, 2006 3:22 PM
> To: harmony-dev@incubator.apache.org
> Subject: RE: [drlvm] apr_dso_load error (path address out of bounds)
> 
> I thought that perhaps a gdb backtrace may be helpful.  
> 
> Note: I also tried to go into dll_jit.cpp:62 and hard code the name of the
> dll_filename which is passed to apr_dso_load.  And still when I step into
> apr_dso_load that second argument path=0x102 <Address 0x102 out of bounds>.
> Perhaps the stack is getting messed up somehow.
> 
> Any ideas?
> 
> (gdb) bt
> #0  apr_dso_load (res_handle=0x102, path=0x102 <Address 0x102 out of
> bounds>, pool=0x808fc78) at dso.c:139
> #1  0xb6d99b61 in Dll_JIT (this=0x80a9650, 
>     dll_filename=0x80a9774
> "/scratch/anavabi/Harmony/enhanced/drlvm/build/deploy/jre/bin/default//libji
> trino.so")
>     at
> /scratch/anavabi/Harmony/enhanced/drlvm/vm/vmcore/src/jit/dll_jit.cpp:63
> #2  0xb6e4ff4e in vm_load_jit (
>     file_name=0x80a9774
> "/scratch/anavabi/Harmony/enhanced/drlvm/build/deploy/jre/bin/default//libji
> trino.so", 
>     handle=0xbfa9e51c) at
> /scratch/anavabi/Harmony/enhanced/drlvm/vm/vmcore/src/init/vm_main.cpp:629
> #3  0xb69afa9e in DrlEMImpl::buildChains (this=0x80a9480,
> config=@0xbfa9e620)
>     at /scratch/anavabi/Harmony/enhanced/drlvm/vm/em/src/DrlEMImpl.cpp:437
> #4  0xb69af256 in DrlEMImpl::init (this=0x80a9480) at
> /scratch/anavabi/Harmony/enhanced/drlvm/vm/em/src/DrlEMImpl.cpp:363
> #5  0xb69ad239 in DrlEMFactory::createAndInitEMInstance ()
>     at /scratch/anavabi/Harmony/enhanced/drlvm/vm/em/src/DrlEMImpl.cpp:52
> #6  0xb69c7a72 in CreateInstance (p_instance=0xb7022f88, pool=0x808dc70)
>     at /scratch/anavabi/Harmony/enhanced/drlvm/vm/em/src/em_intf.cpp:132
> #7  0xb6d95fae in CmCreateInstance (p_instance=0xb7022f88, name=0xb6f7eac4
> "em")
>     at
> /scratch/anavabi/Harmony/enhanced/drlvm/vm/vmstart/src/compmgr/component_man
> ager_impl.cpp:584
> #8  0xb6e4dd37 in process_properties_dlls (p_env=0xb7022de0)
>     at
> /scratch/anavabi/Harmony/enhanced/drlvm/vm/vmcore/src/init/vm_main.cpp:148
> #9  0xb6e4f0f6 in create_vm (p_env=0xb7022de0, vm_arguments=0xbfa9e8c0)
>     at
> /scratch/anavabi/Harmony/enhanced/drlvm/vm/vmcore/src/init/vm_main.cpp:356
> #10 0xb6dc6826 in JNI_CreateJavaVM (p_vm=0xbfa9e8b0, p_env=0xbfa9e8b4,
> vm_args=0xbfa9e8c0)
>     at
> /scratch/anavabi/Harmony/enhanced/drlvm/vm/vmcore/src/jni/jni.cpp:1270
> #11 0x0804962c in invocation ()
> #12 0x08048fd0 in gpProtectedMain ()
> #13 0x0804ac4c in signalProtectedMain ()
> #14 0xb7fb5e00 in hysig_protect () from
> /scratch/anavabi/Harmony/enhanced/drlvm/build/deploy/jre/bin/libhyprt.so
> #15 0x0804ad0c in main ()
> 
> -----Original Message-----
> From: Armand Navabi [mailto:anavabi@purdue.edu] 
> Sent: Monday, October 02, 2006 2:03 PM
> To: harmony-dev@incubator.apache.org
> Subject: [drlvm] apr_dso_load error (path address out of bounds)
> 
> I am still having trouble getting hellworld to run.  Currently the problem
> is that for some reason in dll_jit.cpp on line 62, where the call is made to
> apr_dso_load, the second parameter which is the path to the dll becomes
> address out of bounds in the apr_dso_load procedure.
> 
>  
> 
> Egor suggested that perhaps APR configured itself incorrectly on my system.
> Alexey suggested I try to run the APR test.  I ran the APR tests and all
> tests passed (in /build/lnx_ia32_gcc_debug/semis/extra/apr/src/test).
> 
>  
> 
> Below is what happens in gdb.  Also below that I have pasted what happens at
> the end of the output when I run ./java -Xthread -Xtrace helloworld.
> Another thing that is suspicious is that when I run ./java it works fine,
> but if I run "./java -Xthread -Xtrace" it does not run fine (it hangs inside
> GetObjectClass).  I have also pasted the end of the trace for this.
> 
>  
> 
> Let me know if there is any other debugging information I can provide.
> 
>  
> 
> (gdb) r helloworld
> 
> Starting program:
> /scratch/anavabi/Harmony/enhanced/drlvm/trunk/build/deploy/jre/bin/java
> helloworld
> 
> [Thread debugging using libthread_db enabled]
> 
> [New Thread 16384 (LWP 16947)]
> 
> [New Thread 32769 (LWP 16950)]
> 
> [New Thread 16386 (LWP 16951)]
> 
> Breakpoint 2 at 0xb6e28ca5: file
> /scratch/anavabi/Harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_main.cpp
> , line 628.
> 
> Pending breakpoint "vm_main.cpp:628" resolved
> 
> [Switching to Thread 16384 (LWP 16947)]
> 
>  
> 
> Breakpoint 2, vm_load_jit (file_name=0x80aa83c
> "/scratch/anavabi/Harmony/enhanced/drlvm/trunk/build/deploy/jre/bin/default/
> /libjitrino.so", handle=0xbff4ff4c)
> 
>     at
> /scratch/anavabi/Harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_main.cpp
> :628
> 
> 628             Dll_JIT* jit = new Dll_JIT(file_name);
> 
> Current language:  auto; currently c++
> 
> (gdb) s
> 
> Dll_JIT (this=0x80aa708, dll_filename=0x80aa83c
> "/scratch/anavabi/Harmony/enhanced/drlvm/trunk/build/deploy/jre/bin/default/
> /libjitrino.so")
> 
>     at
> /scratch/anavabi/Harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/dll_jit.cpp:
> 56
> 
> 56      {
> 
> (gdb) n
> 
> 59          memset((void *) &jit_flags, 0, sizeof(JIT_Flags));
> 
> (gdb) n
> 
> 60          apr_pool_create(&pool, 0);
> 
> (gdb) n
> 
> 62          if ((stat = apr_dso_load(&handle, dll_filename, pool)) !=
> APR_SUCCESS)
> 
> (gdb) p dll_filename
> 
> $1 = 0x80aa83c
> "/scratch/anavabi/Harmony/enhanced/drlvm/trunk/build/deploy/jre/bin/default/
> /libjitrino.so"
> 
> (gdb) s
> 
> apr_dso_load (res_handle=0x102, path=0x102 <Address 0x102 out of bounds>,
> pool=0x8090c30) at dso.c:139
> 
> 139         os_handle = dlopen(path, flags);
> 
> Current language:  auto; currently c
> 
> (gdb) p path
> 
> $2 = 0x102 <Address 0x102 out of bounds>
> 
>  
> 
>  
> 
> ./java -Xthread -Xtrace helloworld
> 
>  
> 
> .
> 
> [0x4000] : END class prepare, class name = java/lang/Runtime$ShutdownVM
> 
> [0x4000] : StartLoading class java/lang/RuntimePermission with loader
> 0x80be790
> 
> [0x8003] : gc_thread_init 0x807e718
> 
> [0x8003] : FindClass called, name = java/lang/Thread
> 
> [0x8003] : FindClass called, name = java/lang/Thread
> 
> [0x8003] : si_goto_previous from ip = (nil) (M2N)
> 
> [0x8003] : si_unwind_from_m2n, ip = (nil)
> 
> [0x8003] : si_goto_previous to ip = (nil) (M2N)
> 
> [0x8003] : StartLoading class java/lang/Thread with loader 0x8633d90
> 
> [0x8003] : 0x8633d90 0x807e658 I java/lang/Thread
> 
> [0x8003] : Loader U (0x8633d90) loading class: java/lang/Thread...
> 
> [0x8003] : enter method java/lang/ClassLoader loadClass
> (Ljava/lang/String;)Ljava/lang/Class;
> 
> [0x4000] : EM: compile done:[JET_DPGO n=789: OK]
> java/lang/Runtime::addShutdownHook(Ljava/lang/Thread;)V
> 
> (hangs here)
> 
>  
> 
>  
> 
> ./java -Xthread -Xtrace
> 
>  
> 
> .
> 
> [0x4000] : GetObjectClass called
> 
> [0x4000] : GetObjectClass: class = [Ljava/lang/Class;
> 
> [0x8003] : gc_thread_init 0x807e718
> 
> [0x8003] : FindClass called, name = java/lang/Thread
> 
> [0x8003] : FindClass called, name = java/lang/Thread
> 
> [0x8003] : si_goto_previous from ip = (nil) (M2N)
> 
> [0x8003] : si_unwind_from_m2n, ip = (nil)
> 
> [0x8003] : si_goto_previous to ip = (nil) (M2N)
> 
> [0x8003] : StartLoading class java/lang/Thread with loader 0x8633df0
> 
> [0x8003] : 0x8633df0 0x807e658 I java/lang/Thread
> 
> [0x8003] : Loader U (0x8633df0) loading class: java/lang/Thread...
> 
> [0x8003] : enter method java/lang/ClassLoader loadClass
> (Ljava/lang/String;)Ljava/lang/Class;
> 
> [0x4000] : GetObjectClass called
> 
>  
> 
>  
> 
> Thanks,
> 
> Armand
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 

-- 
Egor Pasko, Intel Managed Runtime Division


---------------------------------------------------------------------
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