bugGNU Octave - Bugs: bug #66053, [octave forge]...

 
 

bug #66053: [octave forge] (instrument-control) serialport: errors not handled correctly on windows

Submitter:  Andreas Weber <andy1978>
Submitted:  Thu 01 Aug 2024 09:30:29 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Ready For Test Assigned to:  lostbard
Originator Name:  Open/Closed:  * Open
Release:  * 9.2.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 02 Aug 2024 11:44:16 PM UTC, comment #4: 

I pushed up removeal of the input of errno to the winerror function and pushed it to the repo.

It should appear in the next release.

John Donoghue <lostbard>
Group Member
Thu 01 Aug 2024 02:56:14 PM UTC, comment #3: 

I guess should say remove as its always inputting errono currently, and its always being called after an error with a Win32 function call

John Donoghue <lostbard>
Group Member
Thu 01 Aug 2024 02:52:23 PM UTC, comment #2: 

Or remove the input arg completly? since it is always errno ?

John Donoghue <lostbard>
Group Member
Thu 01 Aug 2024 10:13:09 AM UTC, comment #1: 

Using

...winerror (0).c_str ()...


might be the easiest after function calls which return the error in GetLastError

Andreas Weber <andy1978>
Group Member
Thu 01 Aug 2024 09:30:29 AM UTC, original submission:  

It looks like the octave_serialport class isn't handling error codes from Win32 correctly.

The helper function "winerror" returns the C description if err != 0 and uses GetLastError () to get WIN32 API errors otherwise.

octave_serialport::open
calls

fd = CreateFile(fullPath.c_str (), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
.. and later...
error("serialport: Error opening the interface: %s\n", winerror (errno).c_str ());


But this potentially returns an old, previously set errno code.



Andreas Weber <andy1978>
Group Member

 

(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 (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-08-02 lostbard StatusNone Ready For Test
        Assigned toNone lostbard

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code