Skip to content

Errors with -fcheck=all regarding string length #440

Closed

Description

@h-vetinari

While trying to find all inconsistencies in SLASET/DLASET-calls in the context of #438 (cf. #318, #425, #429), I ran a build with -fcheck=all to see if I had missed any (non-obvious) callsites.

While I could verify that #438 works as planned, this uncovered some additional errors:

  • 14 - CBLAS-xscblat2 (Failed):
    At line 157 of file $SRC_DIR/BLAS/SRC/sgemv.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'trans' (-525502495/1)
    
  • 15 - CBLAS-xscblat3 (Failed):
    At line 188 of file $SRC_DIR/BLAS/SRC/sgemm.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'transa' (-1730907187/1)
    
  • 17 - CBLAS-xdcblat2 (Failed):
    At line 157 of file $SRC_DIR/BLAS/SRC/dgemv.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'trans' (-1442584295/1)
    
  • 18 - CBLAS-xdcblat3 (Failed):
    At line 188 of file $SRC_DIR/BLAS/SRC/dgemm.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'transb' (0/1)
    
  • 20 - CBLAS-xccblat2 (Failed):
    At line 159 of file $SRC_DIR/BLAS/SRC/cgemv.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'trans' (-1401260171/1)
    
  • 21 - CBLAS-xccblat3 (Failed):
    At line 188 of file $SRC_DIR/BLAS/SRC/cgemm.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'transa' (0/1)
    
  • 23 - CBLAS-xzcblat2 (Failed):
    At line 188 of file $SRC_DIR/BLAS/SRC/zgemm.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'transa' (-1006702259/1)
    
  • 24 - CBLAS-xzcblat3 (Failed):
    At line 155 of file $SRC_DIR/BLAS/SRC/zhemv.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'uplo' (0/1)
    
  • 119 - example_DGELS_rowmajor (Failed):
    At line 183 of file $SRC_DIR/SRC/dgels.f
    Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'trans' (-81117184/1)
    

Full error log below:

Details
Test project $SRC_DIR/build
        Start   1: BLAS-xblat1s
        Start   2: BLAS-xblat2s
  1/120 Test   #1: BLAS-xblat1s .....................   Passed    0.01 sec
        Start   3: BLAS-xblat3s
  2/120 Test   #2: BLAS-xblat2s .....................   Passed    0.03 sec
        Start   4: BLAS-xblat1d
  3/120 Test   #4: BLAS-xblat1d .....................   Passed    0.01 sec
        Start   5: BLAS-xblat2d
  4/120 Test   #3: BLAS-xblat3s .....................   Passed    0.04 sec
        Start   6: BLAS-xblat3d
  5/120 Test   #5: BLAS-xblat2d .....................   Passed    0.03 sec
        Start   7: BLAS-xblat1c
  6/120 Test   #7: BLAS-xblat1c .....................   Passed    0.01 sec
        Start   8: BLAS-xblat2c
  7/120 Test   #6: BLAS-xblat3d .....................   Passed    0.04 sec
        Start   9: BLAS-xblat3c
  8/120 Test   #8: BLAS-xblat2c .....................   Passed    0.04 sec
        Start  10: BLAS-xblat1z
  9/120 Test  #10: BLAS-xblat1z .....................   Passed    0.01 sec
        Start  11: BLAS-xblat2z
 10/120 Test   #9: BLAS-xblat3c .....................   Passed    0.05 sec
        Start  12: BLAS-xblat3z
 11/120 Test  #11: BLAS-xblat2z .....................   Passed    0.04 sec
        Start  13: CBLAS-xscblat1
 12/120 Test  #13: CBLAS-xscblat1 ...................   Passed    0.01 sec
        Start  14: CBLAS-xscblat2
 13/120 Test  #12: BLAS-xblat3z .....................   Passed    0.05 sec
        Start  15: CBLAS-xscblat3
 14/120 Test  #14: CBLAS-xscblat2 ...................***Failed    0.03 sec
Running: $SRC_DIR/build/bin/xscblat2
ARGS= OUTPUT_FILE;$SRC_DIR/build/CBLAS/testing/stest2.out;ERROR_FILE;$SRC_DIR/build/CBLAS/testing/stest2.out.err;INPUT_FILE;$SRC_DIR/CBLAS/testing/sin2
Test OUTPUT:
 TESTS OF THE REAL             LEVEL 2 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   0     1     2     3     5     9
   FOR K                   0     1     2     4
   FOR INCX AND INCY       1     2    -1    -2
   FOR ALPHA             0.0   1.0   0.7
   FOR BETA              0.0   1.0   0.9

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07


Test ERROR:
At line 157 of file $SRC_DIR/BLAS/SRC/sgemv.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'trans' (-525502495/1)

Error termination. Backtrace:
#0  0x1549dffc5b0d in ???
#1  0x1549e0ad776a in ???
#2  0x55e74c1fad56 in ???
#3  0x55e74c1f67ba in ???
#4  0x55e74c1e6070 in ???
#5  0x1549e00b8d1f in ???
#6  0x55e74c1e609c in ???

CMake Error at $SRC_DIR/TESTING/runtest.cmake:36 (message):
  Test
  $SRC_DIR/build/bin/xscblat2
  returned 2



        Start  16: CBLAS-xdcblat1
 15/120 Test  #15: CBLAS-xscblat3 ...................***Failed    0.03 sec
Running: $SRC_DIR/build/bin/xscblat3
ARGS= OUTPUT_FILE;$SRC_DIR/build/CBLAS/testing/stest3.out;ERROR_FILE;$SRC_DIR/build/CBLAS/testing/stest3.out.err;INPUT_FILE;$SRC_DIR/CBLAS/testing/sin3
Test OUTPUT:
 TESTS OF THE REAL             LEVEL 3 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   0     1     2     3     5     9
   FOR ALPHA             0.0   1.0   0.7
   FOR BETA              0.0   1.0   1.3

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07


Test ERROR:
At line 188 of file $SRC_DIR/BLAS/SRC/sgemm.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'transa' (-1730907187/1)

Error termination. Backtrace:
#0  0x14a6982407d6 in ???
#1  0x14a698d472e8 in ???
#2  0x562505ce72b4 in ???
#3  0x562505ce3bac in ???
#4  0x562505cd7070 in ???
#5  0x14a698326d1f in ???
#6  0x562505cd709c in ???

CMake Error at $SRC_DIR/TESTING/runtest.cmake:36 (message):
  Test
  $SRC_DIR/build/bin/xscblat3
  returned 2



        Start  17: CBLAS-xdcblat2
 16/120 Test  #16: CBLAS-xdcblat1 ...................   Passed    0.01 sec
        Start  18: CBLAS-xdcblat3
 17/120 Test  #17: CBLAS-xdcblat2 ...................***Failed    0.03 sec
