very strange bug

View: New views
8 Messages — Rating Filter:   Alert me  

very strange bug

by paramaniac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Octave Community

I'm using Octave.app 3.2.3 on MacOSX 10.6.1 and I noticed a really  
strange behaviour of Octave/my scripts: When executing the commands at  
the end of this mail, instance sysc is partially changed where it  
should stay the same. Am I doing something wrong or is it a nasty bug  
in Octave?

Thanks in advance for every help!

Regards,
Lukas

BTW: The script needs control-oo:
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo.tar.gz?view=tar


clear all;
close all;
clc;

% script needs control-oo installed, not the "legacy" control package
s = tf ('s');  % this is a simple control-oo-only feature

sysc = ss (-1, 1, 1, 0);  % create a simple, continuous-time model

sysc  % everything is fine here

sysd = c2d (sysc, 2)  % now convert to discrete-time and save as sysd

sysc  % sysc should stay unaltered/continuous-time, but it is discrete-
time now!

% Note that matrices a and b are unaltered in sysc, only sampling time  
changed
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: very strange bug

by paramaniac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I modified my example below to make the bug obvious. It's really a  
nasty bug ;-) Somehow the objects are not properly "encapsulated",  
i.e. there is some kind of partial "passing by reference". I'm using  
Octave.app 3.2.3 on a recent MacBookPro with Intel Core2Duo and MacOSX  
10.6.1.

Regards,
Lukas



clear all;
close all;
clc;

% script needs control-oo installed, not the "legacy" control package
s = tf ('s');  % this is a simple control-oo-only feature

% create a simple, continuous-time model
syscont = ss (-1, 1, 1, 0);

% make a copy of sysc (!) just to be sure that c2d has
% no influence on syscont (but it has)
syscopy = syscont

% now convert syscopy to discrete-time and save as sysdisc
sysdisc = c2d (syscopy, 2)

% syscont should stay continuous-time (what else?),
% but it is discrete-time now as well!
syscont

% Note that matrices a and b are unaltered in syscont (which is right),
% only sampling time changed to 2 seconds (which is obviously WRONG!).

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: [OctDev] very strange bug

by Robert T. Short :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lukas,

I found this bug the other day - manifested differently.  Worse, I think
it is in some code that I contributed.  I have no idea what is causing
it.  I did find a workaround, but will need access to my computer to
provide that information.

I am traveling right now and have limited email access and no computer
access, but when I get home (one week from today) I will provide more
information.  I did strip the problem down to a very, very simple example.

Bob


Lukas Reichlin wrote:

> I modified my example below to make the bug obvious. It's really a  
> nasty bug ;-) Somehow the objects are not properly "encapsulated",  
> i.e. there is some kind of partial "passing by reference". I'm using  
> Octave.app 3.2.3 on a recent MacBookPro with Intel Core2Duo and MacOSX  
> 10.6.1.
>
> Regards,
> Lukas
>
>
>
> clear all;
> close all;
> clc;
>
> % script needs control-oo installed, not the "legacy" control package
> s = tf ('s');  % this is a simple control-oo-only feature
>
> % create a simple, continuous-time model
> syscont = ss (-1, 1, 1, 0);
>
> % make a copy of sysc (!) just to be sure that c2d has
> % no influence on syscont (but it has)
> syscopy = syscont
>
> % now convert syscopy to discrete-time and save as sysdisc
> sysdisc = c2d (syscopy, 2)
>
> % syscont should stay continuous-time (what else?),
> % but it is discrete-time now as well!
> syscont
>
> % Note that matrices a and b are unaltered in syscont (which is right),
> % only sampling time changed to 2 seconds (which is obviously WRONG!).
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Octave-dev mailing list
> Octave-dev@...
> https://lists.sourceforge.net/lists/listinfo/octave-dev
>
>
>  

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: very strange bug

by John W. Eaton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 25-Oct-2009, Lukas Reichlin wrote:

| I modified my example below to make the bug obvious. It's really a  
| nasty bug ;-) Somehow the objects are not properly "encapsulated",  
| i.e. there is some kind of partial "passing by reference". I'm using  
| Octave.app 3.2.3 on a recent MacBookPro with Intel Core2Duo and MacOSX  
| 10.6.1.
|
| Regards,
| Lukas
|
|
|
| clear all;
| close all;
| clc;
|
| % script needs control-oo installed, not the "legacy" control package
| s = tf ('s');  % this is a simple control-oo-only feature
|
| % create a simple, continuous-time model
| syscont = ss (-1, 1, 1, 0);
|
| % make a copy of sysc (!) just to be sure that c2d has
| % no influence on syscont (but it has)
| syscopy = syscont
|
| % now convert syscopy to discrete-time and save as sysdisc
| sysdisc = c2d (syscopy, 2)
|
| % syscont should stay continuous-time (what else?),
| % but it is discrete-time now as well!
| syscont
|
| % Note that matrices a and b are unaltered in syscont (which is right),
| % only sampling time changed to 2 seconds (which is obviously WRONG!).

Where is the control-oo package?

How about posting a self-contained example with everything necessary
to reproduce the bug.  It would help if you could make the example
simple and only include what is necessary to reproduce the bug.

