bugGNU Octave - Bugs: bug #36288, Accessing variables in some...

 
 

bug #36288: Accessing variables in some recursion gives wrong values if handle to private function is set.

Submitter:  Olaf Till <i7tiol>
Submitted:  Tue 24 Apr 2012 08:37:48 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Olaf Till Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 13 May 2014 06:41:17 PM UTC, comment #4: 

Tracking this down, I found this is unrelated to the current bug, but rather related to lsode and global/persistent variables. In my last comment, I even had made a further mistake, so the description of the problem is not correct. I'd see no reason anymore to keep the current bug open. Really sorry for the noise. Will open a seperate bug report.

Olaf Till <i7tiol>
Group Member
Thu 08 May 2014 01:09:13 PM UTC, comment #3: 

A similar problem is still present in Octave-3.8.0, revision ab775508dff9, although it can't be triggered with the original example. Inside an if-block, checking in its condition if a certain variable has a certain value, the value of the variable seen from a debug prompt by typing the variable name is different. Again, there is recursion involved, but this time only further up in the call-stack, the function where the problem shows up is not called recursively (but repeatedly).

Last time I could boil down the problem to a simple example, but that was much work. It should be easier now to check out the revision in which the original example triggered the bug and see there what happens, assuming it had the same reason.

Olaf Till <i7tiol>
Group Member
Mon 28 Oct 2013 02:38:33 AM UTC, comment #2: 

Closing based on comment #1. I'm also not seeing the bug on the current development version. Must have been fixed sometime between 3.6 and 3.8.

Mike Miller <mtmiller>
Group Member
Mon 14 May 2012 05:16:34 PM UTC, comment #1: 

I must have made a mistake while testing the default branch. I don't see the bug now in the given revision (6a736395ff7d) of the default branch with my testcode. I only see it in the given revision (000cd393f3c1) of the stable branch.

Olaf Till <i7tiol>
Group Member
Tue 24 Apr 2012 08:37:48 PM UTC, original submission:  



Tested to occur in Octave versions:

- 3.6.1+ (000cd393f3c1),
- default (6a736395ff7d).

Description:

Accessing variables in some type of recursion gives wrong values if some (unrelated) handle to a private function was set.

Repeat by:

- Copy attached 'testfunction.m' into current directory,

- copy attached '__dummy_private_function__.m' into subdirectory '/private',

- start Octave freshly,

- run 'testfunction',

- from the debug prompt, enter v to see its value.

The bug shows up if you see a value of '2' for 'v', although you are in the body of an 'if' statement which tests for v==1. (The non-interactive 'printf' before has printed a value of '1' for 'v').

If you comment out the line in 'testfunction.m' which sets the handle to '__dummy_private_function__', the bug will not occur. Also, the bug only seems to occur in the first call to 'testfunction'.



Olaf Till <i7tiol>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #25722:  testfunction.m added by i7tiol (652B - text/x-objcsrc)
file #25723:  __dummy_private_function__.m added by i7tiol (52B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by i7tiol (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-05-13 mtmiller StatusConfirmed Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2014-05-08 jordigh StatusFixed Confirmed
        Open/ClosedClosed Open
    2013-10-28 mtmiller CategoryNone Interpreter
        StatusNone Fixed
        Open/ClosedOpen Closed
        Release3.6.1 dev
    2012-04-24 i7tiol Attached File- Added testfunction.m, #25722
        Attached File- Added _dummy_private_function_.m, #25723

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code