On Tue, 2014-07-08 at 03:49 -0400, Karl Cronburg wrote:
> Hello,
> 
> I am trying to get memcheck (valgrind-3.10.0.SVN) to run Jikes RVM (3.1.3+hg)
> on an x86_64-linux machine in 32-bit mode. However when I run:
> 
> WRAP="valgrind --smc-check=all --undef-value-errors=no 
> --workaround-gcc296-bugs=yes"
> rvm -wrap "$WRAP" -X:gc:eagerMmapSpaces=true HelloWorld
> 
> I get a SIGSEGV in memcheck:
> 
> ==10692== Memcheck, a memory error detector
> ==10692== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
> ==10692== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright 
> info
> ==10692== Command: 
> /home/karl/r/jikesrvm/dist/development_x86_64-linux/JikesRVM 
> -X:ic=/home/karl/r/jikesrvm/dist/development_x86_64-linux/RVM.code.image 
> -X:id=/home/karl/r/jikesrvm/dist/development_x86_64-linux/RVM.data.image 
> -X:ir=/home/karl/r/jikesrvm/dist/development_x86_64-linux/RVM.rmap.image 
> -X:vmClasses=/home/karl/r/jikesrvm/dist/development_x86_64-linux/jksvm.jar:/home/karl/r/jikesrvm/dist/development_x86_64-linux/rvmrt.jar
>  -Duser.timezone=PDT 
> -Djava.home=/home/karl/r/jikesrvm/dist/development_x86_64-linux 
> -Dgnu.classpath.home.url=file:/home/karl/r/jikesrvm/dist/development_x86_64-linux
>  -Dgnu.classpath.vm.shortname=JikesRVM -Duser.home=/home/karl 
> -Duser.dir=/home/karl/r -Duser.name=karl -Dos.name=Linux 
> -Dos.version=3.8.0-42-generic -Dos.arch=x86_64 -X:gc:eagerMmapSpaces=true 
> HelloWorld
> ==10692== 
> ==10692== Warning: client switching stacks?  SP change: 0xfecf3a78 --> 
> 0x42048468
> ==10692==          to suppress, use: --max-stackframe=1127565808 or greater
> ==10692== Warning: client switching stacks?  SP change: 0x4f522d8 --> 
> 0x50c43000
> ==10692==          to suppress, use: --max-stackframe=1271860520 or greater
> ==10692== Warning: client switching stacks?  SP change: 0x57532d8 --> 
> 0x50c87000
> ==10692==          to suppress, use: --max-stackframe=1263746344 or greater
> ==10692==          further instances of this message will not be shown.
> --10692-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - 
> exiting
> --10692-- si_code=1;  Faulting address: 0x80000105;  sp: 0x82d10c7c
> 
> valgrind: the 'impossible' happened:
>    Killed by fatal signal
> 
> host stacktrace:
> ==10692==    at 0x380660F4: vgPlain_get_StackTrace_wrk (m_stacktrace.c:324)
> ==10692==    by 0x38066438: vgPlain_get_StackTrace (m_stacktrace.c:1441)
> ==10692==    by 0x3804992F: record_ExeContext_wrk (m_execontext.c:341)
> ==10692==    by 0x3801EFA4: vgMemCheck_set_allocated_at 
> (mc_malloc_wrappers.c:305)
> ==10692==    by 0x3801F349: create_MC_Chunk (mc_malloc_wrappers.c:203)
> ==10692==    by 0x3801F69E: vgMemCheck_new_block (mc_malloc_wrappers.c:393)
> ==10692==    by 0x3801F875: vgMemCheck_malloc (mc_malloc_wrappers.c:412)
> ==10692==    by 0x380A7E5E: vgPlain_scheduler (scheduler.c:1783)
> ==10692==    by 0x380BA357: run_a_thread_NORETURN (syswrap-linux.c:103)

> Any idea as to what's going on, or how I might debug the problem further?
> Any Valgrind flags or options I might be missing? The RVM runs fine
> on its' own, as well as in Nulgrind (and cachegrind and callgrind):

>From what I can see, the above happens when Valgrind is not able to
track properly the stack used by a thread.
The 'switching stacks' messages very probably indicate that the jikes
rvm does something special with stack.
If that is the case, then usually the problem can be solved by adding
client requests in the application code (the various VALGRIND_STACK_*
client requests in valgrind.h).


This might also happen due to the use of sigaltstack.
It is unclear to me how to properly inform Valgrind of such alternate
stack.

In both case, basically, the problem is that valgrind believes that the
stack goes from the current stack pointer value till the "last known
stack base". When changing stack; this can include non addressable
segments. The stack unwind code assumes however that everything is
accessible between the current sp and the stack base.

You might try to confirm the above by changing in m_stacktraces.c
   const Bool   debug = False;
to
   const Bool   debug = True;

and then be patient till you see the crash (as this will trace a lot
for each unwind).

Philippe




------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to