Running: $SRC_DIR/build/bin/xdcblat2
ARGS= OUTPUT_FILE;$SRC_DIR/build/CBLAS/testing/dtest2.out;ERROR_FILE;$SRC_DIR/build/CBLAS/testing/dtest2.out.err;INPUT_FILE;$SRC_DIR/CBLAS/testing/din2
Test OUTPUT:
 TESTS OF THE DOUBLE PRECISION LEVEL 2 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   0     1     2     3     5     9
   FOR K                   0     1     2     4
   FOR INCX AND INCY       1     2    -1    -2
   FOR ALPHA             0.0   1.0   0.7
   FOR BETA              0.0   1.0   0.9

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  2.2D-16


Test ERROR:
At line 157 of file $SRC_DIR/BLAS/SRC/dgemv.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'trans' (-1442584295/1)

Error termination. Backtrace:
#0  0x1528a953fc65 in ???
#1  0x1528aa03e9ce in ???
#2  0x55cc604a7e0e in ???
#3  0x55cc604a382e in ???
#4  0x55cc60493070 in ???
#5  0x1528a961cd1f in ???
#6  0x55cc6049309c in ???

CMake Error at $SRC_DIR/TESTING/runtest.cmake:36 (message):
  Test
  $SRC_DIR/build/bin/xdcblat2
  returned 2



        Start  19: CBLAS-xccblat1
 18/120 Test  #18: CBLAS-xdcblat3 ...................***Failed    0.03 sec
Running: $SRC_DIR/build/bin/xdcblat3
ARGS= OUTPUT_FILE;$SRC_DIR/build/CBLAS/testing/dtest3.out;ERROR_FILE;$SRC_DIR/build/CBLAS/testing/dtest3.out.err;INPUT_FILE;$SRC_DIR/CBLAS/testing/din3
Test OUTPUT:
 TESTS OF THE DOUBLE PRECISION LEVEL 3 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   1     2     3     5     7     9
   FOR ALPHA             0.0   1.0   0.7
   FOR BETA              0.0   1.0   1.3

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  2.2D-16


Test ERROR:
At line 188 of file $SRC_DIR/BLAS/SRC/dgemm.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'transb' (0/1)

Error termination. Backtrace:
#0  0x152f36fa78e0 in ???
#1  0x152f37a9b4f8 in ???
#2  0x5615a7d047ac in ???
#3  0x5615a7d010ad in ???
#4  0x5615a7cf4070 in ???
#5  0x152f37077d1f in ???
#6  0x5615a7cf409c in ???

CMake Error at $SRC_DIR/TESTING/runtest.cmake:36 (message):
  Test
  $SRC_DIR/build/bin/xdcblat3
  returned 2



        Start  20: CBLAS-xccblat2
 19/120 Test  #19: CBLAS-xccblat1 ...................   Passed    0.01 sec
        Start  21: CBLAS-xccblat3
 20/120 Test  #20: CBLAS-xccblat2 ...................***Failed    0.03 sec
Running: $SRC_DIR/build/bin/xccblat2
ARGS= OUTPUT_FILE;$SRC_DIR/build/CBLAS/testing/ctest2.out;ERROR_FILE;$SRC_DIR/build/CBLAS/testing/ctest2.out.err;INPUT_FILE;$SRC_DIR/CBLAS/testing/cin2
Test OUTPUT:
 TESTS OF THE COMPLEX          LEVEL 2 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   0     1     2     3     5     9
   FOR K                   0     1     2     4
   FOR INCX AND INCY       1     2    -1    -2
   FOR ALPHA          ( 0.0, 0.0)  ( 1.0, 0.0)  ( 0.7,-0.9)  
   FOR BETA           ( 0.0, 0.0)  ( 1.0, 0.0)  ( 1.3,-1.1)  

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07


Test ERROR:
At line 159 of file $SRC_DIR/BLAS/SRC/cgemv.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'trans' (-1401260171/1)

Error termination. Backtrace:
#0  0x14f7abcbbe11 in ???
#1  0x14f7ac7a771d in ???
#2  0x560756e3bc98 in ???
#3  0x560756e364d3 in ???
#4  0x560756e25070 in ???
#5  0x14f7abd82d1f in ???
#6  0x560756e2509c in ???

CMake Error at $SRC_DIR/TESTING/runtest.cmake:36 (message):
  Test
  $SRC_DIR/build/bin/xccblat2
  returned 2



        Start  22: CBLAS-xzcblat1
 21/120 Test  #21: CBLAS-xccblat3 ...................***Failed    0.03 sec
Running: $SRC_DIR/build/bin/xccblat3
ARGS= OUTPUT_FILE;$SRC_DIR/build/CBLAS/testing/ctest3.out;ERROR_FILE;$SRC_DIR/build/CBLAS/testing/ctest3.out.err;INPUT_FILE;$SRC_DIR/CBLAS/testing/cin3
Test OUTPUT:
 cblas_cgemm  PASSED THE TESTS OF ERROR-EXITS
 TESTS OF THE COMPLEX          LEVEL 3 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   0     1     2     3     5     9
   FOR ALPHA          ( 0.0, 0.0)  ( 1.0, 0.0)  ( 0.7,-0.9)  
   FOR BETA           ( 0.0, 0.0)  ( 1.0, 0.0)  ( 1.3,-1.1)  

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07



Test ERROR:
At line 188 of file $SRC_DIR/BLAS/SRC/cgemm.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'transa' (0/1)

Error termination. Backtrace:
#0  0x14ee6fcc58b5 in ???
#1  0x14ee70799f06 in ???
#2  0x55a5d8b7f7ab in ???
#3  0x55a5d8b7c66e in ???
#4  0x55a5d8b7f62f in ???
#5  0x55a5d8b6f070 in ???
#6  0x14ee6fd76d1f in ???
#7  0x55a5d8b6f09c in ???

CMake Error at $SRC_DIR/TESTING/runtest.cmake:36 (message):
  Test
  $SRC_DIR/build/bin/xccblat3
  returned 2



        Start  23: CBLAS-xzcblat2
 22/120 Test  #22: CBLAS-xzcblat1 ...................   Passed    0.02 sec
        Start  24: CBLAS-xzcblat3
 23/120 Test  #24: CBLAS-xzcblat3 ...................***Failed    0.03 sec
Running: $SRC_DIR/build/bin/xzcblat3
ARGS= OUTPUT_FILE;$SRC_DIR/build/CBLAS/testing/ztest3.out;ERROR_FILE;$SRC_DIR/build/CBLAS/testing/ztest3.out.err;INPUT_FILE;$SRC_DIR/CBLAS/testing/zin3
Test OUTPUT:
TESTS OF THE COMPLEX*16        LEVEL 3 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   0     1     2     3     5     9
   FOR ALPHA          ( 0.0, 0.0)  ( 1.0, 0.0)  ( 0.7,-0.9)  
   FOR BETA           ( 0.0, 0.0)  ( 1.0, 0.0)  ( 1.3,-1.1)  

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  2.2E-16


