[systemd-devel] systemd-journald crashes w/specific numbers of fields
Dan Checkoway
danc at layer.com
Mon Aug 3 19:09:22 PDT 2015
Hello,
Before filing a bug report, I wanted to run this by the group to make sure
I'm not doing something dumb (it happens). We're seeing systemd-journald
crash with:
Assertion 'n + 20 + (object_pid ? 11 : 0) <= m' failed at
/build/amd64-usr/var/tmp/portage/sys-apps/systemd-218-r5/work/systemd-218/src/journal/journald-server.c:576,
function dispatch_message_real(). Aborting.
Shortly after this occurs, the container crashes. We cause this by
creating journal entries with some very specific numbers of metadata
fields. 22, 66, 154, 330 to be exact. Any other number of fields, no
problem, no crash. Crazy, right? The examples at the bottom of this
message reliably produce a crash.
PLEASE let me know if I've missed something obvious, but as far as I can
tell, this is a bug in systemd-journald. We've seen this exact failure
mode with Erlang, Ruby, and Python.
Environment details:
- CoreOS version 607.0.0
- systemd version 218
- Docker container based on: phusion/baseimage:0.9.11
- Languages/APIs: Erlang (ejournald), Ruby (journald-native), Python
(python-systemd)
Easy one-liners to reproduce:
## Python
$ apt-get update && apt-get -y install python-systemd && python << EOF
from systemd import journal
journal.sendv('MESSAGE=this will crash', 'SYSLOG_IDENTIFIER=foobar',
'SYSLOG_FACILITY=3', 'PRIORITY=5', 'KEY5=foobar', 'KEY6=foobar',
'KEY7=foobar', 'KEY8=foobar', 'KEY9=foobar', 'KEY10=foobar',
'KEY11=foobar', 'KEY12=foobar', 'KEY13=foobar', 'KEY14=foobar',
'KEY15=foobar', 'KEY16=foobar', 'KEY17=foobar', 'KEY18=foobar',
'KEY19=foobar', 'KEY20=foobar', 'KEY21=foobar', 'KEY22=foobar')
EOF
$ apt-get update && apt-get -y install python-systemd && python << EOF
from systemd import journal
journal.sendv('MESSAGE=this will crash', 'SYSLOG_IDENTIFIER=foobar',
'SYSLOG_FACILITY=3', 'PRIORITY=5', 'KEY5=foobar', 'KEY6=foobar',
'KEY7=foobar', 'KEY8=foobar', 'KEY9=foobar', 'KEY10=foobar',
'KEY11=foobar', 'KEY12=foobar', 'KEY13=foobar', 'KEY14=foobar',
'KEY15=foobar', 'KEY16=foobar', 'KEY17=foobar', 'KEY18=foobar',
'KEY19=foobar', 'KEY20=foobar', 'KEY21=foobar', 'KEY22=foobar',
'KEY23=foobar', 'KEY24=foobar', 'KEY25=foobar', 'KEY26=foobar',
'KEY27=foobar', 'KEY28=foobar', 'KEY29=foobar', 'KEY30=foobar',
'KEY31=foobar', 'KEY32=foobar', 'KEY33=foobar', 'KEY34=foobar',
'KEY35=foobar', 'KEY36=foobar', 'KEY37=foobar', 'KEY38=foobar',
'KEY39=foobar', 'KEY40=foobar', 'KEY41=foobar', 'KEY42=foobar',
'KEY43=foobar', 'KEY44=foobar', 'KEY45=foobar', 'KEY46=foobar',
'KEY47=foobar', 'KEY48=foobar', 'KEY49=foobar', 'KEY50=foobar',
'KEY51=foobar', 'KEY52=foobar', 'KEY53=foobar', 'KEY54=foobar',
'KEY55=foobar', 'KEY56=foobar', 'KEY57=foobar', 'KEY58=foobar',
'KEY59=foobar', 'KEY60=foobar', 'KEY61=foobar', 'KEY62=foobar',
'KEY63=foobar', 'KEY64=foobar', 'KEY65=foobar', 'KEY66=foobar')
EOF
## Ruby
$ apt-get update && apt-get -y install make libsystemd-journal-dev ruby
ruby-dev && gem install journald-native && ruby << EOF
require 'journald/native'
Journald::Native.send "MESSAGE=this will crash",
"SYSLOG_IDENTIFIER=foobar", "SYSLOG_FACILITY=3", "PRIORITY=5",
"KEY5=foobar", "KEY6=foobar", "KEY7=foobar", "KEY8=foobar", "KEY9=foobar",
"KEY10=foobar", "KEY11=foobar", "KEY12=foobar", "KEY13=foobar",
"KEY14=foobar", "KEY15=foobar", "KEY16=foobar", "KEY17=foobar",
"KEY18=foobar", "KEY19=foobar", "KEY20=foobar", "KEY21=foobar",
"KEY22=foobar"
EOF
$ apt-get update && apt-get -y install make libsystemd-journal-dev ruby
ruby-dev && gem install journald-native && ruby << EOF
require 'journald/native'
Journald::Native.send "MESSAGE=this will crash",
"SYSLOG_IDENTIFIER=foobar", "SYSLOG_FACILITY=3", "PRIORITY=5",
"KEY5=foobar", "KEY6=foobar", "KEY7=foobar", "KEY8=foobar", "KEY9=foobar",
"KEY10=foobar", "KEY11=foobar", "KEY12=foobar", "KEY13=foobar",
"KEY14=foobar", "KEY15=foobar", "KEY16=foobar", "KEY17=foobar",
"KEY18=foobar", "KEY19=foobar", "KEY20=foobar", "KEY21=foobar",
"KEY22=foobar", "KEY23=foobar", "KEY24=foobar", "KEY25=foobar",
"KEY26=foobar", "KEY27=foobar", "KEY28=foobar", "KEY29=foobar",
"KEY30=foobar", "KEY31=foobar", "KEY32=foobar", "KEY33=foobar",
"KEY34=foobar", "KEY35=foobar", "KEY36=foobar", "KEY37=foobar",
"KEY38=foobar", "KEY39=foobar", "KEY40=foobar", "KEY41=foobar",
"KEY42=foobar", "KEY43=foobar", "KEY44=foobar", "KEY45=foobar",
"KEY46=foobar", "KEY47=foobar", "KEY48=foobar", "KEY49=foobar",
"KEY50=foobar", "KEY51=foobar", "KEY52=foobar", "KEY53=foobar",
"KEY54=foobar", "KEY55=foobar", "KEY56=foobar", "KEY57=foobar",
"KEY58=foobar", "KEY59=foobar", "KEY60=foobar", "KEY61=foobar",
"KEY62=foobar", "KEY63=foobar", "KEY64=foobar", "KEY65=foobar",
"KEY66=foobar"
EOF
Thanks in advance!
Dan Checkoway
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150803/ba18ceda/attachment.html>
More information about the systemd-devel
mailing list