Bug #1356
closedFace::setInterestFilter likely to fail if setController has been called
100%
Description
Environment: Ubuntu 12.04
ndn-cpp-dev commit c145d492e98ffc7949a80c551bc7188afd074635
NFD commit eee71fd6bca6e49115989a64ac75bfc71b324e5d
Steps to reproduce:
- in NFD configuration file, grant
fib
privilege to default identity - start NFD, and wait about 5 seconds
run program
NFD=1 ./a.out
// g++ set-controller.cpp -lndn-cpp-dev -pthread -lboost_system -lboost_filesystem -lcrypto -lcryptopp -lsqlite3 -lrt #include <ndn-cpp-dev/face.hpp> #include <ndn-cpp-dev/management/nfd-controller.hpp> using ndn::Name; using ndn::Interest; using ndn::Face; void onInterest(const Name& name, const Interest& interest) { std::cout << "interest " << interest.getName() << std::endl; } void onRegisterFailed(const Name& prefix, const std::string& reason) { std::cout << prefix << " fail " << reason << std::endl; } int main() { Face face; face.setController(boost::make_shared<ndn::nfd::Controller>(boost::ref(face))); face.setInterestFilter("/localhost/set-controller", &onInterest, &onRegisterFailed); face.processEvents(); return 0; }
if "/localhost/set-controller fail Unauthorized command" appears, terminate and run the program again
Expected: no error message
Actual: "Unauthorized command" occurs about 4~7 times
Note: if face.setController
line is commented out, "Unauthorized command" occurs 2~3 times
Note: if "Unauthorized command" stops appearing, subsequent execution of the program won't have this error message
Updated by Alex Afanasyev almost 11 years ago
I do not confirm this on OSX 10.9. The behavior is as expected, though there is a problem running the example: it doesn't work without "export NFD=1", regardless setController call (this is related to the default Transport creation, which also uses NFD variable to select "correct" unix socket).
Are you running the test code with or without NFD=1 ?
Updated by Alex Afanasyev almost 11 years ago
Do not confirm this on Ubuntu 12.04.
Again, the test code must be run NFD=1 ./a.out
Otherwise, commands will be directed to ndnx (which shouldn't be running on your machines...)
Updated by Junxiao Shi almost 11 years ago
As shown in step 3, program is executed with NFD=1 ./a.out
.
Updated by Junxiao Shi almost 11 years ago
- Tracker changed from Task to Bug
@Yi is experiencing a similar issue:
ltr120@traffic-gen-vm2:~$ NFD=1 nfdc create udp4://10.0.0.1 ERROR: Face creation failed: Unauthorized command
I suspect it has something to do with the concurrent access to the SQLite-based KeyChain.
The other possible cause is CommandInterestGenerator
/CommandInterestValidator
's improper use of monotonic clock.
Monotonic clock observed by two processes are not guaranteed to have the same epoch.
CommandInterestGenerator
/CommandInterestValidator
should use wall clock.
This is fixed in I122799e45bdcf200e42d4a9b751b1db43f0957bb with #1152.
Updated by Alex Afanasyev almost 11 years ago
- Status changed from New to Resolved
This should be fixed after #1152 submitted
Updated by Junxiao Shi almost 11 years ago
The resolution of this bug cannot be tested until #1365 is fixed.
Updated by Junxiao Shi almost 11 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100