Test ERROR:
At line 188 of file $SRC_DIR/BLAS/SRC/zgemm.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'transa' (-1006702259/1)

Error termination. Backtrace:
#0  0x1526c35390f0 in ???
#1  0x1526c3fef076 in ???
#2  0x558fa73db724 in ???
#3  0x558fa73d68c4 in ???
#4  0x558fa73c7070 in ???
#5  0x1526c35c1d1f in ???
#6  0x558fa73c709c in ???

CMake Error at $SRC_DIR/TESTING/runtest.cmake:36 (message):
  Test
  $SRC_DIR/build/bin/xzcblat3
  returned 2



        Start  25: example1_CBLAS
 24/120 Test  #25: example1_CBLAS ...................   Passed    0.01 sec
        Start  26: example2_CBLAS
 25/120 Test  #26: example2_CBLAS ...................   Passed    0.00 sec
        Start  27: LAPACK-xlintsts_stest_in
 26/120 Test  #23: CBLAS-xzcblat2 ...................***Failed    0.08 sec
Running: $SRC_DIR/build/bin/xzcblat2
ARGS= OUTPUT_FILE;$SRC_DIR/build/CBLAS/testing/ztest2.out;ERROR_FILE;$SRC_DIR/build/CBLAS/testing/ztest2.out.err;INPUT_FILE;$SRC_DIR/CBLAS/testing/zin2
Test OUTPUT:
 cblas_zgemv  PASSED THE TESTS OF ERROR-EXITS
 cblas_zgbmv  PASSED THE TESTS OF ERROR-EXITS
 TESTS OF THE COMPLEX*16      LEVEL 2 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   0     1     2     3     5     9
   FOR K                   0     1     2     4
   FOR INCX AND INCY       1     2    -1    -2
   FOR ALPHA          ( 0.0, 0.0)  ( 1.0, 0.0)  ( 0.7,-0.9)  
   FOR BETA           ( 0.0, 0.0)  ( 1.0, 0.0)  ( 1.3,-1.1)  

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  2.2E-16


 cblas_zgemv  PASSED THE COMPUTATIONAL TESTS (  3460 CALLS)
 cblas_zgemv  PASSED THE COMPUTATIONAL TESTS (  3460 CALLS)


 cblas_zgbmv  PASSED THE COMPUTATIONAL TESTS ( 13828 CALLS)
 cblas_zgbmv  PASSED THE COMPUTATIONAL TESTS ( 13828 CALLS)


Test ERROR:
At line 155 of file $SRC_DIR/BLAS/SRC/zhemv.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'uplo' (0/1)

Error termination. Backtrace:
#0  0x148e4de78e00 in ???
#1  0x148e4e940175 in ???
#2  0x556148eb4679 in ???
#3  0x556148eaf491 in ???
#4  0x556148e9e070 in ???
#5  0x148e4df15d1f in ???
#6  0x556148e9e09c in ???