jwe
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: very strange bug

by paramaniac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

control-oo is here:
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo/

Download the package with:
http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo.tar.gz?view=tar

Make sure that the "legacy" control package is not in your Octave  
path, because some functions have identical names (Matlab  
compatibility).

I reduced the example as good as possible. If it is still too  
complicated to understand, you will have to wait until Robert posts  
his example next weekend.

Regards,
Lukas

> On 25-Oct-2009, Lukas Reichlin wrote:
>
> | I modified my example below to make the bug obvious. It's really a
> | nasty bug ;-) Somehow the objects are not properly "encapsulated",
> | i.e. there is some kind of partial "passing by reference". I'm using
> | Octave.app 3.2.3 on a recent MacBookPro with Intel Core2Duo and  
> MacOSX
> | 10.6.1.
> |
> | Regards,
> | Lukas
> |
> |
> |
> | clear all;
> | close all;
> | clc;
> |
> | % script needs control-oo installed, not the "legacy" control  
> package
> | s = tf ('s');  % this is a simple control-oo-only feature
> |
> | % create a simple, continuous-time model
> | syscont = ss (-1, 1, 1, 0);
> |
> | % make a copy of sysc (!) just to be sure that c2d has
> | % no influence on syscont (but it has)
> | syscopy = syscont
> |
> | % now convert syscopy to discrete-time and save as sysdisc
> | sysdisc = c2d (syscopy, 2)
> |
> | % syscont should stay continuous-time (what else?),
> | % but it is discrete-time now as well!
> | syscont
> |
> | % Note that matrices a and b are unaltered in syscont (which is  
> right),
> | % only sampling time changed to 2 seconds (which is obviously  
> WRONG!).
>
> Where is the control-oo package?
>
> How about posting a self-contained example with everything necessary
> to reproduce the bug.  It would help if you could make the example
> simple and only include what is necessary to reproduce the bug.
>
> jwe

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

base class assignment problem (was: Re: very strange bug)

by John W. Eaton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 30-Oct-2009, Lukas Reichlin wrote:

| control-oo is here:
| http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo/
|
| Download the package with:
| http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo.tar.gz?view=tar
|
| Make sure that the "legacy" control package is not in your Octave  
| path, because some functions have identical names (Matlab  
| compatibility).
|
| I reduced the example as good as possible. If it is still too  
| complicated to understand, you will have to wait until Robert posts  
| his example next weekend.

I'm attaching a minimal example.  Unpack the oo-bug.tar.gz file, cd to
the oo-bug directory and run the bug.m script.

The problem seems to be that the base class objects are not properly
copied when their fields are modified inside methods.  I don't have a
solution so it would be great if someone else would like to take a
shot a fixing this problem.

jwe



_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

oo-bug.tar.gz (648 bytes) Download Attachment

Re: base class assignment problem (was: Re: very strange bug)

by Jaroslav Hajek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 30, 2009 at 6:38 PM, John W. Eaton <jwe@...> wrote:

> On 30-Oct-2009, Lukas Reichlin wrote:
>
> | control-oo is here:
> | http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo/
> |
> | Download the package with:
> | http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo.tar.gz?view=tar
> |
> | Make sure that the "legacy" control package is not in your Octave
> | path, because some functions have identical names (Matlab
> | compatibility).
> |
> | I reduced the example as good as possible. If it is still too
> | complicated to understand, you will have to wait until Robert posts
> | his example next weekend.
>
> I'm attaching a minimal example.  Unpack the oo-bug.tar.gz file, cd to
> the oo-bug directory and run the bug.m script.
>
> The problem seems to be that the base class objects are not properly
> copied when their fields are modified inside methods.  I don't have a
> solution so it would be great if someone else would like to take a
> shot a fixing this problem.
>
> jwe
>
>

How about this?
http://hg.savannah.gnu.org/hgweb/octave/rev/0df32e0b2074

regards

--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: base class assignment problem (was: Re: very strange bug)

by John W. Eaton-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On  2-Nov-2009, Jaroslav Hajek wrote:

| On Fri, Oct 30, 2009 at 6:38 PM, John W. Eaton <jwe@...> wrote:
| > On 30-Oct-2009, Lukas Reichlin wrote:
| >
| > | control-oo is here:
| > | http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo/
| > |
| > | Download the package with:
| > | http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/control-oo.tar.gz?view=tar
| > |
| > | Make sure that the "legacy" control package is not in your Octave
| > | path, because some functions have identical names (Matlab
| > | compatibility).
| > |
| > | I reduced the example as good as possible. If it is still too
| > | complicated to understand, you will have to wait until Robert posts
| > | his example next weekend.
| >
| > I'm attaching a minimal example.  Unpack the oo-bug.tar.gz file, cd to
| > the oo-bug directory and run the bug.m script.
| >
| > The problem seems to be that the base class objects are not properly
| > copied when their fields are modified inside methods.  I don't have a
| > solution so it would be great if someone else would like to take a
| > shot a fixing this problem.
| >
| > jwe
| >
| >
|
| How about this?
| http://hg.savannah.gnu.org/hgweb/octave/rev/0df32e0b2074

This change fixes the problem for me.

Thanks,

jwe

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave