bugGNU Octave - Bugs: bug #34852, incorrect column number on error...

 
 

bug #34852: incorrect column number on error messages

Submitted by:  None
Submitted on:  Thu 17 Nov 2011 08:21:19 PM UTC  
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  delinquentme Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  dev
Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 19 Nov 2016 07:32:42 PM UTC, comment #4:

This issue is still present in Octave 4.2.0.

Here is the code of the original submission in runable form:

The resulting error message is

If I understand jwe's comment #2 correct, then it would be better if Octave did not mention any column number at all in this error message, since this column number is not adding any useful information anyways.

My personal opinion: There might as well be cases where the given column number makes debugging easier than without this column number. Just imagine code that has several commands on a single text line, like this

Hartmut <hardy>
Sat 27 Dec 2014 05:22:04 PM UTC, comment #3:

Added bug #43249 as a related bug. In that case, the reported line number from an error is incorrect rather than the reported column number.

Rik <rik5>
Project Administrator
Thu 17 Nov 2011 08:40:00 PM UTC, comment #2:

It's difficult to see here because the web interface eats whitespace (use verbatim ... verbatim tags here next time to enclose code), but the problem is that the error line is pointing to the assignment operator instead of the multiplication operator.

A relevant discussion from #octave follows:

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Thu 17 Nov 2011 08:36:46 PM UTC, comment #1:
Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Thu 17 Nov 2011 08:21:19 PM UTC, original submission:

function [theta, J_history] = gradientDescent(X, y, theta, alpha, num_iters)

m = length(y); % number of training examples
J_history = zeros(num_iters, 1);

for iter = 1:num_iters

theta = theta - alpha/m * sum ( (((X*theta) - y) )*X )

J_history(iter) = computeCost(X, y, theta);

end

end

......................

above code nets this error ( with an incorrect column number )

......................

error: operator *: nonconformant arguments (op1 is 97x1, op2 is 97x2)
error: evaluating argument list element number 1
error: evaluating argument list element number 1
error: called from:
error: /home/thrive/Desktop/studies/machine_learning/ex1/mlclass-ex1/gradientDescent.m at line 9, column 11

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

Digest:
   bug dependencies.

 

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

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

    Only project members can vote.

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-12-27 rik5 Dependencies- => bugs #43249 is dependent
    2014-01-19 mtmiller CategoryNone => Interpreter
        Item GroupNone => Incorrect Result
        Release3.2.3 => dev
        Operating SystemGNU/Linux => Any
    2011-11-17 jordigh Severity3 - Normal => 2 - Minor
        StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.3