supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* runit/svlogd: segfault, uninitialized strallocs?
@ 2018-01-15  0:18 mcz
  0 siblings, 0 replies; only message in thread
From: mcz @ 2018-01-15  0:18 UTC (permalink / raw)
  To: Supervision

On one of my PCs (runit-2.1.2, voidlinux, raspberry pi) this happens
when the number of logdir arguments is large enough:

---8<---
# strace svlogd -ttt /var/log/socklog/*
[...]
open("/var/log/socklog/daemon", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 4
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
fchdir(4)                               = 0
open("lock", O_WRONLY|O_CREAT|O_APPEND|O_NONBLOCK|O_LARGEFILE, 0600) = 5
flock(5, LOCK_EX|LOCK_NB)               = 0
fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x68732067} ---
+++ killed by SIGSEGV +++
Segmentation fault
#
---8<---

The dir structures (which are allocated at svlogd.c:706) don't seem to
be zeroed at all when alloc falls back to malloc (alloc.c:21). Then,
uninitialized dir[0].prefix gets passed to stralloc_copys
(svlogd.c:435) and svlogd receives SIGSEGV at stralloc_opyb.c:11.

Is this a bug or am I missing something?

-- 
mcz


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-15  0:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-15  0:18 runit/svlogd: segfault, uninitialized strallocs? mcz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).