Actions
Bug #3215
openNFD crash with "open /dev/urandom operation failed" when reaching ulimit
Status:
New
Priority:
Normal
Assignee:
-
Category:
Management
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
3.00 h
Description
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:
- open a console with root privileges (
sudo -i
), executeulimit -u 1024
followed bynfd
(notnfd-start
) - 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
Actual: NFD crashes with FATAL: [NFD] OS_Rng: open /dev/urandom operation failed with error 24
, and snippet stops after printing "995"
Actions