Project

General

Profile

Bug #3215

Updated by Junxiao Shi over 8 years ago

Snippet Based on http://www.lists.cs.ucla.edu/pipermail/ndn-interest/2015-September/000842.html, I am guessing that we are missing exception handling somewhere (may be management, may be in other place). 

 While I don't have a specific code snippet to reproduce: reproduce the problem, we may want to investigate the issue with the following parameters: 

 ``` - Linux 
 // g++ -o x -std=c++0x x.cpp $(pkg-config --cflags --libs libndn-cxx) 
 #include <boost/asio.hpp> 
 #include <ndn-cxx/face.hpp> 
 #include <ndn-cxx/security/key-chain.hpp> 

 using namespace ndn; 

 int main() { 
   boost::asio::io_service io; 
   KeyChain keyChain; 
   std::vector<unique_ptr<Face>> faces; 
   for (int i = 0; i < 1200; ++i) { 
     faces.emplace_back(new Face(nullptr, io, keyChain)); 
     faces.back()->processEvents(time::milliseconds(100)); 
     std::cout << i << std::endl; 
   } 

   sleep(600); 

   return 0; 
 } 
 ``` 

 Steps - ulimit to reproduce: 

 1. 1024 open handlers (`-n`) 
 - Create a console with root privileges (`sudo -i`), execute `ulimit -u 1024` followed by `nfd` (not `nfd-start`) simple app to create >1024 faces to NFD. 
 2. open another console without root privileges, execute `ulimit -u` and confirm the output is greater than 10000, then execute the compiled snippet 

 Expected: the snippet completes successfully   
 Actual: NFD crashes with `FATAL: [NFD] OS_Rng: open /dev/urandom operation failed with error 24`, and snippet stops after printing "995"

Back