-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get next line - very large fd #129
Comments
Hello @KalindiFonda |
Hi, my code failed when moulinette used a very large fd, and that is because of the way I set my static variable - as it depends on a number (MAX_FD_N) I give it. Would it be useful for you to see my code? |
Yes, for sure I am interested in look at your code. |
The issue here is not a large file but a large fd. I have seen implementations like this where essentially a large array of string pointers is initiated as a static variable and accessed simply using r_str[fd] when called. The problem is that if too many files are open, the fd may be greater than MAX_FD_N. If this value is large enough, you will not have an error (which should be a bus error and not a segfault), but then you're using about 80MB of memory for no reason. It would be interesting to add this test as I have seen a lot of implementations lately that take this (highly inefficient) shortcut |
Hello @tobyhw |
if one implements gnl by using a mx_fd option, a very large fd causes a seg fault.
The text was updated successfully, but these errors were encountered: