bugGNU Octave - Bugs: bug #51960, mex or oct function in +package...

 
 

bug #51960: mex or oct function in +package directory that shadows Octave function only works once

Submitted by:  Avinoam Kalma <avinoam>
Submitted on:  Thu 07 Sep 2017 06:06:19 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: ConfirmedAssigned to: None
Originator Name: AvinoamOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Fri 08 Sep 2017 05:56:29 PM UTC, comment #6:

There are several extant bugs on 'which', 'classdef', and 'help' about the path not being worked out properly for classes and packages.

If you try 'which foo' for a package dir +foo you get

This is clearly not right, but probably indicates something about why built-in functions generate a shadowed warning, but m-files don't. I'm guessing that the path lookup is correct before the m-file in +foo has been executed. When you request the function the very first time it has to be parsed, etc., and an entry in the symbol table is constructed. My guess is that the 'file' variable, or whatever it is, in the constructed symbol table entry is incorrect.

Rik <rik5>
Project Administrator
Fri 08 Sep 2017 04:07:01 PM UTC, comment #5:

Changing the Operating System => Any.

Rik <rik5>
Project Administrator
Fri 08 Sep 2017 03:43:50 PM UTC, comment #4:

Hmm, this is a little bit tricky to reproduce. It has to be an oct or mex file in a +package directory that is overriding an m file function in Octave, not a builtin.

With +foo/size.oct there is no bug, because size is a builtin:

With +foo/imread.mex this bug occurs, because imread is an m file function:

And with +foo/which.oct it also occurs, because which is an m file function:

Mike Miller <mtmiller>
Project Administrator
Fri 08 Sep 2017 03:32:00 PM UTC, comment #3:

I observed this on Debian with the current default branch. It does not affect 4.2.1 or the stable branch.

Mike Miller <mtmiller>
Project Administrator
Fri 08 Sep 2017 03:28:15 PM UTC, comment #2:

Is this Windows specific, or are all versions of Octave affected?

Rik <rik5>
Project Administrator
Thu 07 Sep 2017 07:26:23 PM UTC, comment #1:

Confirmed here, both with mex and oct files. M file functions do not have this problem. Confirm also that it used to work in 4.2.1.

Calling "clear -f" allows the functions to work one time again.

Mike Miller <mtmiller>
Project Administrator
Thu 07 Sep 2017 06:06:19 PM UTC, original submission:

An example:

Create the directory c:\data\+temp
And put there the flowing trivial function, called imread.cc

Now:

In the first call, Octave recognizes temp.imread as the file in c:\data\+temp\imread.mex,
but in the second call, Octave calls its own imread.

This is a regression wrt 4.2.1.

Avinoam Kalma <avinoam>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

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 mtmiller (Posted a comment)
  • -unavailable- added by avinoam (Submitted the item)
  • -unavailable- added by avinoam
  •  

    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
    Fri 08 Sep 2017 04:07:01 PM UTCrik5Operating SystemMicrosoft Windows=>Any
    Thu 07 Sep 2017 07:26:23 PM UTCmtmillerStatusNone=>Confirmed
      SummaryProblem with function in +package directory that shadows Octave function=>mex or oct function in +package directory that shadows Octave function only works once
    Thu 07 Sep 2017 06:06:19 PM UTCavinoamCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1