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

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

[Octave-bug-tracker] [bug #47372] Memory leaks and segmentation faults i


From: Rik
Subject: [Octave-bug-tracker] [bug #47372] Memory leaks and segmentation faults in Octave
Date: Thu, 24 Mar 2016 16:21:16 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #24, bug #47372 (project octave):

@jwe: Several questions and answers for you.

1) Does the shlib patch work to stop the segfault in qr that you are seeing?

2) You asked for version numbers, I am using Kubuntu 15.10 with ImageMagick
libraries 1.3.21-3.  This looks nearly the same as the upstream Debian
libraries you report as 1.3.23-1+b1.  I will be upgrading to the 16.04 LTS
release (April 21, 2016).  We can always wait until then to see if pulling
down newer libraries makes a difference.

3) There still seems to be something dodgy with oct-shlib.  I can't quite put
my finger on it, but the coding makes me uneasy.  The code segment below is
from oct-shlib.h.  It appears to me that there is a path where delete is not
paired with new.  


private:

  static shlib_rep nil_rep;

public:

  octave_shlib (void) : rep (&nil_rep) { rep->count++; }

  octave_shlib (const std::string& f, bool fake = true)
    : rep (shlib_rep::get_instance (f, fake)) { }

  ~octave_shlib (void)
  {
    if (--rep->count == 0)
      delete rep;
  }


If I create a null instance of octave_shlib by calling the constructor with no
arguments then rep will point to the static class variable nil_rep, rather
than to a heap-allocated rep created through the new operator.  If the
destructor is then called and delete is used on the class variable then much
mayhem will ensue.

4) Stepping through the debugger, the __init_gnuplot__.oct is successfully
freed.  The segfault happens with __magick_read__.oct and the last code that I
can execute is in octave_dlopen_shlib::~octave_dlopen_shlib which calls
dlclose (library).  It's the dlclose that results in a segfault. 

5) The summary of open issues from 3/13 remains the same for me.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47372>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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