Ask Your Question
0

Rosout leaks file descriptors

asked 2016-12-19 21:34:17 -0500

nansmallgong gravatar image

It is weird that when I launch my ros program my os alert "too many files open". By using "lsof", I found rosout node has numerous sockets with "can't identify protocol"(as the following img shows). How did this happen?

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-12-20 23:42:05 -0500

ahendrix gravatar image

Since these are socket file descriptors, it looks like rosout has a lot of open sockets. ROS creates a socket for each connection between a publisher and a subscriber, so there can be a lot of file descriptors involved, but even on robots with hundreds of nodes this isn't usually a problem.

You may be able to tell what these open sockets are connected to and what state they're in with netstat -lp. The -l option lists open sockets, and the -p option lists the process that owns that socket.

edit flag offensive delete link more

Comments

the problem is caused by rosout do not release file descriptor correctly when a node exit with any error. As what I describe here

nansmallgong gravatar image nansmallgong  ( 2016-12-21 00:04:21 -0500 )edit
1

I had some time to dig into this more deeply and have a proposed fix here: https://github.com/ros/ros_comm/pull/...

ahendrix gravatar image ahendrix  ( 2017-11-02 00:56:44 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-12-19 21:34:17 -0500

Seen: 299 times

Last updated: Dec 20 '16