Skip to content
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 at logcollector #829

Closed
vikman90 opened this issue May 5, 2016 · 1 comment
Closed

Segmentation fault at logcollector #829

vikman90 opened this issue May 5, 2016 · 1 comment

Comments

@vikman90
Copy link
Contributor

vikman90 commented May 5, 2016

ossec-logcollector stops suddenly after some log rotations, and it shows always the following error:

ERROR: Could not open file '/root/testing.log' due to [(2)-(No such file or directory)].

This is caused by a segmentation fault. This is the output from Valgrind:

2016/05/05 10:15:20 ossec-logcollector(1103): ERROR: Could not open file '/root/testing.log' due to [(2)-(No such file or directory)].
==5382== Invalid read of size 4
==5382== at 0x5A1B570: fileno (in /usr/lib64/libc-2.17.so)
==5382== by 0x4065CE: LogCollectorStart (logcollector.c:404)
==5382== by 0x404788: main (main.c:163)
==5382== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5382==
==5382==
==5382== Process terminating with default action of signal 11 (SIGSEGV)
==5382== Access not within mapped region at address 0x0
==5382== at 0x5A1B570: fileno (in /usr/lib64/libc-2.17.so)
==5382== by 0x4065CE: LogCollectorStart (logcollector.c:404)
==5382== by 0x404788: main (main.c:163)
==5382== If you believe this happened as a result of a stack
==5382== overflow in your program's main thread (unlikely but
==5382== possible), you can try to increase the size of the
==5382== main thread stack using the --main-stacksize= flag.
==5382== The main thread stack size used in this run was 8388608.

It appears to happen when a monitored file is removed and Logcollector can't find it.

@ddpbsd
Copy link
Member

ddpbsd commented May 9, 2016

Your fix has been merged, thanks for the report & patch!

@ddpbsd ddpbsd closed this as completed May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants