88 Commits

Author SHA1 Message Date
Joan Sala
fdcb023dc8 testbench: fix imdiag memory leak reported by valgrind 2018-09-09 16:01:39 +02:00
Rainer Gerhards
97a6730a92
testbench: use a reliable dynamic imdiag port
this also requires changes to some tooling.

Also, when assigning a dynamic port in tcpserver, the same port
number is used for IPv4 and IPv6.

Also removing some left-over debug output.

closes https://github.com/rsyslog/rsyslog/issues/2987
2018-09-04 09:09:50 +02:00
PascalWithopf
df85be1130 tcp driver: add support for parameter LstnPortFileName 2018-08-29 15:14:29 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Jan Gerhards
7aa9738184 imdiag: use new errmsg interface
see also https://github.com/rsyslog/rsyslog/issues/1684
2018-06-04 18:54:06 +02:00
PascalWithopf
29c9fb1f9a codestyle: reduce line length to 120
lines are still checked for a length of 125 because
these are just some of the lines
2017-12-21 17:09:32 +01:00
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
Rainer Gerhards
ad9a247146 "fix" some Coverity scan false positives 2017-11-29 08:11:23 +01:00
Rainer Gerhards
dc2e06d6b8 "fix" Coverity scan cosmetic issues
Let us get rid of some dismissed CID entries...
2017-11-21 09:15:31 +01:00
Rainer Gerhards
66fd9146a1 imdiag: blocking pstats did not always work correctly
data type was not correctly re-cast after atomic operation

Also added a couple of code attributes to aid compiler finding bugs.

Detected by Coverity scan, CID 185416
2017-11-13 12:14:16 +01:00
Rainer Gerhards
6d89c9cdbe imdiag: fix cosmetic race in termination processing
This is not a real problem because imdiag intentionally does multiple
tries to validate predicate validity. However, this is reported in
clang thread sanitizer and so we need to fix it.
2017-11-05 15:57:38 +01:00
Rainer Gerhards
5c5a7a3ed5 tcpsrv subsystem: better error messages
Most importantly, output os error messages on API failures.
Among others, this improves error messages in imtcp.

closes https://github.com/rsyslog/rsyslog/issues/1749
2017-09-05 15:47:12 +02:00
Rainer Gerhards
cd51ae3647 core: enable internal messages at any time
previous code could deadlock if internal messages were issued
inside queue processing code, which effectively limited
error-reporting capabilities. This change makes it possible
to call error messages from any part of the code at any time.
This comes at the price of slightly delayed message output.
2017-03-07 09:27:49 +01:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Janmejay Singh
ba22858037 - fixed omprog FD-leak (it had out-FD leaking in both outfile and no-outfile scenarios)
- now omprog kills the program by issuing TERM signal, but it can wait indefinitely when TERM is ignored (will fix this in a separate commit)
- omkafka was complaining of deprecated-fn-use in 0.9.x versions of librdkafka, which is now fixed
- fixed an incorrect comment in imdiag
2016-11-03 23:44:33 +05:30
Rainer Gerhards
876c962d3a imdiag: fix datatype warning 2016-06-01 15:00:47 +02:00
Janmejay Singh
2be95ef067 fix dynstats stats-publish coordinated tests that were failing on 32-bit env because field width of long (32 bits) was too small to hold millisecond-resolution time 2016-05-09 19:43:22 +05:30
Rainer Gerhards
42a8673abc imdiag: avoid races in detecting queue empty status
Previously, we just did three checks with some longer waits in between.
This was insufficient to avoid races, as we saw in practice. Now we
have slightly changed that approach and require 10 times in a row
an empty queue to deduce it atcually is empty.

closes https://github.com/rsyslog/rsyslog/issues/688
2016-04-23 19:15:44 +02:00
Janmejay Singh
a30bf638cc Trying to switch a stats-dependent test from timing based coordination to semaphore-based coordination. 2016-04-18 21:35:07 +05:30
Janmejay Singh
25cc42c2ff pre-merged upstream for a clean merge-back 2016-02-04 16:14:21 +05:30
Rainer Gerhards
3549041b0f Merge branch 'dyn_stats' of https://github.com/janmejay/rsyslog into master-integrate-dynstats
Conflicts:
	.travis.yml
	grammar/rainerscript.c
	plugins/imdiag/imdiag.c
2016-01-28 09:51:25 +01:00
Rainer Gerhards
e8c8e96e27 refactor time-obtaining functions so that the can obtain time in UTC
This works where the time is picked up locally.
2016-01-11 18:52:42 +01:00
Janmejay Singh
bf43179381 moved to async(dispatched on a different thread) lookup-table reload (stub param is still mandatory, making it optional requires more work) 2015-12-21 23:42:11 +05:30
Peter Portante
2470f0f72b Remove use of sizeof(char) and sizeof(uchar)
Remove the use sizeof(char) or sizeof(uchar) in calculations for memory
allocation or string length.  There are no known platforms for which
sizeof(char) or sizeof(uchar) is not 1, and c99 has defined sizeof(char)
to be 1 (section 6.5.3.4 of c99).
2015-12-16 02:18:45 +00:00
Janmejay Singh
6da7aeb975 - dynstats basic-test first-cut
- vg-test caught a minor issue in impstats (fixed)
- placeholder created for other dynstats tests
- a new assertion in diag.sh which allows extracting a particular column and expecting sum-up to match given value
- imdiag supports injecting litteral messages now (test can send a fully formed syslog message through imdiag, its a backward compatible change in protocol, allows for richer things to be build while being fully backward compatible)
2015-11-13 17:45:07 +05:30
root
4bc2af4ebd fixed issues with imdiag and imgssapi plugins 2015-03-25 12:35:55 +01:00
Rainer Gerhards
423c3ac62c pstats: add "origin" paramter to stats records
see also: https://github.com/rsyslog/rsyslog/issues/119
2014-11-19 15:49:09 +01:00
Rainer Gerhards
10a055ddaa fix: remove accidently left-in debug output (in previous commit) 2014-07-13 15:36:44 +02:00
Rainer Gerhards
a45ea8a144 testbench: make more reliable shutdown
so far, we checked only the main queue size to become zero, ignoring
the sizes of action queues. For some tests, this caused racieness and
unreliability. Now, we check all queues. This should make matters
much more stable.
2014-07-11 17:23:21 +02:00
Tomas Heinrich
3b9be747b9 bugfix: plug a memleak 2014-07-11 15:19:43 +02:00
Tomas Heinrich
f0a8468cf5 bugfix: check return value of ratelimitNew() 2014-07-11 15:19:43 +02:00
Rainer Gerhards
ce9b272317 imdiag: clarify state
see also: https://github.com/rsyslog/rsyslog/issues/71
2014-05-05 12:32:52 +02:00
Rainer Gerhards
e581c3d26e Merge branch 'v7-stable'
Conflicts:
	doc/imptcp.html
	plugins/mmjsonparse/mmjsonparse.c
	plugins/mmnormalize/mmnormalize.c
2012-11-28 10:19:29 +01:00
Rainer Gerhards
d9df6e9775 bugfix: modules not (yet) supporting new conf format were not properly registered
This lead to a "module not found" error message instead of
the to-be-expected "module does not support new style" error message.
That invalid error message could be quite misleading and actually stop
people from addressing the real problem (aka "go nuts" ;))
2012-11-28 10:02:08 +01:00
Rainer Gerhards
b6e6cfeff8 imdiag: add support for new (ratelimiting) msg submit interface 2012-10-15 18:17:59 +02:00
Rainer Gerhards
2a6ff7d53d interface cleanup (probably not final) 2012-10-15 08:55:12 +02:00
Rainer Gerhards
4269e45781 new ratelimit: interface plumbing added
no actual implementation yet done
2012-10-09 18:54:25 +02:00
Rainer Gerhards
5155f67d62 bugfix: small memory leak in imdiag
This does not have any practical problems associated with it, EXCECPT
that it caused almost all valgrind testbench tests to fail.
2012-09-19 19:25:01 +02:00
Rainer Gerhards
d6da57ae03 Merge branch 'v5-stable-newstats'
Conflicts:
	action.c
	configure.ac
	doc/imuxsock.html
	plugins/imklog/imklog.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	plugins/imudp/imudp.c
	plugins/imuxsock/imuxsock.c
	runtime/glbl.c
	runtime/glbl.h
	runtime/net.c
	runtime/ruleset.c
	tcpsrv.h
	tools/syslogd.c
2012-04-07 15:42:46 +02:00
Rainer Gerhards
4fb7ba113c added configuration directive to disable octet-counted framing
... for imtcp, directive is $InputTCPServerSupportOctetCountedFraming
2012-03-19 15:28:25 +01:00
Rainer Gerhards
6624ad434b Merge branch 'v6-stable-noscoping' into master
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	plugins/imfile/imfile.c
	plugins/imklog/imklog.c
	plugins/immark/immark.c
	plugins/imptcp/imptcp.c
	plugins/imrelp/imrelp.c
	plugins/imtcp/imtcp.c
	plugins/imtemplate/imtemplate.c
	plugins/imudp/imudp.c
	plugins/imuxsock/imuxsock.c
	plugins/mmsnmptrapd/mmsnmptrapd.c
	plugins/omtemplate/omtemplate.c
	runtime/glbl.c
	runtime/parser.c
	tools/omfile.c
	tools/syslogd.c
2012-01-19 13:07:46 +01:00
Rainer Gerhards
9b24152b6a undoing v6.1 config scoping interface, part I
The most common files are now changed, more needs to be done.
2012-01-18 18:21:08 +01:00
Rainer Gerhards
ac9afc4149 Merge branch 'v5-stable' into master
Conflicts:
	ChangeLog
	action.h
	configure.ac
	doc/manual.html
	plugins/immark/immark.c
	plugins/impstats/impstats.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	runtime/cfsysline.c
	runtime/cfsysline.h
	runtime/conf.c
	runtime/ctok.c
	runtime/ctok.h
	runtime/ctok_token.c
	runtime/ctok_token.h
	runtime/dnscache.h
	runtime/expr.c
	runtime/expr.h
	runtime/rule.c
	runtime/rule.h
	runtime/ruleset.h
	runtime/sysvar.c
	runtime/vm.h
	runtime/vmop.c
	runtime/vmop.h
	runtime/vmprg.c
	runtime/vmprg.h
	runtime/vmstk.c
	runtime/vmstk.h
	tools/omusrmsg.c
2012-01-18 14:08:24 +01:00
Rainer Gerhards
fe4cfa6d1f Merge branch 'v5-stable' into v6-stable
Conflicts:
	plugins/imtcp/imtcp.c
2012-01-14 18:35:09 +01:00
Rainer Gerhards
0871d0a077 Merge branch 'v4-stable' into v5-stable
Conflicts:
	plugins/imfile/imfile.c
	plugins/omtesting/omtesting.c
	tcpsrv.c
	threads.c
2012-01-14 18:32:40 +01:00
Rainer Gerhards
0216053099 relicense parts under ASL 2.0
after carful check for copyright holder
2012-01-11 18:30:33 +01:00
Rainer Gerhards
a7e3afb20b milestone: added module config names 2011-07-20 10:47:24 +02:00
Rainer Gerhards
8fbefa688f Merge branch 'v5-stable' into beta
Conflicts:
	ChangeLog
	doc/manual.html
2011-07-06 08:36:58 +02:00
Rainer Gerhards
38e7f7852a reduced sporadic failures during make check
backport from v6
2011-06-30 10:28:09 +02:00
Rainer Gerhards
a924cfe6c2 reduced sporadic failures during make check
the imdiag implementation of "queue empty" was a bit racy, which
sometimes lead to too-early termination of rsyslogd and thus some
small memory leaks (which in turn showed up as problems during
make check). The current architecture is not able to 100% guard against
this, but the probleme probability has been reduced (and it showed to
improve in practice).
2011-06-27 13:51:06 +02:00