bugGNU Octave - Bugs: bug #62105, Wrong line numbers when...

 
 

bug #62105: Wrong line numbers when encountering errors using F9 to run selected code

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Wed 23 Feb 2022 08:01:38 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 05 Apr 2022 10:47:09 PM UTC, comment #12: 

Verified that the GUI no longer produces a strange message.

Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Fri 01 Apr 2022 09:13:01 PM UTC, comment #11: 

I have pushed cset http://hg.savannah.gnu.org/hgweb/octave/rev/a1c2ea6deaa4 which should fix the issue by omitting the line and column number as well as the name of the temp file in the error message when in debug mode.

Torsten Lilge <ttl>
Group Member
Thu 24 Mar 2022 06:35:25 PM UTC, comment #10: 

As written in bug #62215, I think that the way, the error message is patched for executing selected code is the cause for the error message including the temp in debug mode. I will have a look into this.

Torsten Lilge <ttl>
Group Member
Thu 24 Mar 2022 12:26:27 PM UTC, comment #9: 

created bug #62215 to address tempdir issue.

Nicholas Jankowski <nrjank>
Group Member
Thu 24 Mar 2022 12:11:37 PM UTC, comment #8: 

the old bug was bug #55814

Nicholas Jankowski <nrjank>
Group Member
Thu 24 Mar 2022 12:08:30 PM UTC, comment #7: 

do you know why the temporary file is located at the system TEMP location and not the octave tmpdir location? that was an issue in an old bug where pkg didn't respect the tmpdir setting. is that a GUI issue or a debug mode issue?

Nicholas Jankowski <nrjank>
Group Member
Thu 24 Mar 2022 05:55:14 AM UTC, comment #6: 

Ah okay, then it only occurs when already in debug mode and executing selected code? In this case, I can reproduce the error message related to the temporary file.

Torsten Lilge <ttl>
Group Member
Wed 23 Mar 2022 09:09:49 PM UTC, comment #5: 

(testing using 6.4.0 at the moment)

simple example:

edit mean

scroll down to beginning of code, highlight a variable not initialized. e.g., nd in line 101.  press F9:


>> nd
error: 'nd' undefined


set a breakpoint in the file at line 101 so that nd is not yet initialized. 


>> mean(1)
stopped in mean at line 101 [C:\Octave\octave-6.4.0-w64\mingw64\share\octave\6.4.0\m\statistics\mean.m]
101:   nd = ndims (x);


highlight nd again, press F9:

debug> nd
error: 'nd' undefined near line 1, column 1
error: called from
    C:/Users/USERNAME/AppData/Local/Temp/octave/octave_cKMXlQ.m at line 1 column 1


this is also a bit disturbing because I've set tmpdir to be a different folder outside of my user profile. but that should maybe be a separate report.

Nicholas Jankowski <nrjank>
Group Member
Wed 23 Mar 2022 08:54:46 PM UTC, comment #4: 

@Philipp, could you please post an example where this happens? I am just seeing the error message on errors in the selected code, without line number and file name.

Torsten Lilge <ttl>
Group Member
Wed 23 Mar 2022 07:19:28 PM UTC, comment #3: 

I agree, this should not be a blocker.

Torsten Lilge <ttl>
Group Member
Tue 22 Mar 2022 06:29:43 PM UTC, comment #2: 

This doesn't seem to be a blocker for version 7, and probably won't be fixed before 7.1 release. Changing release to dev.

Nicholas Jankowski <nrjank>
Group Member
Sun 20 Mar 2022 06:44:05 PM UTC, comment #1: 

cc'ing Torsten

Philip Nienhuis <philipnienhuis>
Group Member
Wed 23 Feb 2022 08:01:38 PM UTC, original submission:  

(brought over from bug #60469 where it lay unnoticed for almost 3 months)

If some piece of code, selected using F9 in the editor, contains syntax or other errors, Octave emits relevant error messages but with wrong line numbers. Similarly for warnings.
In fact the line number(s) in the temporary file used by F9 are echoed in the error message, rather than the line numbers of the file in the editor.

Philip Nienhuis <philipnienhuis>
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 rik5 (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by philipnienhuis (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-04-05 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2022-04-01 ttl StatusNone Ready For Test
    2022-03-22 nrjank Release7.0.90 dev
    2022-03-20 philipnienhuis Carbon-Copy- Added ttl
    2022-02-23 philipnienhuis SummaryWring line numbers when encountering errors using F9 to run selected code Wrong line numbers when encountering errors using F9 to run selected code

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code