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: Thu, 29 May 2014 12:22:26 -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 05/29/2014 12:14 PM, John W. Eaton wrote:
On 05/29/2014 12:32 PM, Daniel J 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.

I don't think that's supposed to happen, so there should be no need to
handle the case of rep == 0.

That would be my guess too. Something out of balance with the number of constructor and destructor calls.


 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.

It is supposed to be initialized properly in every constructor, never 0.
If that's not the case, can you point to a constructor where it is not
initialized?

The test would indicate that "rep" is being used out of scope. The problem might lie elsewhere. I'm looking at the function __magick_read__.cc at the moment for any "delete" called twice or something similar. Array<> is used in __magick_read__.cc, but I'm not seeing anything odd just yet.

Dan



reply via email to

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