CMake Error at $SRC_DIR/TESTING/runtest.cmake:36 (message):
  Test
  $SRC_DIR/build/bin/xzcblat2
  returned 2



        Start  28: LAPACK-xlintstrfs_stest_rfp_in
 27/120 Test  #28: LAPACK-xlintstrfs_stest_rfp_in ...   Passed    0.39 sec
        Start  29: LAPACK-xeigtsts_nep_in
 28/120 Test  #29: LAPACK-xeigtsts_nep_in ...........   Passed    0.10 sec
        Start  30: LAPACK-xeigtsts_sep_in
 29/120 Test  #30: LAPACK-xeigtsts_sep_in ...........   Passed    0.67 sec
        Start  31: LAPACK-xeigtsts_se2_in
 30/120 Test  #27: LAPACK-xlintsts_stest_in .........   Passed    6.18 sec
        Start  32: LAPACK-xeigtsts_svd_in
 31/120 Test  #32: LAPACK-xeigtsts_svd_in ...........   Passed    6.58 sec
        Start  33: LAPACK-xeigtsts_sec_in
 32/120 Test  #33: LAPACK-xeigtsts_sec_in ...........   Passed    0.42 sec
        Start  34: LAPACK-xeigtsts_sed_in
 33/120 Test  #34: LAPACK-xeigtsts_sed_in ...........   Passed    0.14 sec
        Start  35: LAPACK-xeigtsts_sgg_in
 34/120 Test  #35: LAPACK-xeigtsts_sgg_in ...........   Passed    0.08 sec
        Start  36: LAPACK-xeigtsts_sgd_in
 35/120 Test  #36: LAPACK-xeigtsts_sgd_in ...........   Passed    0.23 sec
        Start  37: LAPACK-xeigtsts_ssb_in
 36/120 Test  #37: LAPACK-xeigtsts_ssb_in ...........   Passed    3.70 sec
        Start  38: LAPACK-xeigtsts_ssg_in
 37/120 Test  #38: LAPACK-xeigtsts_ssg_in ...........   Passed   52.21 sec
        Start  39: LAPACK-xeigtsts_sbal_in
 38/120 Test  #39: LAPACK-xeigtsts_sbal_in ..........   Passed    0.01 sec
        Start  40: LAPACK-xeigtsts_sbak_in
 39/120 Test  #40: LAPACK-xeigtsts_sbak_in ..........   Passed    0.03 sec
        Start  41: LAPACK-xeigtsts_sgbal_in
 40/120 Test  #41: LAPACK-xeigtsts_sgbal_in .........   Passed    0.01 sec
        Start  42: LAPACK-xeigtsts_sgbak_in
 41/120 Test  #42: LAPACK-xeigtsts_sgbak_in .........   Passed    0.01 sec
        Start  43: LAPACK-xeigtsts_sbb_in
 42/120 Test  #43: LAPACK-xeigtsts_sbb_in ...........   Passed    0.04 sec
        Start  44: LAPACK-xeigtsts_glm_in
 43/120 Test  #44: LAPACK-xeigtsts_glm_in ...........   Passed    0.02 sec
        Start  45: LAPACK-xeigtsts_gqr_in
 44/120 Test  #45: LAPACK-xeigtsts_gqr_in ...........   Passed    0.04 sec
        Start  46: LAPACK-xeigtsts_gsv_in
 45/120 Test  #46: LAPACK-xeigtsts_gsv_in ...........   Passed    0.05 sec
        Start  47: LAPACK-xeigtsts_csd_in
 46/120 Test  #47: LAPACK-xeigtsts_csd_in ...........   Passed    0.03 sec
        Start  48: LAPACK-xeigtsts_lse_in
 47/120 Test  #48: LAPACK-xeigtsts_lse_in ...........   Passed    0.02 sec
        Start  49: LAPACK-xlintstd_dtest_in
 48/120 Test  #49: LAPACK-xlintstd_dtest_in .........   Passed    6.21 sec
        Start  50: LAPACK-xlintstrfd_dtest_rfp_in
 49/120 Test  #50: LAPACK-xlintstrfd_dtest_rfp_in ...   Passed    0.41 sec
        Start  51: LAPACK-xeigtstd_nep_in
 50/120 Test  #51: LAPACK-xeigtstd_nep_in ...........   Passed    0.13 sec
        Start  52: LAPACK-xeigtstd_sep_in
 51/120 Test  #52: LAPACK-xeigtstd_sep_in ...........   Passed    0.98 sec
        Start  53: LAPACK-xeigtstd_se2_in
 52/120 Test  #31: LAPACK-xeigtsts_se2_in ...........   Passed   83.43 sec
        Start  54: LAPACK-xeigtstd_svd_in
 53/120 Test  #54: LAPACK-xeigtstd_svd_in ...........   Passed    8.95 sec
        Start  55: LAPACK-xeigtstd_dec_in
 54/120 Test  #55: LAPACK-xeigtstd_dec_in ...........   Passed    0.28 sec
        Start  56: LAPACK-xeigtstd_ded_in
 55/120 Test  #56: LAPACK-xeigtstd_ded_in ...........   Passed    0.16 sec
        Start  57: LAPACK-xeigtstd_dgg_in
 56/120 Test  #57: LAPACK-xeigtstd_dgg_in ...........   Passed    0.09 sec
        Start  58: LAPACK-xeigtstd_dgd_in
 57/120 Test  #58: LAPACK-xeigtstd_dgd_in ...........   Passed    0.28 sec
        Start  59: LAPACK-xeigtstd_dsb_in
 58/120 Test  #59: LAPACK-xeigtstd_dsb_in ...........   Passed    3.51 sec
        Start  60: LAPACK-xeigtstd_dsg_in
 59/120 Test  #60: LAPACK-xeigtstd_dsg_in ...........   Passed   87.54 sec
        Start  61: LAPACK-xeigtstd_dbal_in
 60/120 Test  #61: LAPACK-xeigtstd_dbal_in ..........   Passed    0.01 sec
        Start  62: LAPACK-xeigtstd_dbak_in
 61/120 Test  #62: LAPACK-xeigtstd_dbak_in ..........   Passed    0.01 sec
        Start  63: LAPACK-xeigtstd_dgbal_in
 62/120 Test  #63: LAPACK-xeigtstd_dgbal_in .........   Passed    0.01 sec
        Start  64: LAPACK-xeigtstd_dgbak_in
 63/120 Test  #64: LAPACK-xeigtstd_dgbak_in .........   Passed    0.01 sec
        Start  65: LAPACK-xeigtstd_dbb_in
 64/120 Test  #65: LAPACK-xeigtstd_dbb_in ...........   Passed    0.04 sec
        Start  66: LAPACK-xeigtstd_glm_in
 65/120 Test  #66: LAPACK-xeigtstd_glm_in ...........   Passed    0.02 sec
        Start  67: LAPACK-xeigtstd_gqr_in
 66/120 Test  #67: LAPACK-xeigtstd_gqr_in ...........   Passed    0.04 sec
        Start  68: LAPACK-xeigtstd_gsv_in
 67/120 Test  #68: LAPACK-xeigtstd_gsv_in ...........   Passed    0.03 sec
        Start  69: LAPACK-xeigtstd_csd_in
 68/120 Test  #69: LAPACK-xeigtstd_csd_in ...........   Passed    0.02 sec
        Start  70: LAPACK-xeigtstd_lse_in
 69/120 Test  #70: LAPACK-xeigtstd_lse_in ...........   Passed    0.02 sec
        Start  71: LAPACK-xlintstc_ctest_in
 70/120 Test  #71: LAPACK-xlintstc_ctest_in .........   Passed   12.54 sec
        Start  72: LAPACK-xlintstrfc_ctest_rfp_in
 71/120 Test  #53: LAPACK-xeigtstd_se2_in ...........   Passed  120.89 sec
        Start  73: LAPACK-xeigtstc_nep_in
 72/120 Test  #73: LAPACK-xeigtstc_nep_in ...........   Passed    0.19 sec
        Start  74: LAPACK-xeigtstc_sep_in
 73/120 Test  #72: LAPACK-xlintstrfc_ctest_rfp_in ...   Passed    1.10 sec
        Start  75: LAPACK-xeigtstc_se2_in
 74/120 Test  #74: LAPACK-xeigtstc_sep_in ...........   Passed    1.12 sec
        Start  76: LAPACK-xeigtstc_svd_in
 75/120 Test  #76: LAPACK-xeigtstc_svd_in ...........   Passed    9.62 sec
        Start  77: LAPACK-xeigtstc_cec_in
 76/120 Test  #77: LAPACK-xeigtstc_cec_in ...........   Passed    0.05 sec
        Start  78: LAPACK-xeigtstc_ced_in
 77/120 Test  #78: LAPACK-xeigtstc_ced_in ...........   Passed    0.23 sec
        Start  79: LAPACK-xeigtstc_cgg_in
 78/120 Test  #79: LAPACK-xeigtstc_cgg_in ...........   Passed    0.13 sec
        Start  80: LAPACK-xeigtstc_cgd_in
 79/120 Test  #80: LAPACK-xeigtstc_cgd_in ...........   Passed    0.32 sec
        Start  81: LAPACK-xeigtstc_csb_in
 80/120 Test  #81: LAPACK-xeigtstc_csb_in ...........   Passed    3.94 sec
        Start  82: LAPACK-xeigtstc_csg_in
 81/120 Test  #82: LAPACK-xeigtstc_csg_in ...........   Passed   70.21 sec
        Start  83: LAPACK-xeigtstc_cbal_in
 82/120 Test  #83: LAPACK-xeigtstc_cbal_in ..........   Passed    0.01 sec
        Start  84: LAPACK-xeigtstc_cbak_in
 83/120 Test  #84: LAPACK-xeigtstc_cbak_in ..........   Passed    0.01 sec
        Start  85: LAPACK-xeigtstc_cgbal_in
 84/120 Test  #85: LAPACK-xeigtstc_cgbal_in .........   Passed    0.01 sec
        Start  86: LAPACK-xeigtstc_cgbak_in
 85/120 Test  #86: LAPACK-xeigtstc_cgbak_in .........   Passed    0.01 sec
        Start  87: LAPACK-xeigtstc_cbb_in
 86/120 Test  #87: LAPACK-xeigtstc_cbb_in ...........   Passed    0.06 sec
        Start  88: LAPACK-xeigtstc_glm_in
 87/120 Test  #88: LAPACK-xeigtstc_glm_in ...........   Passed    0.03 sec
        Start  89: LAPACK-xeigtstc_gqr_in
 88/120 Test  #89: LAPACK-xeigtstc_gqr_in ...........   Passed    0.05 sec
        Start  90: LAPACK-xeigtstc_gsv_in
 89/120 Test  #90: LAPACK-xeigtstc_gsv_in ...........   Passed    0.04 sec
        Start  91: LAPACK-xeigtstc_csd_in
 90/120 Test  #91: LAPACK-xeigtstc_csd_in ...........   Passed    0.02 sec
        Start  92: LAPACK-xeigtstc_lse_in
 91/120 Test  #92: LAPACK-xeigtstc_lse_in ...........   Passed    0.02 sec
        Start  93: LAPACK-xlintstz_ztest_in
 92/120 Test  #93: LAPACK-xlintstz_ztest_in .........   Passed   13.48 sec
        Start  94: LAPACK-xlintstrfz_ztest_rfp_in
 93/120 Test  #94: LAPACK-xlintstrfz_ztest_rfp_in ...   Passed    1.18 sec
        Start  95: LAPACK-xeigtstz_nep_in
 94/120 Test  #95: LAPACK-xeigtstz_nep_in ...........   Passed    0.22 sec
        Start  96: LAPACK-xeigtstz_sep_in
 95/120 Test  #96: LAPACK-xeigtstz_sep_in ...........   Passed    1.42 sec
        Start  97: LAPACK-xeigtstz_se2_in
 96/120 Test  #75: LAPACK-xeigtstc_se2_in ...........   Passed  106.80 sec
        Start  98: LAPACK-xeigtstz_svd_in
 97/120 Test  #98: LAPACK-xeigtstz_svd_in ...........   Passed   12.80 sec
        Start  99: LAPACK-xeigtstz_zec_in
 98/120 Test  #99: LAPACK-xeigtstz_zec_in ...........   Passed    0.05 sec
        Start 100: LAPACK-xeigtstz_zed_in
 99/120 Test #100: LAPACK-xeigtstz_zed_in ...........   Passed    0.28 sec
        Start 101: LAPACK-xeigtstz_zgg_in
100/120 Test #101: LAPACK-xeigtstz_zgg_in ...........   Passed    0.17 sec
        Start 102: LAPACK-xeigtstz_zgd_in
101/120 Test #102: LAPACK-xeigtstz_zgd_in ...........   Passed    0.46 sec
        Start 103: LAPACK-xeigtstz_zsb_in
102/120 Test #103: LAPACK-xeigtstz_zsb_in ...........   Passed    3.92 sec
        Start 104: LAPACK-xeigtstz_zsg_in
103/120 Test #104: LAPACK-xeigtstz_zsg_in ...........   Passed   60.35 sec
        Start 105: LAPACK-xeigtstz_zbal_in
104/120 Test #105: LAPACK-xeigtstz_zbal_in ..........   Passed    0.01 sec
        Start 106: LAPACK-xeigtstz_zbak_in
105/120 Test #106: LAPACK-xeigtstz_zbak_in ..........   Passed    0.01 sec
        Start 107: LAPACK-xeigtstz_zgbal_in
106/120 Test #107: LAPACK-xeigtstz_zgbal_in .........   Passed    0.01 sec
        Start 108: LAPACK-xeigtstz_zgbak_in
107/120 Test #108: LAPACK-xeigtstz_zgbak_in .........   Passed    0.01 sec
        Start 109: LAPACK-xeigtstz_zbb_in
108/120 Test #109: LAPACK-xeigtstz_zbb_in ...........   Passed    0.06 sec
        Start 110: LAPACK-xeigtstz_glm_in
109/120 Test #110: LAPACK-xeigtstz_glm_in ...........   Passed    0.03 sec
        Start 111: LAPACK-xeigtstz_gqr_in
110/120 Test #111: LAPACK-xeigtstz_gqr_in ...........   Passed    0.06 sec
        Start 112: LAPACK-xeigtstz_gsv_in
111/120 Test #112: LAPACK-xeigtstz_gsv_in ...........   Passed    0.04 sec
        Start 113: LAPACK-xeigtstz_csd_in
112/120 Test #113: LAPACK-xeigtstz_csd_in ...........   Passed    0.03 sec
        Start 114: LAPACK-xeigtstz_lse_in
113/120 Test #114: LAPACK-xeigtstz_lse_in ...........   Passed    0.02 sec
        Start 115: LAPACK-xlintstds_dstest_in
114/120 Test #115: LAPACK-xlintstds_dstest_in .......   Passed    1.50 sec
        Start 116: LAPACK-xlintstzc_zctest_in
115/120 Test #116: LAPACK-xlintstzc_zctest_in .......   Passed    2.20 sec
        Start 117: example_DGESV_rowmajor
116/120 Test #117: example_DGESV_rowmajor ...........   Passed    0.01 sec
        Start 118: example_DGESV_colmajor
117/120 Test #118: example_DGESV_colmajor ...........   Passed    0.01 sec
        Start 119: example_DGELS_rowmajor
118/120 Test #119: example_DGELS_rowmajor ...........***Failed    0.00 sec
At line 183 of file $SRC_DIR/SRC/dgels.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'trans' (-81117184/1)

 Entry Matrix A
   1.00   1.00   1.00
   2.00   3.00   4.00
   3.00   5.00   2.00
   4.00   2.00   5.00
   5.00   4.00   3.00

 Right Hand Side b
 -10.00  -3.00
  12.00  14.00
  14.00  12.00

LAPACKE_dgels (row-major, high-level) Example Program Results

        Start 120: example_DGELS_colmajor
119/120 Test #120: example_DGELS_colmajor ...........   Passed    0.01 sec
120/120 Test  #97: LAPACK-xeigtstz_se2_in ...........   Passed   87.50 sec

Errors while running CTest
93% tests passed, 9 tests failed out of 120

Total Test time (real) = 388.68 sec

The following tests FAILED:
	 14 - CBLAS-xscblat2 (Failed)
	 15 - CBLAS-xscblat3 (Failed)
	 17 - CBLAS-xdcblat2 (Failed)
	 18 - CBLAS-xdcblat3 (Failed)
	 20 - CBLAS-xccblat2 (Failed)
	 21 - CBLAS-xccblat3 (Failed)
	 23 - CBLAS-xzcblat2 (Failed)
	 24 - CBLAS-xzcblat3 (Failed)
	119 - example_DGELS_rowmajor (Failed)

