bugGNU Octave - Bugs: bug #64678, [octave forge] (matgeom) fails to...

 
 

bug #64678: [octave forge] (matgeom) fails to load when installed in read-only location

Submitter:  Joohwa Lee <starry>
Submitted:  Fri 15 Sep 2023 08:51:23 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  In Progress Assigned to:  None
Originator Name:  Joohwa Lee Open/Closed:  * Open
Release:  * 8.3.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 15 Mar 2024 07:55:40 PM UTC, comment #8: 

It seems matGeom's normalize.m is superseded by normalizeVector.m.
I cannot find any use of normalize.m in matGeom's code.
I have removed the offending function form Octave's matGeom repository and will submit an issue to matGeom as soon as I can log in to github again.

Juan Pablo Carbajal <juanpi>
Group Member
Mon 25 Sep 2023 08:46:42 PM UTC, comment #7: 

I added a patch for the matgeom package to MXE Octave that follows the idea of the patch from comment #5:
https://hg.octave.org/mxe-octave/rev/287c648ea6f0

Setting OS to any because this should be fixed in the package itself.

Markus Mützel <mmuetzel>
Group administrator
Sun 24 Sep 2023 06:49:43 PM UTC, comment #6: 

I think the error in comment #0 and comment #3 are the same.
matgeom is a dependency of geometry which in turn is a dependency of mapping, so loading the mapping package will in turn load the matgeom package as well. And the first time the latter is loaded, the check on verLessThan.m will run.

Leaving aside that the way the matgeom package deals with shadowing verLessThan.m is a bit fragile at best, another way to circumvent this issue is to patch the matgeom package in the Windows installers (mxe-octave). When those installers are built, the Octave version is obviously known and consequently, it is known if verLessThan.m is in core Octave and if so, will be shadowed by matgeom.
I'd prefer a change in the matgeom package but until that happens, patching mxe-octave may be easier.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 24 Sep 2023 04:39:48 PM UTC, comment #5: 

I don't know whether the error described in comment #3 is the same than the one described in comment #0.
If it is, I'm uploading a patch I've also posted on Discourse:
https://octave.discourse.group/t/unable-to-use-drawline3d-from-matgeom/4847/5

It fixes the error for me.

CC'ing JuanPi Carbajal (who wrote he'd be able to look into it).


I'm leaving the OS set to Windows. The issue likely occurs on any OS and only depends on whether the matgeom package is installed in a read-only location. But Octave for Windows might be the "most affected" because it is installing that package into a read-only location by default.

Another work-around for affected users might be to install the package locally with `pkg install -forge matgeom`. Local packages take precedence over global packages. And the local package store is at a location where Octave has write permission by default.


(file #55167)

Markus Mützel <mmuetzel>
Group administrator
Thu 21 Sep 2023 08:05:50 PM UTC, comment #4: 

Found out was just a simple issue with the security properties of the GNU Octave folder.  I changed these to include Full Control, Modify, and Write.  Executed 'pkg load mapping' without the issue I posted about earlier.  Tested by executing 'help shaperead' and the help text displayed.

Erick Edwards <easydamus>
Thu 21 Sep 2023 05:24:37 PM UTC, comment #3: 

I'm getting:

>> pkg load mapping

warning: function C:\Program Files\GNU Octave\Octave-8.3.0\mingw64\share\octave\packages\matgeom-1.2.3\verLessThan.m shadows a core library function
warning: called from
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 639 column 7

warning: Permanently renaming verLessThan.m since it is already present
warning: called from
    _matgeom_package_register_ at line 41 column 9
    C:\Program Files\GNU Octave\Octave-8.3.0\mingw64\share\octave\packages\matgeom-1.2.3\PKG_ADD at line 1 column 1
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 639 column 7

error: rename: operation failed: Permission denied
error: called from
    _matgeom_package_register_ at line 45 column 9
    C:\Program Files\GNU Octave\Octave-8.3.0\mingw64\share\octave\packages\matgeom-1.2.3\PKG_ADD at line 1 column 1
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 639 column 7

Erick Edwards <easydamus>
Fri 15 Sep 2023 07:48:31 PM UTC, comment #2: 

verLessThan.m merely does the same as the core Octave function.
As the OP shows the matgeom package neatly renames the verLessThan.m function out of the way, as intended.

However, matgeom's normalize.m (in the geom2d/ subdir) works quite differently than core Octave's one and AFAICS is meant to be used in different situations. I expect that suppose sooner or later errors will occur, mostly if functions from the matgeom package and core Octave's statistics functions will be used together. I don't know of such situations in the wild.

FWIW, in my own local copies of the matgeom package I've renamed normalize.m to normalizeLine2d.m just to be sure, but that's just a local and private solution.
An underlying issue is that the matgeom package is merely a repackaging for Octave of the external Matlab matgeom toolbox (see here: https://github.com/mattools/matGeom?search=1). Unfortunately that toolbox itself shadows Matlab's own 'normalize.m' function. I suppose an upstream bug report mentioning this with that matgeom toobox might be due.

Anyway this sort of issues is to be expected, a.o. due to lack of a namespace mechanism in the Octave (Matlab) language and the ever growing number of functions for Octave (and Matlab) supplied through ever more packages ...

@OP (starry):
As to

> I want this problem solved soon.

Sure, we understand, but Octave is a volunteer project. We may take nudges but no orders. For now I interpret your wish as a nudge, though :-)
If you want it to be solved 'soon' you can -in the spirit of Open Source- also take action yourself, e.g., by submitting that bug report upstream with the matgeom toolbox for Matlab (see https://github.com/mattools/matGeom/issues). So there, I've voluntarily already sorted out some things for you ;-)

Philip Nienhuis <philipnienhuis>
Group Member
Fri 15 Sep 2023 10:42:57 AM UTC, comment #1: 

You are showing only some shadowing warnings.
Do you actually see errors when trying to use functions from that package after you have loaded it that way?

Markus Mützel <mmuetzel>
Group administrator
Fri 15 Sep 2023 08:51:23 AM UTC, original submission:  

I tried to load matgeom package by typing "pkg load matgeom" and
got the following warning and error message:

=================================================================

>> pkg load matgeom

warning: function C:\Program Files\GNU Octave\Octave-8.3.0\mingw64\share\octav
e\packages\matgeom-1.2.3\verLessThan.m shadows a core library function
warning: called from
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 639 column 7

warning: Permanently renaming verLessThan.m since it is already present
warning: called from
    _matgeom_package_register_ at line 41 column 9
    C:\Program Files\GNU Octave\Octave-8.3.0\mingw64\share\octave\packages\mat
geom-1.2.3\PKG_ADD at line 1 column 1
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 639 column 7

warning: function C:\Program Files\GNU Octave\Octave-8.3.0\mingw64\share\octav
e\packages\matgeom-1.2.3\geom2d\normalize.m shadows a core library function
warning: called from
    _matgeom_package_register_ at line 49 column 5
    C:\Program Files\GNU Octave\Octave-8.3.0\mingw64\share\octave\packages\mat
geom-1.2.3\PKG_ADD at line 1 column 1
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 639 column 7

================================================================
Hence, matgeom's functions do not run. I want this problem solved soon.

Thanks

Joohwa Lee <starry>

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by juanpi (Posted a comment)
  • -email is unavailable- added by mmuetzel
  • -email is unavailable- added by easydamus (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by starry (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-03-15 juanpi StatusConfirmed In Progress
    2023-09-25 mmuetzel StatusNeed Info Confirmed
        Operating SystemMicrosoft Windows Any
    2023-09-24 mmuetzel Attached File- Added 0001-Add-dummy-verLessThan-only-to-path-for-older-Octave-.patch, #55167
        Summarypkg load matgeom warning and errors [octave forge] (matgeom) fails to load when installed in read-only location
        Carbon-Copy- Added juanpi
    2023-09-15 mmuetzel StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-7c56.
    Corresponding source code