Mercurial > octave
diff libinterp/dldfcn/symbfact.cc @ 27940:ec0690a6955c stable rc-5-1-90
Lock amd and symbfact to avoid segmentation fault with SuiteSparse (bug #57435).
* dldfcn/amd.cc (Famd), dldfcn/symbfact.cc (Fsymbfact): Use DEFMETHOD_DLD. Call
"mlock" to avoid having invalid function pointers in global SuiteSparse_config
structure when the functions are unloaded (e.g. with "clear functions").
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Sun, 22 Dec 2019 01:01:27 +0100 |
parents | d0a061e6d70f |
children | b442ec6dda5c |
line wrap: on
line diff
--- a/libinterp/dldfcn/symbfact.cc Tue Dec 24 04:01:33 2019 +0100 +++ b/libinterp/dldfcn/symbfact.cc Sun Dec 22 01:01:27 2019 +0100 @@ -43,10 +43,11 @@ #include "error.h" #include "errwarn.h" #include "ovl.h" +#include "parse.h" #include "utils.h" -DEFUN_DLD (symbfact, args, nargout, - doc: /* -*- texinfo -*- +DEFMETHOD_DLD (symbfact, interp, args, nargout, + doc: /* -*- texinfo -*- @deftypefn {} {[@var{count}, @var{h}, @var{parent}, @var{post}, @var{R}] =} symbfact (@var{S}) @deftypefnx {} {[@dots{}] =} symbfact (@var{S}, @var{typ}) @deftypefnx {} {[@dots{}] =} symbfact (@var{S}, @var{typ}, @var{mode}) @@ -209,6 +210,9 @@ cholmod_common *cm = &Common; CHOLMOD_NAME(start) (cm); + // Lock the function to not loose the SuiteSparse_config structure + interp.mlock (); + double spu = octave_sparse_params::get_key ("spumoni"); if (spu == 0.0) {