octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57435] Test suite crashes on Windows on spars


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #57435] Test suite crashes on Windows on sparse.tst
Date: Sat, 21 Dec 2019 12:05:24 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0

Follow-up Comment #18, bug #57435 (project octave):

Another way to trigger the bug is:

amd (ones (30, 30));
clear functions
inv (sparse ([1,1;1,1+i]))


Looking at the code for both functions (amd and symbfact), the thing they have
in common is that they both use functions from suitesparse.
However, I can't trigger the function using "chol" in the first step.

Another common feature that is not used in "chol" is the
SUITESPARSE_ASSIGN_FPTR macro.
The macro definition is different for the newer suitesparse version:

#  if (SUITESPARSE_VERSION >= SUITESPARSE_VER_CODE (4, 3))
#    define SUITESPARSE_NAME(name) SuiteSparse_ ## name
#    define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign)
(SuiteSparse_config.f_name = f_assign)
#    define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign)
(SuiteSparse_config.f_name = SUITESPARSE_NAME (f_assign))
#  else
#    define SUITESPARSE_ASSIGN_FPTR(f_name, f_var, f_assign) (f_var =
f_assign)
#    define SUITESPARSE_ASSIGN_FPTR2(f_name, f_var, f_assign) (f_var =
CHOLMOD_NAME (f_assign))
#  endif


SuiteSparse_config is declared as "extern" [1].

Before the "clear functions" at a break point at sparse-lu.cc:325

(gdb) p SuiteSparse_config
$1 = {malloc_func = 0x62549778 <malloc>, calloc_func = 0x625497a8 <calloc>,
realloc_func = 0x62549758 <realloc>, free_func = 0x62549798 <free>,
  printf_func = 0x62549b70 <printf(char const*, ...)>, hypot_func = 0x781470
<SuiteSparse_hypot>, divcomplex_func = 0x7813d0 <SuiteSparse_divcomplex>}


After the "clear functions", calling "inv" with a sparse matrix causes the
segfault. At a nearby location:

(gdb) p SuiteSparse_config
$2 = {malloc_func = 0x62549778, calloc_func = 0x625497a8, realloc_func =
0x62549758, free_func = 0x62549798, printf_func = 0x62549b70,
  hypot_func = 0x781470 <SuiteSparse_hypot>, divcomplex_func = 0x7813d0
<SuiteSparse_divcomplex>}
(gdb) p SuiteSparse_config.malloc_func
$3 = (void *(*)(size_t)) 0x62549778
(gdb) p *SuiteSparse_config.malloc_func
Cannot access memory at address 0x62549778


One possible fix might be to mlock those functions that use
SUITESPARSE_ASSIGN_FPTR or SUITESPARSE_ASSIGN_FPTR2. I'll try that next.

[1]:
https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/75753f94f45b3bcfaf59229832c33bbd1bccf744/SuiteSparse_config/SuiteSparse_config.h#L96


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57435>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]