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
Segfault when attempting to check length of non-existent JSON message property #1920
Comments
I just compiled rsyslog from the latest sources in master (0507f3c) and the problem persists.
|
I just modified the OP to remove this block:
and have updated the URL to the config file provided by the gist to reference the new version that leaves out loading the imuxsock module (since I can repro the problem without it). |
I was able to reproduce this with following configuration:
The Segmentation Fault is triggered when the path consists of at least one variable.
|
The problem should be fixed now. |
As a side-note, it looks like parts of the variable handling would benefit from some review/refactoring ;-) #1956 |
I'll test and report back as soon as I can. Thanks! |
@PascalWithopf I assume I need to clone from your fork and not from rsyslog/rsyslog master? I just built from de4ccbf and the issue is still present. About to build from your fork next (from a clean snapshot) and will test again. |
@PascalWithopf I tested c7a5085 from the Output from
That was from me calling the logger command with tcp and udp connectivity options:
192.168.146.131 is the public IP for the Ubuntu 16.04 test VM I used to build/run rsyslog as shown above (sent message from the box where rsyslog was running). Full steps taken to build/run rsyslog:
|
This conf file was posted to rsyslog/rsyslog#1920 to reproduce the segfault encountered when checking for a blank JSON message property.
Example conf to repro segfault per rsyslog/rsyslog#1920
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
As noted on #1071, when I attempt to check the length of a JSON message property (whether at the root or part of a subtree) rsyslog quickly segfaults and crashes.
Configuration that can be used to repro the problem
Here is a trimmed configuration that allows me to reproduce the problem:
Systems I used to reproduce the problem
I believe I can trim the configuration further to still replicate the segfault and will do if/when requested.
I've reproduced the segfault on:
Steps to reproduce
logger --tcp --port 514 --server TESTBOX_FQDN "hello!"
logger --udp --port 514 --server TESTBOX_FQDN "hello!"
This is whether I'm testing against a remote instance of rsyslog v8.30.0 running on an Ubuntu 16.04 or an Ubuntu 14.04 box using the latest v8.30.0 version from the Adiscon Ubuntu PPA.
If testing the rsyslog instance from the same box you run logger, be aware (I wasn't until today) that the
logger
command from Ubuntu 14.04 box fails to work properly when using the-n
option. The Sending UDP packets withlogger
command askubuntu.com Q/A entry has more info.Debug/Valgrind output
This output was generated two days ago from fffda03. The output is roughly the same as that from v8.30.0, but more detail appears to be present in this build.
Steps I followed to build from source
service rsyslog stop
sudo apt-get update
sudo apt-get -y install libtool autoconf automake valgrind git-core build-essential pkg-config libestr-dev zlib1g-dev uuid-dev libgcrypt20-dev liblogging-stdlog-dev libhiredis-dev uuid-dev libgcrypt11-dev liblogging-stdlog-dev flex bison libdbi-dev libmysqlclient-dev postgresql-client libpq-dev libnet-dev librdkafka-dev libgrok-dev libgrok1 libgrok-dev libpcre3-dev libtokyocabinet-dev libglib2.0-dev libmongo-client-dev
cd /tmp
git clone https://github.com/rsyslog/libfastjson
cd libfastjson/
sh autogen.sh
./configure
make
sudo make install
cd /tmp
git clone https://github.com/rsyslog/rsyslog
cd rsyslog
sh autogen.sh
./configure --enable-imptcp
make
sudo make install
wget https://gist.githubusercontent.com/deoren/fd61fe29619d4387b643656c5671490d/raw/a9255c92fd9398a433826d5ce95d8d56d080b9cd/rsyslog-issue-1920.conf -O /tmp/rsyslog-issue-1920.conf
valgrind rsyslogd -dn -f /tmp/rsyslog-issue-1920.conf
The text was updated successfully, but these errors were encountered: