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

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

[Octave-bug-tracker] [bug #60311] Static variable in eigs may cause SIGS


From: anonymous
Subject: [Octave-bug-tracker] [bug #60311] Static variable in eigs may cause SIGSEGV after exit
Date: Tue, 30 Mar 2021 15:44:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0

URL:
  <https://savannah.gnu.org/bugs/?60311>

                 Summary: Static variable in eigs may cause SIGSEGV after exit
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 30 Mar 2021 07:44:04 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Segfault, Bus Error, etc.
                  Status: None
             Assigned to: None
         Originator Name: Octave User
        Originator Email: octave-user@a1.net
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Dear GNU-Octave developers,

I have found out, that the static variable "eigs_fcn" in "__eigs__.cc" may
hold an invalid references to user variables after exit has been called. As a
consequence, you get a SIGSEGV. This can happen for example if anonymous
callback functions are passed to eigs which point to Octave class objects
(e.g. those inside a @class_name directory).

Unfortunately this issue is not easy to reproduce with a few lines of code.
However, I have attached a patch which fixes the problem. I tried to touch as
few lines as possible. Please let me know if you want any changes for that
patch!

In addition to avoiding a SIGSEGV, that patch will also reduce memory
consumption in case of large matrices referenced by anonymous functions. Such
matrices will not be released after eigs returns, because of the static
variable which is still holding a reference to the callback function. Of
course, you could also reset that static variable and it would fix the SIGSEGV
as well.

Best regards,
Octave User



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 30 Mar 2021 07:44:04 PM UTC  Name: fix-eigs-sigsegv-after-exit.patch
 Size: 5KiB   By: None

<http://savannah.gnu.org/bugs/download.php?file_id=51163>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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