bugGNU Octave - Bugs: bug #66140, clear all results appears to be...

 
 

bug #66140: clear all results appears to be delayed in octave when running --gui

Submitter:  None
Submitted:  Thu 29 Aug 2024 10:16:11 AM UTC
   
 
Category:  Other Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Andy Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 9.2.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 01 Sep 2024 05:39:27 PM UTC, comment #5: 

I've tried to trace "clear" with gdb but I gave up (too many std::shared_ptr<stack_frame> and visitor patterns for me).

If I use "delete" instead of "clear" it even gets funnier:

foo.m:
if (exist ("a", "var"))
  delete(a)
endif
a = classm();


using your classm definition


>> foo
create
>> foo
destroy
create
>> destroy


Andreas Weber <andy1978>
Group Member
Sun 01 Sep 2024 11:49:04 AM UTC, comment #4: 

I'm able to do the same thing with a simple classdef

classsm.m:


classdef classm < handle
  methods
    function self = classm(self)
      printf("create\n");
    endfunction

    function delete(self)
      printf("destroy\n");
    endfunction
  endmethods
endclassdef


and modify script foo.m:


clear all
a = classm();



Running via command line:


octave:1> foo
create
octave:2> foo
destroy
create
octave:3>


Running from gui


>> foo
create
>> foo
create
>> destroy


Changing subject to be for octave

It is the same in windows and linux - the reason it was showing in windows was because by default windows wont allow sharing serialports, whereas it will in linux.

John Donoghue <lostbard>
Group Member
Sun 01 Sep 2024 12:14:11 AM UTC, comment #3: 

It also appears to run fine in the command line version, just not the GUI

John Donoghue <lostbard>
Group Member
Sat 31 Aug 2024 09:42:35 PM UTC, comment #2: 

As an additional note, if I call clear all prior to calling foo, it works ok, so I think this is most likely not an instrumment control bu but a script clear all issue?


Adding a printf in the deconstructor for the  serialport,
and the running foo the first times.

whos

shows the serial port, and if I do a clear all from the command line, I see the printf from the deconstructor

If I rerun foo, it works and whos shows the variable again

If I then rerun the foo without clearing the variable toplevel, it fails - and I dont see the deconstructor call of the original value.

John Donoghue <lostbard>
Group Member
Sat 31 Aug 2024 12:55:32 PM UTC, comment #1: 



Renaming the summary to reflect your issue - that port doesnt close on clear all, clearing the specific port variable after use closes the port


John Donoghue <lostbard>
Group Member
Thu 29 Aug 2024 10:16:11 AM UTC, original submission:  

instrument-control 0.9.3

script foo.m:

clear all
pkg load instrument-control
x = serialport ("COM14");


The first time it's run it works as expected, the second time it throws an error "Zugriff verweigert" (Access denied).


>> foo
>> foo
error: serialport: Error opening the interface: Zugriff verweigert


It looks like the port isn't closed fast enough/completly with "clear all".

Adding a delay doesn't help but if I execute the commands step by step in the interpreter, it works as expected.

This only happens on windows, GNU/Linux is fine.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by andy1978 (Updated the item)
  • -email is unavailable- added by None (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-09-01 lostbard CategoryOctave Package Other
        Assigned tolostbard None
        Operating SystemMicrosoft Windows Any
        Summary[octave-forge] (instrument-control) clear all serialport doesn't close serial port in windows clear all results appears to be delayed in octave when running --gui
    2024-08-31 lostbard Assigned toNone lostbard
        Summary[octave-forge] (instrument-control) closing serialport doesn't work as expected [octave-forge] (instrument-control) clear all serialport doesn't close serial port in windows
    2024-08-29 andy1978 Summary[octave-forge] (instrument-control) [octave-forge] (instrument-control) closing serialport doesn't work as expected

    Back to the top

    Powered by Savane 3.14-3b9d.
    Corresponding source code