Activity

  1. martin-frbg commented on Sep 6, 2020

    @martin-frbg
    Collaborator

    I suspect this is #339

  2. h-vetinari commented on Sep 6, 2020

    @h-vetinari
    ContributorAuthor

    Thanks for that xref, @martin-frbg. I had looked for similar issues beforehand, but didn't find that one. Happy to close as a duplicate if that's more appropriate.

  3. h-vetinari commented on Sep 6, 2020

    @h-vetinari
    ContributorAuthor

    Reading up on a few of the references (e.g. the summary of the original investigation), I'm not so sure anymore if this is the same error, as there is no overlap with the functions found there:

    Based on analyzing the GFortran 9 output of compilation of the reference LAPACK included in R, it seems that 38 LAPACK functions may be affected: dlarrc dpotrs dtrtrs dgetrs dlarzb dlatzm dlarfx ilaenv dtrtri dsygst dpotrf dlauum dpbtrf dlalsd dbdsdc dpbsv dpftrs dposv dpotri dppsv dpstrf dsbgv dspsv dsytri2 zdrscl zgesv zgetrf zgetrs zlaed0 zlahr2 zlalsd zlarfx zlatdf zlauum zpotrf zpotri ztrtri ztrtrs

    The errors found above occur in the functions: cgemm cgemv dgels dgemm dgemv sgemm sgemv zgemm zhemv - seems to be predominantly an issue with ?gem?-functions.

  4. martin-frbg commented on Sep 6, 2020

    @martin-frbg
    Collaborator

    Symptom looks similar though - expected string length of one i.e. just a single character (U/L, T/N) and either nothing or garbage passed as actual length. The "political" aspect of this is that every compiler has silently accepted this idiom for decades (and the majority of legacy code is probably full ot this) until the gfortran developers tried to enforce their (probably correct) orthodox interpretation of the standard established practice. (Note that they have backtracked regarding the actual compilation, but the built-in checker and sanitizer still flag it as a serious error)

  5. bobrik commented on Mar 6, 2021

    @bobrik
    Contributor

    I have the following set of tests fail on aarch64-darwin (aka apple silicon, with patched gcc from homebrew):

    	 14 - CBLAS-xscblat2 (Failed)
    	 15 - CBLAS-xscblat3 (Failed)
    	 17 - CBLAS-xdcblat2 (Failed)
    	 18 - CBLAS-xdcblat3 (Failed)
    	 20 - CBLAS-xccblat2 (Failed)
    	 21 - CBLAS-xccblat3 (Failed)
    	 23 - CBLAS-xzcblat2 (Failed)
    	 24 - CBLAS-xzcblat3 (Failed)
    

    The failures look like this:

            Start  14: CBLAS-xscblat2
    
    14: Test command: /nix/store/xayprp0sd81jf3vjd3bjb13nnxbkg3pm-cmake-3.19.4/bin/cmake "-DTEST=/Users/ivan/projects/lapack/build/bin/xscblat2" "-DINPUT=/Users/ivan/projects/lapack/CBLAS/testing/sin2" "-DOUTPUT=/Users/ivan/projects/lapack/build/CBLAS/testing/stest2.out" "-DINTDIR=." "-P" "/Users/ivan/projects/lapack/TESTING/runtest.cmake"
    14: Test timeout computed to be: 1500
    14: Running: /Users/ivan/projects/lapack/build/bin/xscblat2
    14: ARGS= OUTPUT_FILE;/Users/ivan/projects/lapack/build/CBLAS/testing/stest2.out;ERROR_FILE;/Users/ivan/projects/lapack/build/CBLAS/testing/stest2.out.err;INPUT_FILE;/Users/ivan/projects/lapack/CBLAS/testing/sin2
    14: Test OUTPUT:
    14:  TESTS OF THE REAL             LEVEL 2 BLAS
    14:
    14:  THE FOLLOWING PARAMETER VALUES WILL BE USED:
    14:    FOR N                   0     1     2     3     5     9
    14:    FOR K                   0     1     2     4
    14:    FOR INCX AND INCY       1     2    -1    -2
    14:    FOR ALPHA             0.0   1.0   0.7
    14:    FOR BETA              0.0   1.0   0.9
    14:
    14:  ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00
    14:
    14:  COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED
    14:
    14:  RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07
    14:
    14:
    14: Test ERROR:
    14: Parameter 1 to routine cblas_sgemv was incorrect
    14: Illegal layout setting, -1
    14:
    14: CMake Error at /Users/ivan/projects/lapack/TESTING/runtest.cmake:36 (message):
    14:   Test /Users/ivan/projects/lapack/build/bin/xscblat2 returned 255
    14:
    14:
     14/121 Test  #14: CBLAS-xscblat2 ...................***Failed    0.01 sec
    

    Is it the same issue or is it different?

  6. martin-frbg commented on Mar 7, 2021

    @martin-frbg
    Collaborator

    Different, as CBLAS itself is in C and uses numerical constants (declared in cblas.h) to denote RowMajor or ColumnMajor layout. Perhaps your compiler picked up an incompatible cblas.h (possibly from Apple's own Accelerate library) that uses something like 1 and -1 for CblasRowMajor/CblasColumnMajor rather than Reference-LAPACK's 101 and 102 ? (Or did you modify the input for the test, CBLAS/testing/cin2, by any chance ?)

  7. bobrik commented on Mar 7, 2021

    @bobrik
    Contributor

    Cross-posting from NixOS/nixpkgs#113021 (comment).

    The issue appears on x86-64-darwin as well. There's no use of built-in Accelerate.framework from what I see, but to be sure I added the following to cblas.h in Accelerate.framework in /nix/store:

    #error "oh no"
    

    The error didn't happen during compilation.

    CMake flags used:

        "-DCMAKE_Fortran_FLAGS=-fPIC"
        "-DLAPACKE=ON"
        "-DCBLAS=ON"
        "-DBUILD_TESTING=ON"
        "-DBUILD_SHARED_LIBS=ON"
    

    On aarch64-darwin I'm using Clang 11 + GFortran 10, on x86_64-darwin there's Clang 7 + GFortran 9.

    To remove any interference from Nix, I reproduced on Big Sur with gfortran from homebrew:

    $ MACOSX_DEPLOYMENT_TARGET=10.16 cmake -DCMAKE_Fortran_FLAGS=-fPIC -DLAPACKE=ON -DCBLAS=ON -DBUILD_TESTING=ON -DBUILD_SHARED_LIBS=ON ..
    -- The Fortran compiler identification is GNU 10.2.0
    -- The C compiler identification is AppleClang 11.0.3.11030032
    -- Checking whether Fortran compiler has -isysroot
    -- Checking whether Fortran compiler has -isysroot - yes
    -- Checking whether Fortran compiler supports OSX deployment target flag
    -- Checking whether Fortran compiler supports OSX deployment target flag - yes
    -- Detecting Fortran compiler ABI info
    -- Detecting Fortran compiler ABI info - done
    -- Check for working Fortran compiler: /usr/local/bin/gfortran - skipped
    -- Checking whether /usr/local/bin/gfortran supports Fortran 90
    -- Checking whether /usr/local/bin/gfortran supports Fortran 90 - yes
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Setting build type to 'Release' as none was specified.
    -- Checking if build type is 'Coverage'
    -- Checking if build type is 'Coverage': 0
    -- Performing Test _recursiveFlag
    -- Performing Test _recursiveFlag - Failed
    -- Performing Test _frecursiveFlag
    -- Performing Test _frecursiveFlag - Success
    -- Performing Test _MrecursiveFlag
    -- Performing Test _MrecursiveFlag - Failed
    -- Build tests: ON
    -- Looking for Python3 needed for summary tests
    -- Looking for Python3 needed for summary tests - found
    -- Reducing RELEASE optimization level to O2
    -- Looking for Fortran NONE - found
    -- Looking for Fortran INT_CPU_TIME - found
    -- Looking for Fortran EXT_ETIME - not found
    -- Looking for Fortran EXT_ETIME_ - not found
    -- Looking for Fortran INT_ETIME - found
    -- --> Will use second_INT_ETIME.f and dsecnd_INT_ETIME.f as timing function.
    -- Build deprecated routines: OFF
    -- Build single precision real: ON
    -- Build double precision real: ON
    -- Build single precision complex: ON
    -- Build double precision complex: ON
    -- Using supplied NETLIB BLAS implementation
    -- CBLAS enable
    -- Detecting Fortran/C Interface
    -- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
    -- Verifying Fortran/C Compiler Compatibility
    -- Verifying Fortran/C Compiler Compatibility - Success
    -- Using supplied NETLIB LAPACK implementation
    -- Running Summary
    -- LAPACKE enable
    -- Build LAPACKE single precision real: ON
    -- Build LAPACKE double precision real: ON
    -- Build LAPACKE single precision complex: ON
    -- Build LAPACKE double precision complex: ON
    -- Build html documentation: OFF
    -- Build man documentation: OFF
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/bobrik/projects/lapack/build
    
    $ MACOSX_DEPLOYMENT_TARGET=10.16 make -j4
    

    I'm not able to reproduce on aarch64-linux in a VM with Claang 11 + GFortran 10.

    Travis tests target xcode10.3, which is macOS Mojave (10.14), and they pass just fine. Maybe there's something about newer versions of macOS that is making things break.

  8. martin-frbg commented on Mar 8, 2021

    @martin-frbg
    Collaborator

    Unable to reproduce on Travis with Catalina (do not think Big Sur is available there yet).

  9. bobrik commented on Mar 9, 2021

    @bobrik
    Contributor

    Looks like -DBUILD_SHARED_LIBS=ON is to blame: #508.

  10. martin-frbg commented on Mar 9, 2021

    @martin-frbg
    Collaborator

    Interesting that it now fails on all macOS/xcode versions. And I cannot reproduce this with an appleclang-12/gfortran-10 combination in a plain gmake build (xcode12 on travis), but do not see anything wrong with the CMakeLists either.

  11. bobrik commented on Mar 10, 2021

    @bobrik
    Contributor

    Plain make uses statically compiled cblas, and that works fine with cmake as well. The problem is with dynamic libraries.

  12. bobrik commented on Mar 10, 2021

    @bobrik
    Contributor

    Running one failed test under lldb:

    $ lldb ./bin/xccblat3
    (lldb) target create "./bin/xccblat3"
    Current executable set to '/Users/ivan/projects/lapack/build-shared/bin/xccblat3' (arm64).
    (lldb) b cblas_cgemm
    Breakpoint 1: where = libcblas.3.dylib`cblas_cgemm + 44 at cblas_cgemm.c:27:12, address = 0x00000000000164f8
    (lldb) process launch -i /Users/ivan/projects/lapack/CBLAS/testing/cin3
    warning: (arm64) /Users/ivan/projects/lapack/build-shared/bin/xccblat3(0x0000000100000000) address 0x0000000100000000 maps to more than one section: xccblat3.__TEXT and xccblat3.__TEXT
    warning: (arm64) /Users/ivan/projects/lapack/build-shared/bin/xccblat3(0x0000000100000000) address 0x0000000100024000 maps to more than one section: xccblat3.__DATA_CONST and xccblat3.__DATA_CONST
    warning: (arm64) /Users/ivan/projects/lapack/build-shared/bin/xccblat3(0x0000000100000000) address 0x0000000100028000 maps to more than one section: xccblat3.__DATA and xccblat3.__DATA
    Process 19131 launched: '/Users/ivan/projects/lapack/build-shared/bin/xccblat3' (arm64)
    1 location added to breakpoint 1
     TESTS OF THE COMPLEX          LEVEL 3 BLAS
    
     THE FOLLOWING PARAMETER VALUES WILL BE USED:
       FOR N                   0     1     2     3     5     9
       FOR ALPHA          ( 0.0, 0.0)  ( 1.0, 0.0)  ( 0.7,-0.9)
       FOR BETA           ( 0.0, 0.0)  ( 1.0, 0.0)  ( 1.3,-1.1)
    
     ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00
    
     COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED
    
     RELATIVE MACHINE PRECISION IS TAKEN TO BE  1.2E-07
    
    Process 19131 stopped
    * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.2
        frame #0: 0x000000010014a4f8 libcblas.3.9.0.dylib`cblas_cgemm(layout=-1, TransA=CblasNoTrans, TransB=CblasNoTrans, M=0, N=0, K=0, alpha=0x000000016fdb4588, A=0x000000016fdb45b0, lda=1, B=0x000000016fdb45a0, ldb=1, beta=0x000000016fdb4580, C=0x000000016fdb4590, ldc=1) at cblas_cgemm.c:27:12
       24  	#endif
       25
       26  	#ifdef F77_INT
    -> 27  	   F77_INT F77_M=M, F77_N=N, F77_K=K, F77_lda=lda, F77_ldb=ldb;
       28  	   F77_INT F77_ldc=ldc;
       29  	#else
       30  	   #define F77_M M
    Target 0: (xccblat3) stopped.
    (lldb) bt
    * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.2
      * frame #0: 0x000000010014a4f8 libcblas.3.9.0.dylib`cblas_cgemm(layout=-1, TransA=CblasNoTrans, TransB=CblasNoTrans, M=0, N=0, K=0, alpha=0x000000016fdb4588, A=0x000000016fdb45b0, lda=1, B=0x000000016fdb45a0, ldb=1, beta=0x000000016fdb4580, C=0x000000016fdb4590, ldc=1) at cblas_cgemm.c:27:12
        frame #1: 0x00000001000167c4 xccblat3`cc3chke_(rout="cblas_cgemm cblas_chemm cblas_csymm cblas_ctrmm cblas_ctrsm cblas_cherk cblas_csyrk cblas_cher2kcblas_csyr2k") at c_c3chke.c:52:7
        frame #2: 0x00000001000117b8 xccblat3`MAIN__ at c_cblat3.f:290:72
        frame #3: 0x00000001000127ac xccblat3`main at c_cblat3.f:424:72
        frame #4: 0x00000001a26d5f34 libdyld.dylib`start + 4
    

    Which points to this call:

          cblas_cgemm( INVALID,  CblasNoTrans, CblasNoTrans, 0, 0, 0,
                       ALPHA, A, 1, B, 1, BETA, C, 1 );

    And INVALID is indeed -1:

    #define  INVALID       -1
    (lldb) c
    Process 19131 resuming
    Parameter 1 to routine cblas_cgemm was incorrect
    Illegal layout setting, -1
    Process 19131 exited with status = 255 (0x000000ff)
    

    Not sure what is different with static libraries here, let me know if you have any ideas.

  13. bobrik commented on Mar 10, 2021

    @bobrik
    Contributor

    Looks like the linker is not going to be fooled anymore:

       /* Initially, c__3chke will call this routine with
        * global variable link_xerbla=1, and F77_xerbla will set link_xerbla=0.
        * This is done to fool the linker into loading these subroutines first
        * instead of ones in the CBLAS or the legacy BLAS library.
        */
       if (link_xerbla) return;

    The call at the end of F77_xerbla() goes into different places (edit: fixed which is which):

    In dynamically linked variant there are two cblas_xerbla():

    (lldb) b cblas_xerbla
    Breakpoint 1: 2 locations.
    

    One of them is in c_xerbla.c:15:4, the other is cblas_xerbla.c:11:9. They are called in order.

    In statically linked variant there's just one:

    (lldb) b cblas_xerbla
    Breakpoint 1: where = xccblat3`cblas_xerbla + 24 at c_xerbla.c:15:4, address = 0x00000001000228dc
    

    I have no idea how any of this works to propose a solution.

  14. langou commented on Mar 10, 2021

    @langou
    Contributor

    Thanks @bobrik. This is helpful.

    So I think the story goes as follows.

    LAPACK and BLAS provide a xerbla.o for error handling. If an error is detected, then BLAS calls XERBLA. The default XERBLA (

    SUBROUTINE XERBLA( SRNAME, INFO )
    ) print a statement and abort the execution. This is the default behavior, provided in librefblas.a or librefblas.so. Now users are encouraged to create their own XERBLA with whatever behavior they want in case of errors. (Typically some users do not want, under any circumstances, their execution to be stopped.) An example of a specialized XERBLA is in the BLAS test suite where the BLAS test suite overwrites the default XERBLA with a specialized XERBLA. In the test suite, we purposely called the Level 3 BLAS subroutines with incorrect arguments and check that (1) XERBLA is called, and (2) XERBLA is called with the correct flags. To do step 2, specialized-for-testing XERBLA rely on global variables. For the Level 3 BLAS subroutine testers, the specialized XERBLA is hard-coded in the testing program. (As opposed to be separate file.) Here is an example at:
    SUBROUTINE XERBLA( SRNAME, INFO )
    .

    Now it seems that there is an issue with this whole design with dynamic libraries.

    Suggestion: Would creating a separate BLAS library without XERBLA ( librefblas_wo_xerbla.a and librefblas_wo_xerbla.so ) solve the issue?

    Comment: Per standard, only the level 3 BLAS have error handling. Level 2 and Level 1 do not call XERBLA.

    Comment: this seems to be related to CBLAS though, as opposed to BLAS. I am missing this connection.

  15. weslleyspereira commented on Mar 13, 2021

    @weslleyspereira
    Collaborator

    Same error in #512. There, I used BUILD_SHARED_LIBS=OFF.

  16. martin-frbg commented on Mar 13, 2021

    @martin-frbg
    Collaborator

    Does the error go away when you add -fno-optimize-sibling-calls to the flags for gfortran ? (Which is/was the recommended workaround from the gcc bugzilla linked in #339)

  17. weslleyspereira commented on Mar 13, 2021

    @weslleyspereira
    Collaborator

    Does the error go away when you add -fno-optimize-sibling-calls to the flags for gfortran ? (Which is/was the recommended workaround from the gcc bugzilla linked in #339)

    No. I obtain the same error.

  18. martin-frbg commented on Mar 13, 2021

    @martin-frbg
    Collaborator

    Sorry, I forgot we actually have two separate issues here - one is the string length error from -fbounds-check (which I maintain is "only" gfortran being overly pedantic) and the other is the "wrong" (non-testsuite) flavor of XERBLA getting called on OSX when the CBLAS tests try to exercise the error paths by deliberately calling functions with invalid arguments.

  19. martin-frbg commented on Mar 13, 2021

    @martin-frbg
    Collaborator

    As this problem has "only" come up on OSX so far, perhaps it is something to do with default linker/loader behavior on that platform ? (Thinking some form of link-time optimization, possibly influenceable by some -Wl option). And the easy way out may be to document that overriding xerbla does/may not work with dynamic linking on OSX (plus make the tests require static linking there).

  20. weslleyspereira commented on Mar 18, 2021

    @weslleyspereira
    Collaborator

    Sorry, I forgot we actually have two separate issues here - one is the string length error from -fbounds-check (which I maintain is "only" gfortran being overly pedantic) and the other is the "wrong" (non-testsuite) flavor of XERBLA getting called on OSX when the CBLAS tests try to exercise the error paths by deliberately calling functions with invalid arguments.

    The first issue will probably be solved by #515.
    I am now running #521 + #508 here to verify #521 the tests pass with -DCMAKE_SHARED_LIBS=ON. (Update: all tests pass)

  21. weslleyspereira commented on Mar 25, 2021

    @weslleyspereira
    Collaborator

    Since #515 and #521 were accepted, I think now all tests pass in the master branch with -fcheck=all (See also #512). Is there anything left to be solved in this issue? Notice that #339 remains open since there is still some work to be done in the LAPACKE part.

  22. h-vetinari commented on Mar 28, 2021

    @h-vetinari
    ContributorAuthor

    @weslleyspereira
    I ran a build with -fcheck=all in conda-forge/lapack-feedstock#51 (CI results here), and it seems that linux builds fine even with that. The build errors for win & osx are very likely regressions from 3.9.0 (at the very least for the build setup that conda-forge uses), but I haven't had time to dig deeper.

    In any case, it's fine for me to close this issue now.

  23. weslleyspereira commented on Mar 29, 2021

    @weslleyspereira
    Collaborator

    Ok then! Thanks everybody for this joint work! (and let me know if we should reopen it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions