jblas-project / jblas

Linear Algebra for Java
http://jblas.org
BSD 3-Clause "New" or "Revised" License
590 stars 149 forks source link

Fatal error in Solve.pinv #55

Open alexandrebouchard opened 9 years ago

alexandrebouchard commented 9 years ago

The following code:

import org.jblas.DoubleMatrix;
import org.jblas.Solve;

public class Problem
{
  public static void main(String [] args)
  {
    double [][] test = new double[][]{{1,0.5},{0.5,1}};
    for (int i = 0; i < 1000; i++)
      Solve.pinv(new DoubleMatrix(test));
  }
}

crashes with the error:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fff8a1e8b56, pid=70017, tid=6659
#
# JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libsystem_c.dylib+0x1b56]  memmove$VARIANT$sse42+0x16e
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# [ANONYMIZED]/hs_err_pid70017.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Platform: mac ox 10.8.5

nils-drechsel commented 9 years ago

We experienced the same problem with a matrix that is potentially singular in jblas

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007fff8a4484c0, pid=6448, tid=114055

JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build 1.8.0_45-b14) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode bsd-amd64 compressed oops) Problematic frame: C [libsystem_platform.dylib+0x14c0] _platform_memmove$VARIANT$Nehalem+0x180

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

If you would like to submit a bug report, please visit: http://bugreport.java.com/bugreport/crash.jsp The crash happened outside the Java Virtual Machine in native code. See problematic frame for where to report the bug.

Stack: [0x00000001f870c000,0x00000001f880c000], sp=0x00000001f880ade0, free space=1019k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [libsystem_platform.dylib+0x14c0] _platformmemmove$VARIANT$Nehalem+0x180 C [jblas8960126449284605903libjblas.dylib+0x148129] ilaenv+0xe3 C [jblas8960126449284605903libjblas.dylib+0x1af96] Java_org_jblas_NativeBlas_ilaenv+0x106 j org.jblas.NativeBlas.ilaenv(ILjava/lang/String;Ljava/lang/String;IIII)I+0 j org.jblas.SimpleBlas.gelsd(Lorg/jblas/DoubleMatrix;Lorg/jblas/DoubleMatrix;)V+60 j org.jblas.Solve.solveLeastSquares(Lorg/jblas/DoubleMatrix;Lorg/jblas/DoubleMatrix;)Lorg/jblas/DoubleMatrix;+56 j org.jblas.Solve.pinv(Lorg/jblas/DoubleMatrix;)Lorg/jblas/DoubleMatrix;+8

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j org.jblas.NativeBlas.ilaenv(ILjava/lang/String;Ljava/lang/String;IIII)I+0 j org.jblas.SimpleBlas.gelsd(Lorg/jblas/DoubleMatrix;Lorg/jblas/DoubleMatrix;)V+60 j org.jblas.Solve.solveLeastSquares(Lorg/jblas/DoubleMatrix;Lorg/jblas/DoubleMatrix;)Lorg/jblas/DoubleMatrix;+56 j org.jblas.Solve.pinv(Lorg/jblas/DoubleMatrix;)Lorg/jblas/DoubleMatrix;+8

Ruoyingw commented 5 years ago

I encounter the same error when repeating this pinv operation for a stream of matrices. The error is somewhat random. If one matrix succeeded one time, it could fail for a second time...

Has anybody resolved this problem?