bugGNU Octave - Bugs: bug #53027, Strange behavior of globals with...

 
 

bug #53027: Strange behavior of globals with load

Submitted by:  Lars Kindermann <larskindermann>
Submitted on:  Wed 31 Jan 2018 08:19:02 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 12 Feb 2018 10:15:34 PM UTC, comment #3:

Confirmed.

I'm uploading the script bugGlobal2.m which is taken from comment #1.

Also adding jwe to the CC list since he fixed the issue in bug #52722 which likely caused this one.

Rik <rik5>
Project Administrator
Sun 11 Feb 2018 09:00:56 PM UTC, comment #2:

I am pretty sure this is related to changeset 24456:2706adccf4e9 and bug #52722 "fix binding for global variables in script files".

Probably that patch fixes the bug for setting globals in functions but not for loading them with load().

Lars Kindermann <larskindermann>
Thu 01 Feb 2018 12:07:06 PM UTC, comment #1:

It seems there is incorrectly created a second handle to the global X somewhere.

The bug is very nasty because many scripts now give bad results without any notice. It must habe been introduced within the last month or so. Here is a very basic script that demonstrates the error more clearly:

This should be the correct output (Version 4.0):

And this is from current dev:

Lars Kindermann <larskindermann>
Wed 31 Jan 2018 08:19:02 AM UTC, original submission:

load() of a global inside a function leads to several strange effects:
- The value outside the function does not change
- It cannot be cleared anymore

Test code (bugGlobal.m):

This is the correct output of version 4.0

This is the strange output of current dev

This is the even stranger output of a second execution of the code

Lars Kindermann <larskindermann>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #43289:  bugGlobal2.m added by larskindermann (120B - text/x-objcsrc)
file #43137:  bugGlobal.m added by larskindermann (349B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by rik5
  • -unavailable- added by larskindermann (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 14 Feb 2018 10:05:39 AM UTClarskindermannAttached File-=>Added bugGlobal2.m, #43289
    Mon 12 Feb 2018 10:16:10 PM UTCrik5StatusNone=>Confirmed
    Mon 12 Feb 2018 10:15:34 PM UTCrik5Carbon-Copy-=>Added jwe
    Wed 31 Jan 2018 08:19:02 AM UTClarskindermannAttached File-=>Added bugGlobal.m, #43137

    Back to the top


    Powered by Savane 3.1-cleanup1