Hello Gilles and Oscar,

unfortunately I didn't get anything useful. It's probably my fault,
because I'm still not very familiar with gdb or any other debugger.
I did the following things.


1st window:
-----------

tyr java 174 setenv OMPI_ATTACH 1
tyr java 175 mpijavac InitFinalizeMain.java 
warning: [path] bad path element
  "/usr/local/openmpi-1.9.0_64_gcc/lib64/shmem.jar":
  no such file or directory
1 warning
tyr java 176 mpiexec -np 1 java InitFinalizeMain



2nd window:
-----------

tyr java 379 ps -aef | grep java
noaccess  1345     1   0   May 22 ?         113:23 /usr/java/bin/java -server 
-Xmx128m -XX:+UseParallelGC -XX:ParallelGCThreads=4 
  fd1026  3661 10753   0 14:09:12 pts/14      0:00 mpiexec -np 1 java 
InitFinalizeMain
  fd1026  3677 13371   0 14:16:55 pts/2       0:00 grep java
  fd1026  3663  3661   0 14:09:12 pts/14      0:01 java -cp 
/home/fd1026/work/skripte/master/parallel/prog/mpi/java:/usr/local/jun
tyr java 380 /usr/local/gdb-7.6.1_64_gcc/bin/gdb
GNU gdb (GDB) 7.6.1
...
(gdb) attach 3663
Attaching to process 3663
[New process 3663]
Retry #1:
Retry #2:
Retry #3:
Retry #4:
0x7eadcb04 in ?? ()
(gdb) symbol-file /usr/local/openmpi-1.9.0_64_gcc/lib64/libmpi_java.so
Reading symbols from 
/export2/prog/SunOS_sparc/openmpi-1.9.0_64_gcc/lib64/libmpi_java.so.0.0.0...done.
(gdb) set var _dbg=0
No symbol "_dbg" in current context.
(gdb) set var JNI_OnLoad::_dbg=0
No symbol "_dbg" in specified context.
(gdb) set JNI_OnLoad::_dbg=0
No symbol "_dbg" in specified context.
(gdb) info threads
[New LWP 12]
[New LWP 11]
[New LWP 10]
[New LWP 9]
[New LWP 8]
[New LWP 7]
[New LWP 6]
[New LWP 5]
[New LWP 4]
[New LWP 3]
[New LWP 2]
  Id   Target Id         Frame 
  12   LWP 2             0x7eadc6b0 in ?? ()
  11   LWP 3             0x7eadcbb8 in ?? ()
  10   LWP 4             0x7eadcbb8 in ?? ()
  9    LWP 5             0x7eadcbb8 in ?? ()
  8    LWP 6             0x7eadcbb8 in ?? ()
  7    LWP 7             0x7eadcbb8 in ?? ()
  6    LWP 8             0x7ead8b0c in ?? ()
  5    LWP 9             0x7eadcbb8 in ?? ()
  4    LWP 10            0x7eadcbb8 in ?? ()
  3    LWP 11            0x7eadcbb8 in ?? ()
  2    LWP 12            0x7eadcbb8 in ?? ()
* 1    LWP 1             0x7eadcb04 in ?? ()
(gdb) 



It seems that "_dbg" is unknown and unavailable.

tyr java 399 grep _dbg 
/export2/src/openmpi-1.9/openmpi-dev-124-g91e9686/ompi/mpi/java/c/*
/export2/src/openmpi-1.9/openmpi-dev-124-g91e9686/ompi/mpi/java/c/mpi_MPI.c:    
    volatile int _dbg = 1;
/export2/src/openmpi-1.9/openmpi-dev-124-g91e9686/ompi/mpi/java/c/mpi_MPI.c:    
    while (_dbg) poll(NULL, 0, 1);
tyr java 400 nm /usr/local/openmpi-1.9.0_64_gcc/lib64/*.so | grep -i _dbg
tyr java 401 nm /usr/local/openmpi-1.9.0_64_gcc/lib64/*.so | grep -i JNI_OnLoad
[1057]  |              139688|                 444|FUNC |GLOB |0    |11     
|JNI_OnLoad
tyr java 402 



How can I set _dbg to zero to continue mpiexec? I also tried to
set a breakpoint for function JNI_OnLoad, but it seems, that the
function isn't called before SIGSEGV.


tyr java 177 unsetenv OMPI_ATTACH 
tyr java 178 /usr/local/gdb-7.6.1_64_gcc/bin/gdb mpiexec
GNU gdb (GDB) 7.6.1
...
(gdb) b mpi_MPI.c:JNI_OnLoad
No source file named mpi_MPI.c.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (mpi_MPI.c:JNI_OnLoad) pending.
(gdb) run -np 1 java InitFinalizeMain 
Starting program: /usr/local/openmpi-1.9.0_64_gcc/bin/mpiexec -np 1 java 
InitFinalizeMain
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
[New LWP    2        ]
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xffffffff7ea3c7f0, pid=3518, tid=2
...



tyr java 381 cat InitFinalizeMain.java 
import mpi.*;

public class InitFinalizeMain
{
  public static void main (String args[]) throws MPIException
  {
    MPI.Init (args);
    System.out.print ("Hello!\n");
    MPI.Finalize ();
  }
}


SIGSEGV happens in MPI.Init(args), because I can print a message
before I call the method.

tyr java 192 unsetenv OMPI_ATTACH
tyr java 193 mpijavac InitFinalizeMain.java
tyr java 194 mpiexec -np 1 java InitFinalizeMain
Before MPI.Init()
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xffffffff7ea3c7f0, pid=3697, tid=2
...



Any ideas, how I can continue? I couldn't find a C function for
MPI.Init() in a C file. Do you know, which function is called first,
so that I can set a breakpoint? By the way, I get the same error
for Solaris 10 x86_64.

tyr java 388 ssh sunpc1
...
sunpc1 java 106 mpijavac InitFinalizeMain.java
sunpc1 java 107 uname -a
SunOS sunpc1 5.10 Generic_147441-21 i86pc i386 i86pc Solaris
sunpc1 java 108 isainfo -k
amd64
sunpc1 java 109 mpiexec -np 1 java InitFinalizeMain
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xfffffd7fff1d77f0, pid=20256, tid=2


Thank you very much for any help in advance.

Kind regards

Siegmar



> thank you very much for your help.
> 
> > how did you configure openmpi ? which java version did you use ?
> > 
> > i just found a regression and you currently have to explicitly add
> > CFLAGS=-D_REENTRANT CPPFLAGS=-D_REENTRANT
> > to your configure command line
> 
> I added "-D_REENTRANT" to my command.
> 
> ../openmpi-dev-124-g91e9686/configure 
> --prefix=/usr/local/openmpi-1.9.0_64_gcc \
>   --libdir=/usr/local/openmpi-1.9.0_64_gcc/lib64 \
>   --with-jdk-bindir=/usr/local/jdk1.8.0/bin \
>   --with-jdk-headers=/usr/local/jdk1.8.0/include \
>   JAVA_HOME=/usr/local/jdk1.8.0 \
>   LDFLAGS="-m64" CC="gcc" CXX="g++" FC="gfortran" \
>   CFLAGS="-m64 -D_REENTRANT" CXXFLAGS="-m64" FCFLAGS="-m64" \
>   CPP="cpp" CXXCPP="cpp" \
>   CPPFLAGS="-D_REENTRANT" CXXCPPFLAGS="" \
>   --enable-mpi-cxx \
>   --enable-cxx-exceptions \
>   --enable-mpi-java \
>   --enable-heterogeneous \
>   --enable-mpi-thread-multiple \
>   --with-threads=posix \
>   --with-hwloc=internal \
>   --without-verbs \
>   --with-wrapper-cflags="-std=c11 -m64" \
>   --enable-debug \
>   |& tee log.configure.$SYSTEM_ENV.$MACHINE_ENV.64_gcc
> 
> I use Java 8.
> 
> tyr openmpi-1.9 112 java -version
> java version "1.8.0"
> Java(TM) SE Runtime Environment (build 1.8.0-b132)
> Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
> tyr openmpi-1.9 113 
> 
> Unfortunately I still get a SIGSEGV with openmpi-dev-124-g91e9686.
> I have applied your patch and will try to debug my small Java
> program tomorrow or next week and then let you know the result.

Reply via email to