-
Notifications
You must be signed in to change notification settings - Fork 13
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
Segmentation fault with pound 4.11 on OpenSUSE #24
Comments
==11314== Invalid read of size 4
==11314== at 0x40E7B0: parse_config_file (config.c:5134)
==11314== by 0x40ECD5: config_parse (config.c:5354)
==11314== by 0x405813: main (pound.c:1000)
I need to have the content of /etc/pound.cfg to debug this. You
can send it to my private email, if you prefer.
My crystal ball told me that pound expects a configuration file, even if
Your crystal ball is wrong. There is no such assumption.
Regards.
Sergey
|
It happens with any content. It also happens with a totally empty pound.cfg, or with just some basic lines, such as:
At first I thought the same, that it is the content of the config file, and I took out content out of it, step by step, until it was empty. Everytime there was the same segmentation fault. I think it has to do with that the directory You might be able to reproduce by simply deleting the directory at /usr/local/etc and then restarting pound (or even just checking a configuration file, which can be /etc/pound.cfg or anywhere). This is the line 5134 in config.c which valgrind claims would be causing the segfault:
which in a very quick look seems to access a working directory. So I checked what happens if I delete the empty So that directory should get created by install, if needed, or better checked in a way that there is no segfault when it does not exist. Also, thanks to keep pound alive, I use it a lot, and I love the new features you added! |
You might be able to reproduce by simply deleting the directory at
/usr/local/etc
Ah, you mean system configuration directory! Good point! Thanks a lot.
I can reproduce the bug now.
A naive fix would be to just throw an error if the directory doesn't exist.
However, this might be overly strict, since that directory is not always
needed or used. I'll work out a better fix and let you know.
Until then, you can use the `-Winclude-dir=DIR` option to work over the
bug. E.g. set `-Winclude-dir=/etc` to use `/etc` as a base directory for
all relative file names in your configuration, or `-Wno-include-dir`, to
use current working directory instead. See the manpage for details.
And, while at it, a minor question: you seem to use `/etc/pound.cfg` as
your configuration file. Why not compile pound to use that directory by
default, then? E.g.: `./configure --sysconfdir=/etc`?
Regards,
Sergey
|
Thanks, yes,
Thanks! |
I compiled pound 4.11 on some OpenSUSE servers, and installed it.
When running pound and pointing it to the configuration file, it results in:
Segmentation fault (core dumped)
.This happens already when verifying the configuration file with "-c", example
Valgrind gives some details:
My crystal ball told me that pound expects a configuration file, even if empty, at
/usr/local/etc/pound.cfg
Based on that I found a workaround:
and no more Segmentation fault.
I assume that at installation the file pound.cfg was not created because there was no directory yet at
/usr/local/etc
.I suggest to either remove the requirement of having something at
/usr/local/etc/pound.cfg
or to make sure it is created at make install.The text was updated successfully, but these errors were encountered: