[Bug 119] New: Compiling syslog-ng 3.2.3 with gcc 4.6: warnings
https://bugzilla.balabit.com/show_bug.cgi?id=119 Summary: Compiling syslog-ng 3.2.3 with gcc 4.6: warnings Product: syslog-ng Version: 3.2.x Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: unspecified Component: syslog-ng AssignedTo: bazsi@balabit.hu ReportedBy: jpo@di.uminho.pt Type of the Report: --- Estimated Hours: 0.0 Hi, This is a small report about the 42 warnings produced by gcc 4.6 when compiling syslog-ng 3.2.3 without SSL and SQL support. The target linux distribution was Fedora 16 (currently very similar to the Fedora 15 Beta). The complete build logs can be browsed here: * http://kojipkgs.fedoraproject.org/packages/syslog-ng/3.2.3/1.fc16/data/logs/... * http://kojipkgs.fedoraproject.org/packages/syslog-ng/3.2.3/1.fc16/data/logs/... Warnings count by type: Num : gcc_warning_type ------------------------------------- 2 : -Wcpp 1 : -Wimplicit-function-declaration 2 : -Wstrict-aliasing 18 : -Wuninitialized 9 : -Wunused-but-set-variable 10 : -Wunused-result ------------------------------------- Output of wget -q -O - http://kojipkgs.fedoraproject.org/packages/syslog-ng/3.2.3/1.fc16/data/logs/... | grep "\[-W": ---------- misc.c:382:9: warning: variable 'saved_caps' set but not used [-Wunused-but-set-variable] misc.c:420:18: warning: ignoring return value of 'chown', declared with attribute warn_unused_result [-Wunused-result] misc.c:422:18: warning: ignoring return value of 'chown', declared with attribute warn_unused_result [-Wunused-result] logrewrite.c:72:11: warning: variable 'regexp_error' set but not used [-Wunused-but-set-variable] gprocess.c:920:12: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] gprocess.c:873:14: warning: ignoring return value of 'chdir', declared with attribute warn_unused_result [-Wunused-result] gprocess.c:881:13: warning: ignoring return value of 'getcwd', declared with attribute warn_unused_result [-Wunused-result] filter-expr-grammar.c:3538:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] block-ref-grammar.c:2943:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] cfg-grammar.c:4073:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] pragma-grammar.c:3063:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] rewrite-expr-grammar.c:3117:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] parser-expr-grammar.c:2958:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] afsocket.c:95:13: warning: variable 'saved_caps' set but not used [-Wunused-but-set-variable] afunix.c:138:9: warning: variable 'saved_caps' set but not used [-Wunused-but-set-variable] afunix.c:149:14: warning: ignoring return value of 'chown', declared with attribute warn_unused_result [-Wunused-result] afunix.c:151:14: warning: ignoring return value of 'chown', declared with attribute warn_unused_result [-Wunused-result] afinet.c:349:17: warning: variable 'saved_caps' set but not used [-Wunused-but-set-variable] afinet.c:465:36: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] afinet.c:466:36: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] afsocket-grammar.c:5597:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] afsocket.c:1080:29: warning: 'source' may be used uninitialized in this function [-Wuninitialized] affile.c:47:9: warning: variable 'saved_caps' set but not used [-Wunused-but-set-variable] affile.c:109:15: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result [-Wunused-result] affile.c:111:15: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result [-Wunused-result] affile-grammar.c:3734:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] afprog-grammar.c:3455:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] afuser-grammar.c:2916:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] csvparser.c:348:3: warning: implicit declaration of function 'log_column_parser_free_method' [-Wimplicit-function-declaration] csvparser-grammar.c:3055:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] syslog-format.c:664:9: warning: variable 'sd_param_len' set but not used [-Wunused-but-set-variable] patternize.c:85:2: warning: #warning "openssl seems to be missing on your system, UUID generation will be disabled in pdbtool patternize" [-Wcpp] patternize.c:85:2: warning: #warning "openssl seems to be missing on your system, UUID generation will be disabled in pdbtool patternize" [-Wcpp] dbparser-grammar.c:2929:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] patterndb.c:421:12: warning: variable 'class_tag' set but not used [-Wunused-but-set-variable] patterndb.c:421:12: warning: variable 'class_tag' set but not used [-Wunused-but-set-variable] dummy-grammar.c:2950:12: warning: 'yyerror_range[0xffffffffcccccccbu].level' may be used uninitialized in this function [-Wuninitialized] loggen.c:183:12: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result] loggen.c:350:17: warning: 'pos_seq' may be used uninitialized in this function [-Wuninitialized] loggen.c:329:21: warning: 'pos_timestamp2' may be used uninitialized in this function [-Wuninitialized] loggen.c:328:21: warning: 'pos_timestamp1' may be used uninitialized in this function [-c] loggen.c:215:1: warning: 'linelen' may be used uninitialized in this function [-Wuninitialized] ---------- Note: The warning "csvparser.c:348:3: warning: implicit declaration of function 'log_column_parser_free_method' [-Wimplicit-function-declaration]" appears to already be eliminated by a recent commit. Would it be possible to have some of these warnings eliminated? In particular the ones of the -Wuninitialized type? jpo -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=119 --- Comment #1 from Jose Oliveira <jpo@di.uminho.pt> 2011-05-03 23:43:24 --- I believe a $(DESTDIR) may also be missing in the file <syslog-ng-3.2.git>/scripts/Makefile.am:
From the one of the above build logs: ... Making install in scripts make[1]: Entering directory `/builddir/build/BUILD/syslog-ng-3.2.3/scripts' make[2]: Entering directory `/builddir/build/BUILD/syslog-ng-3.2.3/scripts' test -z "/usr/bin" || /bin/mkdir -p "/builddir/build/BUILDROOT/syslog-ng-3.2.3-1.fc16.x86_64/usr/bin" /usr/bin/install -c update-patterndb '/builddir/build/BUILDROOT/syslog-ng-3.2.3-1.fc16.x86_64/usr/bin' mkdir /etc/syslog-ng/patterndb.d || true mkdir: cannot create directory `/etc/syslog-ng/patterndb.d': No such file or directory make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/builddir/build/BUILD/syslog-ng-3.2.3/scripts' ...
-- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=119 Balazs Scheidler <bazsi@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |FIXED Status|NEW |RESOLVED --- Comment #2 from Balazs Scheidler <bazsi@balabit.hu> 2011-05-04 14:06:04 --- Thanks for your report. It's nice to see you back Jose :) I've committed & pushed a series of patches to 3.2 master that fix most of the warnings. Some that complains about chown/chmod I didn't fix, as: 1) there's a related change in newer versions of syslog-ng, and I didn't want to diverge, nor backport that code 2) I really don't want to handle these errors, but ignore them silently. There was one ugly bug that was revealed by these warnings which is definitely worth fixing. One of the syslog-ng supplied macros used by the generated parser file contained a possible out-of-bounds reference, which could've cause crashes when the config file is being parsed and an error is reported against it, as the uninitialized pointer would be used in the error path. The rest of the warnings were not real bugs, but better have them fixed. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=119 --- Comment #3 from Jose Oliveira <jpo@di.uminho.pt> 2011-05-04 17:25:21 --- (In reply to comment #2)
Thanks for your report. It's nice to see you back Jose :)
I've committed & pushed a series of patches to 3.2 master that fix most of the warnings. Some that complains about chown/chmod I didn't fix, as:
1) there's a related change in newer versions of syslog-ng, and I didn't want to diverge, nor backport that code 2) I really don't want to handle these errors, but ignore them silently.
There was one ugly bug that was revealed by these warnings which is definitely worth fixing. One of the syslog-ng supplied macros used by the generated parser file contained a possible out-of-bounds reference, which could've cause crashes when the config file is being parsed and an error is reported against it, as the uninitialized pointer would be used in the error path.
The rest of the warnings were not real bugs, but better have them fixed.
Balazs, Thanks for the promptly warning fixes! A new build from git only produces the following ones (8 of 9 expected): ---------- misc.c:420:18: warning: ignoring return value of 'chown', declared with attribute warn_unused_result [-Wunused-result] misc.c:422:18: warning: ignoring return value of 'chown', declared with attribute warn_unused_result [-Wunused-result] afunix.c:149:14: warning: ignoring return value of 'chown', declared with attribute warn_unused_result [-Wunused-result] afunix.c:151:14: warning: ignoring return value of 'chown', declared with attribute warn_unused_result [-Wunused-result] affile.c:109:15: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result [-Wunused-result] affile.c:111:15: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result [-Wunused-result] syslog-format.c:664:9: warning: variable 'sd_param_len' set but not used [-Wunused-but-set-variable] patternize.c:85:2: warning: #warning "openssl seems to be missing on your system, UUID generation will be disabled in pdbtool patternize" [-Wcpp] patternize.c:85:2: warning: #warning "openssl seems to be missing on your system, UUID generation will be disabled in pdbtool patternize" [-Wcpp] ---------- /jpo -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=119 Jose Oliveira <jpo@di.uminho.pt> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED | Status|RESOLVED |REOPENED --- Comment #4 from Jose Oliveira <jpo@di.uminho.pt> 2011-05-04 17:41:11 --- Re-opening due to a couple of loose ends: * scripts/Makefile.am We need to add a -p option to the mkdir command for it to succeed: Error message (without -p) ---------- /usr/bin/install -c update-patterndb '/builddir/build/BUILDROOT/syslog-ng-3.2.3-2.git.fc15.x86_64/usr/bin' mkdir /builddir/build/BUILDROOT/syslog-ng-3.2.3-2.git.fc15.x86_64//etc/syslog-ng/patterndb.d || true mkdir: cannot create directory `/builddir/build/BUILDROOT/syslog-ng-3.2.3-2.git.fc15.x86_64//etc/syslog-ng/patterndb.d': No such file or directory ... ---------- Patch ---------- --- syslog-ng-3.2.3/scripts/Makefile.am 2011-05-04 12:58:24.000000000 +0100 +++ syslog-ng-3.2.3-modified/scripts/Makefile.am 2011-05-04 16:28:26.726174796 +0100 @@ -3,4 +3,4 @@ EXTRA_DIST=update-patterndb.in install-exec-local: - mkdir $(DESTDIR)/$(sysconfdir)/patterndb.d || true + mkdir -p $(DESTDIR)/$(sysconfdir)/patterndb.d || true ---------- * syslog-ng 3.2.3 fails to build with eventlog 0.2.7 but builds fine with version 0.2.12. Can the eventlog minimal version requirement be bumped in configure.in? ---------- --- syslog-ng-3.2.3/configure.in 2011-05-04 12:58:24.000000000 +0100 +++ syslog-ng-3.2.3-modified/configure.in 2011-05-04 16:28:38.294177948 +0100 @@ -21,7 +21,7 @@ dnl dependencies GLIB_MIN_VERSION="2.10.1" -EVTLOG_MIN_VERSION="0.2" +EVTLOG_MIN_VERSION="0.2.12" OPENSSL_MIN_VERSION="0.9.8" LIBDBI_MIN_VERSION="0.8.0" PCRE_MIN_VERSION="6.1" ---------- Regards, jpo -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=119 --- Comment #5 from Balazs Scheidler <bazsi@balabit.hu> 2011-05-04 17:45:05 --- Last warning is killed too with this patch: commit da486d85f7f10a4704d119428356b23a18e9b653 Author: Balazs Scheidler <bazsi@balabit.hu> Date: Wed May 4 17:42:48 2011 +0200 syslogformat: fixed compilation warning syslog-format.c:664:9: warning: variable 'sd_param_len' set but not used [-Wunused-but-set-variable] Reported-By: Jose Oliveira <jpo@di.uminho.pt> Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=119 Balazs Scheidler <bazsi@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |FIXED Status|REOPENED |RESOLVED --- Comment #6 from Balazs Scheidler <bazsi@balabit.hu> 2011-05-04 18:01:03 --- commit 9c83385cae2fdf39dea9917de1db4b5161fc00ad Author: Balazs Scheidler <bazsi@balabit.hu> Date: Wed May 4 17:58:42 2011 +0200 configure.in: depend on evtlog 0.2.12 Reported-By: Jose Oliveira <jpo@di.uminho.pt> Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> commit dab135f36343da0864430a15d711e9fdece1d35b Author: Balazs Scheidler <bazsi@balabit.hu> Date: Wed May 4 17:57:59 2011 +0200 create install directories with mkinstalldirs instead of mkdir -p mkdir -p is not portable to all systems which syslog-ng supports, use mkinstalldirs instead. Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> The last one closes the scripts/Makefile.am problem as well as a couple of others. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla@bugzilla.balabit.com