Project

General

Profile

Bug #3215

Updated by Junxiao Shi over 8 years ago

Snippet to reproduce: 

 ``` 
 // 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 to reproduce: 

 1. open a console with root privileges (`sudo -i`), execute `ulimit -u 1024` followed by `nfd` (not `nfd-start`) 
 2. open another console without root privileges, execute `ulimit -u` and confirm the output is greater than 10000, then execute the compiled snippet 

 Expected: NFD does not crash; the snippet may crash 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