octave-maintainers
[Top][All Lists]
Advanced

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

Re: Segmentation Fault with Octave MXE under Windows


From: Daniel J Sebald
Subject: Re: Segmentation Fault with Octave MXE under Windows
Date: Wed, 09 Jul 2014 12:43:44 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 07/09/2014 12:17 PM, ijourneaux wrote:
Daniel Sebald wrote
If this destructor is called such that "delete rep" occurs, and then it
is called again, rep is out of scope and trying to access rep->count
fails.  Try changing this hunk of code to something like the following:

    virtual ~Array (void)
    {
      if (!rep)
        return;

      if (--rep->count == 0)
      {
        delete rep;
        rep = NULL;
      }
    }

If that fixes the problem, then we need a changeset for that (one that
makes sure "rep" is initialized properly at the constructor.

Dan

I was finally able to try this modification out. That produced a different
error.


0x00DCAD12 (0x0022F960 0x1A181D98 0x0022FFC4 0x778B8CD5), _ZN5ArrayIdED2Ev()
+ 0
x12 bytes(s)
panic: Segmentation violation -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
[Inferior 1 (process 8860) exited with code 03]

trying to back trace produced the message
No stack

Any thoungts on what I could try next.
Ian

Did you mean "same error". Looks very similar, except for the "x12 bytes(s)" [should be "byte(s)", apparently a typo in the kernel], where before it was "x10 bytes(s)". Or is it the

"[Inferior 1 (process 8860) exited with code 03]"

that is new?

What to try next? Not sure. One simple thing you could do so long as you are compiling is add the line "fprintf" below to rule out use of the null pointer as being an (i.e., one of multiple) issue:

   virtual ~Array (void)
   {
     if (!rep)
     {
       fprintf(stderr, "NULL POINTER!  RETURNING.\n");
       return;
     }

     if (--rep->count == 0)
     {
       delete rep;
       rep = NULL;
     }
   }

Dan



reply via email to

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