OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001051OMNeT++simulation kernelpublic2018-09-18 09:032018-09-19 09:23
Assigned Toandras 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformLinuxOSUbuntuOS Version16.04
Product Version5.4.1 
Target VersionFixed in Version 
Summary0001051: Module class not found due to soft links in the NED folder's path
DescriptionIt is possible to get the "Class X not found" error for a module class when there is a soft link in the path.

This occurs when:
- the class is in a C++ namespace
- @namespace is declared in a package.ned in an ancestor directory
- the path to the NED folder contains a soft link
- the NED path (-n option) is specified with an absolute path.

The reason is that the package.ned is not found when looking up the namespace for the class; and the reason for that is that getcwd() resolves soft links leading to an alternative pathname for the package.ned, which causes it not to be found in a map indexed by path name.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
andras (administrator)
2018-09-18 09:14

Steps to reproduce.

Create the following files:

==> x/package.ned <==

==> x/omnetpp.ini <==

==> x/inet/Foo.ned <==
package inet;
simple Foo { @class(Foo); @isNetwork(true); }

==> x/inet/ <==
#include <omnetpp.h>
namespace ns {
class Foo : public omnetpp::cSimpleModule {};

Build an executable simulation and try it:

cd x
opp_makemake --deep
./x # works fine
Then create a softlink to x, and run the simulation:

cd ..
ln -s x x-softlinked
cd x-softlinked
pwd # /home/you/.../x-softlinked (abs path w/ softlink)
./x -n $(pwd) # error: class not found
andras (administrator)
2018-09-18 09:18

Suggested workaround: resolve symlinks before passing the path to the -n (NED path) option, e.g. using realpath.

The following will fix the above example:

./x -n $(realpath $(pwd))
andras (administrator)
2018-09-18 09:24

related bug: 0000813 Recursive folder symlink in Ned search path generates infinite loop setting up simulation
attila (developer)
2018-09-19 09:23

Also see the investigation in: [^]

- Issue History
Date Modified Username Field Change
2018-09-18 09:03 andras New Issue
2018-09-18 09:14 andras Note Added: 0001370
2018-09-18 09:18 andras Note Added: 0001371
2018-09-18 09:19 andras Assigned To => andras
2018-09-18 09:19 andras Status new => confirmed
2018-09-18 09:20 andras Status confirmed => new
2018-09-18 09:24 andras Note Added: 0001372
2018-09-19 09:23 attila Note Added: 0001377

Copyright © 2000 - 2022 MantisBT Team
Powered by Mantis Bugtracker