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

plugin discovery: partial revert to bring back valgrind #1995

Merged
merged 1 commit into from
May 8, 2018

Conversation

furiel
Copy link
Collaborator

@furiel furiel commented Apr 16, 2018

Revert for 03771db.

The original code scanned the plugins (shared libraries) in a separate
process and sent the list of plugins to the master process, then
exited. This means the main process could selectively load the
available plugins. Unfortunately due to unknown reasons, syslog-ng
fails to start with valgrind with this version. We are reverting the patch, and
later we might try to reintroduce this functionality when the root
cause of the sympthom is found.

Running valgrind with --run-libc-freeres=no would start syslog-ng, but
causes a lot of false positive results (even a simple printf appears
in a log). The problem seems to be connected with the fork() and
exit(), but the root cause is yet to be known.

Fixes: #1953
CC: @juhaszviktor

@kira-syslogng
Copy link
Contributor

success

lib/plugin.c Outdated
{
FILE *discovery;
GList *candidate_plugins = NULL;
gchar module_name[4096];
gint plugin_type;
gchar plugin_name[256];

discovery = fdopen(input_fd, "r");
discovery = fmemopen(module_descriptors->str, module_descriptors->len, "r");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmemopen is not really portable. We should add a compat functions for this.

@furiel furiel changed the title plugin discovery: partial revert to bring back valgrind [WIP] plugin discovery: partial revert to bring back valgrind Apr 21, 2018
@furiel
Copy link
Collaborator Author

furiel commented Apr 21, 2018

Added WIP flag because I need to compat fmemopen as @MrAnno suggested, and add a testcase that helps avoiding this kind of regression again. For example #1940 of @mitzkia could help adding a test with valgrind.

@furiel
Copy link
Collaborator Author

furiel commented Apr 26, 2018

As discussed in an offline review, we will avoid fmemopen and increase the complexity of the revert instead.

@furiel furiel force-pushed the revert-fork-module-load branch 2 times, most recently from 0eb221f to 17a0a70 Compare April 26, 2018 07:23
@kira-syslogng
Copy link
Contributor

success

1 similar comment
@kira-syslogng
Copy link
Contributor

success

@furiel furiel changed the title [WIP] plugin discovery: partial revert to bring back valgrind plugin discovery: partial revert to bring back valgrind Apr 26, 2018
@furiel
Copy link
Collaborator Author

furiel commented Apr 26, 2018

I pushed the complete revert of 03771db as discussed. Removed the wip flag. Ready to review.

@furiel furiel force-pushed the revert-fork-module-load branch from 17a0a70 to 5e67fd6 Compare May 3, 2018 14:38
@furiel
Copy link
Collaborator Author

furiel commented May 3, 2018

Force push to resolve conflict.

@kira-syslogng
Copy link
Contributor

failure

The original code scanned the plugins (shared libraries) in a separate
process and sent the list of plugins to the master process, then
exited. This means the main process could selectively load the
available plugins. Unfortunately due to unknown reasons, syslog-ng
fails to start with this version. We are reverting the patch, and
later we might try to reintroduce this functionality when the root
cause of the sympthom is found.

Running valgrind with --run-libc-freeres=no would start syslog-ng, but
causes a lot of false positive results (even a simple printf appears
in a log). The problem seems to be connected with the fork() and
exit(), but the root cause is yet to be known.

Signed-off-by: Antal Nemes <antal.nemes@balabit.com>
@furiel furiel force-pushed the revert-fork-module-load branch from 5e67fd6 to f9f32c6 Compare May 4, 2018 06:13
@kira-syslogng
Copy link
Contributor

success

@lbudai lbudai merged commit c7877dd into syslog-ng:master May 8, 2018
@furiel furiel deleted the revert-fork-module-load branch November 5, 2019 11:39
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

Successfully merging this pull request may close these issues.

6 participants