-
Notifications
You must be signed in to change notification settings - Fork 264
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
rrdupdate segfault on long argument list #1187
Comments
Try debugging with a non-stripped version of rrdtool. |
/bin/true dos not crash. I built rrdtool from branch v1.8.0. it reports
That works, but on current master (b8bdcd4):
|
I tried using git bisect (which was a bit more difficult because I wasn't sure how to create ./configure at first; ./bootstrap seems to be the way?) but it resulted in fbea00d being good, and b8bdcd4 (master) being bad. But since master is just one merge commit ahead of fbea00d, I think I did something wrong. EDIT:
|
@castilma What happens, if you run bootstrap also as a first command with v1.8.0, before configure etc. |
It seems to look for option arguments recursively
Now the question is: Why do you have your own optparse code? Can't you use getopt_long or similar? One would hope, a special library would properly handle big argumentlist. |
Describe the bug
With a very long argument list rrdupdate segfaults.
To Reproduce
verylongargs.txt
dmesg says
Expected behavior
Or an argument list too long error from the shell with exit code 126. I do check for that in my script, but not for segfault (139).
Desktop (please complete the following information):
Additional context
I noticed that the segfault becomes more unlikely when the argument list is for example 69245 args long. (
rrdupdate /dev/null $(tr ' ' $'\n' <verylongargs.txt |head -n 69245|paste -s -d' ')
) If I use 69246 arguments, it happens more often than not.The fact that it is unreliable, makes me think it has something to do with the memory layout / ALSR in combination with a buffer or stack overflow.
I tried debugging with gdb:
The text was updated successfully, but these errors were encountered: