Just for reference attached some notes how to
switch to openrc and some debugging attempts.
# switch to unstable
nano /etc/apt/sources.list

apt update
apt dist-upgrade
apt autoremove
reboot

nano /etc/default/grub
# remove quiet
# add init=/sbin/openrc-init
update-grub

apt install initscripts
apt install tmux
apt install openrc

tmux            # in virtual console

tmux attach     # in ssh
for file in /etc/rc0.d/K*; do s=`basename $(readlink "$file")` ; /etc/init.d/$s 
stop; done

reboot


# just ssh works, after a little wait time - no virtual console

dpkg --purge systemd systemd-sysv systemd-shim libpam-systemd sysvinit-core init

openrc-shutdown -r


apt install psmisc tmux valgrind openrc-dbgsym librc1-dbgsym devscripts 
dpkg-dev mc quilt
apt build-dep openrc




mkdir openrc/orig -p
cd    openrc/orig
apt source openrc
cd ../..

mkdir libc6/orig -p
cd    libc6/orig
apt source libc6
cd ../..





gdb -q --args rc-status

set height 0
set width 0
set pagination off
directory /root/openrc/orig/openrc-0.38/src/librc
run

-------

...
Dynamic Runlevel: hotplugged
corrupted double-linked list

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht 
gefunden.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff7bb42f1 in __GI_abort () at abort.c:79
#2  0x00007ffff7bf5867 in __libc_message (action=action@entry=do_abort, 
fmt=fmt@entry=0x7ffff7cff273 "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff7bfbe0a in malloc_printerr (str=str@entry=0x7ffff7cfd3d6 
"corrupted double-linked list") at malloc.c:5350
#4  0x00007ffff7bfc024 in malloc_consolidate (av=av@entry=0x7ffff7d34c40 
<main_arena>) at malloc.c:4456
#5  0x00007ffff7bfedad in _int_malloc (av=av@entry=0x7ffff7d34c40 <main_arena>, 
bytes=bytes@entry=32816) at malloc.c:3703
#6  0x00007ffff7c0064c in __GI___libc_malloc (bytes=32816) at malloc.c:3057
#7  0x00007ffff7c3d743 in __alloc_dir (fd=3, close_fd=<optimized out>, 
flags=<optimized out>, statp=<optimized out>) at ../sysdeps/posix/opendir.c:216
#8  0x00007ffff7c3d85d in opendir_tail (fd=3) at ../sysdeps/posix/opendir.c:136
#9  0x00007ffff7d62aa9 in ?? () from /lib/x86_64-linux-gnu/librc.so.1
#10 0x00007ffff7d6497d in rc_services_in_state () from 
/lib/x86_64-linux-gnu/librc.so.1
#11 0x0000555555557b8b in ?? ()
#12 0x00007ffff7b9fb17 in __libc_start_main (main=0x5555555575c0, argc=1, 
argv=0x7fffffffed18, init=<optimized out>, fini=<optimized out>, 
rtld_fini=<optimized out>, stack_end=0x7fffffffed08) at ../csu/libc-start.c:310
#13 0x0000555555557efa in ?? ()


-------

Dynamic Runlevel: hotplugged
corrupted double-linked list

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht 
gefunden.
(gdb) set height 0
(gdb) set width 0
(gdb) set pagination off
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff7bb42f1 in __GI_abort () at abort.c:79
#2  0x00007ffff7bf5867 in __libc_message (action=action@entry=do_abort, 
fmt=fmt@entry=0x7ffff7cff273 "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff7bfbe0a in malloc_printerr (str=str@entry=0x7ffff7cfd3d6 
"corrupted double-linked list") at malloc.c:5350
#4  0x00007ffff7bfc024 in malloc_consolidate (av=av@entry=0x7ffff7d34c40 
<main_arena>) at malloc.c:4456
#5  0x00007ffff7bfedad in _int_malloc (av=av@entry=0x7ffff7d34c40 <main_arena>, 
bytes=bytes@entry=32816) at malloc.c:3703
#6  0x00007ffff7c0064c in __GI___libc_malloc (bytes=32816) at malloc.c:3057
#7  0x00007ffff7c3d743 in __alloc_dir (fd=3, close_fd=<optimized out>, 
flags=<optimized out>, statp=<optimized out>) at ../sysdeps/posix/opendir.c:216
#8  0x00007ffff7c3d85d in opendir_tail (fd=3) at ../sysdeps/posix/opendir.c:136
#9  0x00007ffff7c3d910 in __opendir (name=name@entry=0x7fffffffdba0 
"/run/openrc/hotplugged") at ../sysdeps/posix/opendir.c:190
#10 0x00007ffff7d62aa9 in ls_dir (dir=dir@entry=0x7fffffffdba0 
"/run/openrc/hotplugged", options=options@entry=1) at librc.c:71
#11 0x00007ffff7d6497d in __RC_rc_services_in_state (state=<optimized out>) at 
librc.c:1006
#12 0x0000555555557b8b in main (argc=<optimized out>, argv=<optimized out>) at 
rc-status.c:353


-------

root@debian:~# valgrind rc-status
==2542== Memcheck, a memory error detector
==2542== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2542== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==2542== Command: rc-status
==2542== 
Runlevel: default
==2542== Conditional jump or move depends on uninitialised value(s)
==2542==    at 0x10C416: print_service (rc-status.c:160)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542== 
==2542== Conditional jump or move depends on uninitialised value(s)
==2542==    at 0x4B2597C: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542== 
==2542== Use of uninitialised value of size 8
==2542==    at 0x48389E2: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B2746B: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542== 
==2542== Use of uninitialised value of size 8
==2542==    at 0x48389F4: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B2746B: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542== 
==2542== Use of uninitialised value of size 8
==2542==    at 0x4B53A88: _IO_default_xsputn (genops.c:412)
==2542==    by 0x4B26C84: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542== 
==2542== Use of uninitialised value of size 8
==2542==    at 0x4B53A96: _IO_default_xsputn (genops.c:411)
==2542==    by 0x4B26C84: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542== 
==2542== Conditional jump or move depends on uninitialised value(s)
==2542==    at 0x48369A1: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542== 
 console-setup.sh                                                               
                                                                                
                       [  started default ]
==2542== Invalid read of size 1
==2542==    at 0x48389E2: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B2746B: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x4BDDA14: __snprintf_chk (snprintf_chk.c:34)
==2542==    by 0x4AA4CE8: snprintf (stdio2.h:64)
==2542==    by 0x4AA4CE8: rc_service_in_runlevel (librc.c:688)
==2542==    by 0x10C6EF: print_services (rc-status.c:214)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x48389F4: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B2746B: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x4BDDA14: __snprintf_chk (snprintf_chk.c:34)
==2542==    by 0x4AA4CE8: snprintf (stdio2.h:64)
==2542==    by 0x4AA4CE8: rc_service_in_runlevel (librc.c:688)
==2542==    by 0x10C6EF: print_services (rc-status.c:214)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b51 is 1 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4B53A88: _IO_default_xsputn (genops.c:412)
==2542==    by 0x4B26C84: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x4BDDA14: __snprintf_chk (snprintf_chk.c:34)
==2542==    by 0x4AA4CE8: snprintf (stdio2.h:64)
==2542==    by 0x4AA4CE8: rc_service_in_runlevel (librc.c:688)
==2542==    by 0x10C6EF: print_services (rc-status.c:214)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4B53A96: _IO_default_xsputn (genops.c:411)
==2542==    by 0x4B26C84: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x4BDDA14: __snprintf_chk (snprintf_chk.c:34)
==2542==    by 0x4AA4CE8: snprintf (stdio2.h:64)
==2542==    by 0x4AA4CE8: rc_service_in_runlevel (librc.c:688)
==2542==    by 0x10C6EF: print_services (rc-status.c:214)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b52 is 2 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x48389E2: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B2746B: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x48389F4: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B2746B: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b51 is 1 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4B53A88: _IO_default_xsputn (genops.c:412)
==2542==    by 0x4B26C84: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4B53A96: _IO_default_xsputn (genops.c:411)
==2542==    by 0x4B26C84: vfprintf (vfprintf.c:1643)
==2542==    by 0x4BDDAE8: __vsnprintf_chk (vsnprintf_chk.c:63)
==2542==    by 0x10C141: vsnprintf (stdio2.h:77)
==2542==    by 0x10C141: xasprintf (helpers.h:164)
==2542==    by 0x10C42C: print_service (rc-status.c:161)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b52 is 2 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid free() / delete / delete[] / realloc()
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
 rsyslog                                                                        
                                                                                
                       [  started default ]
 ssh                                                                            
                                                                                
                       [  started default ]
 bootlogs                                                                       
                                                                                
                       [  started default ]
 cron                                                                           
                                                                                
                       [  started default ]
 dbus                                                                           
                                                                                
                       [  started default ]
 irqbalance                                                                     
                                                                                
                       [  started default ]
 motd                                                                           
                                                                                
                       [  started default ]
 rmnologin                                                                      
                                                                                
                       [  started default ]
 rc.local                                                                       
                                                                                
                       [  started default ]
==2542== Invalid read of size 1
==2542==    at 0x48389E2: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B5DEED: strdup (strdup.c:41)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x4AA4561: rc_runlevel_stacks (librc.c:521)
==2542==    by 0x10BAB3: print_stacked_services (rc-status.c:226)
==2542==    by 0x10BAB3: main (rc-status.c:343)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x48389F4: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B5DEED: strdup (strdup.c:41)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x4AA4561: rc_runlevel_stacks (librc.c:521)
==2542==    by 0x10BAB3: print_stacked_services (rc-status.c:226)
==2542==    by 0x10BAB3: main (rc-status.c:343)
==2542==  Address 0x4f36b51 is 1 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 8
==2542==    at 0x4839E10: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:1021)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x4AA4561: rc_runlevel_stacks (librc.c:521)
==2542==    by 0x10BAB3: print_stacked_services (rc-status.c:226)
==2542==    by 0x10BAB3: main (rc-status.c:343)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4AA4297: rc_runlevel_exists (librc.c:483)
==2542==    by 0x4AA4311: ??? (librc.c:376)
==2542==    by 0x4AA456F: rc_runlevel_stacks (librc.c:522)
==2542==    by 0x10BAB3: print_stacked_services (rc-status.c:226)
==2542==    by 0x10BAB3: main (rc-status.c:343)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4AA42B2: rc_runlevel_exists (librc.c:483)
==2542==    by 0x4AA4311: ??? (librc.c:376)
==2542==    by 0x4AA456F: rc_runlevel_stacks (librc.c:522)
==2542==    by 0x10BAB3: print_stacked_services (rc-status.c:226)
==2542==    by 0x10BAB3: main (rc-status.c:343)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x48389E2: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B5DEED: strdup (strdup.c:41)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x4AA4342: ??? (librc.c:386)
==2542==    by 0x4AA456F: rc_runlevel_stacks (librc.c:522)
==2542==    by 0x10BAB3: print_stacked_services (rc-status.c:226)
==2542==    by 0x10BAB3: main (rc-status.c:343)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x48389F4: __strlen_sse2 (vg_replace_strmem.c:460)
==2542==    by 0x4B5DEED: strdup (strdup.c:41)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x4AA4342: ??? (librc.c:386)
==2542==    by 0x4AA456F: rc_runlevel_stacks (librc.c:522)
==2542==    by 0x10BAB3: print_stacked_services (rc-status.c:226)
==2542==    by 0x10BAB3: main (rc-status.c:343)
==2542==  Address 0x4f36b51 is 1 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 8
==2542==    at 0x4839E10: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:1021)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x4AA4342: ??? (librc.c:386)
==2542==    by 0x4AA456F: rc_runlevel_stacks (librc.c:522)
==2542==    by 0x10BAB3: print_stacked_services (rc-status.c:226)
==2542==    by 0x10BAB3: main (rc-status.c:343)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4B66960: __strcmp_sse2_unaligned (strcmp-sse2-unaligned.S:24)
==2542==    by 0x4AAC2A3: rc_stringlist_find (librc-stringlist.c:81)
==2542==    by 0x10BADF: print_stacked_services (rc-status.c:228)
==2542==    by 0x10BADF: main (rc-status.c:343)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4839A74: strcmp (vg_replace_strmem.c:846)
==2542==    by 0x4AAC2A3: rc_stringlist_find (librc-stringlist.c:81)
==2542==    by 0x10BADF: print_stacked_services (rc-status.c:228)
==2542==    by 0x10BADF: main (rc-status.c:343)
==2542==  Address 0x4f36b51 is 1 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
Dynamic Runlevel: hotplugged
==2542== Invalid read of size 1
==2542==    at 0x4AA5667: rc_services_in_runlevel (librc.c:965)
==2542==    by 0x4AA578D: rc_services_in_runlevel_stacked (librc.c:981)
==2542==    by 0x10BC0F: main (rc-status.c:371)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 8
==2542==    at 0x4839E10: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:1021)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x4AA4561: rc_runlevel_stacks (librc.c:521)
==2542==    by 0x4AA5798: rc_services_in_runlevel_stacked (librc.c:982)
==2542==    by 0x10BC0F: main (rc-status.c:371)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4AA4297: rc_runlevel_exists (librc.c:483)
==2542==    by 0x4AA4311: ??? (librc.c:376)
==2542==    by 0x4AA456F: rc_runlevel_stacks (librc.c:522)
==2542==    by 0x4AA5798: rc_services_in_runlevel_stacked (librc.c:982)
==2542==    by 0x10BC0F: main (rc-status.c:371)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4AA42B2: rc_runlevel_exists (librc.c:483)
==2542==    by 0x4AA4311: ??? (librc.c:376)
==2542==    by 0x4AA456F: rc_runlevel_stacks (librc.c:522)
==2542==    by 0x4AA5798: rc_services_in_runlevel_stacked (librc.c:982)
==2542==    by 0x10BC0F: main (rc-status.c:371)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4B66960: __strcmp_sse2_unaligned (strcmp-sse2-unaligned.S:24)
==2542==    by 0x4AA7772: ??? (librc-depend.c:351)
==2542==    by 0x4AA81FD: ??? (librc-depend.c:448)
==2542==    by 0x4AA841E: ??? (librc-depend.c:434)
==2542==    by 0x4AA841E: ??? (librc-depend.c:434)
==2542==    by 0x4AA8A70: rc_deptree_depends (librc-depend.c:512)
==2542==    by 0x10BDC5: main (rc-status.c:394)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== Invalid read of size 1
==2542==    at 0x4B66960: __strcmp_sse2_unaligned (strcmp-sse2-unaligned.S:24)
==2542==    by 0x4AA7772: ??? (librc-depend.c:351)
==2542==    by 0x4AA81FD: ??? (librc-depend.c:448)
==2542==    by 0x4AA8A70: rc_deptree_depends (librc-depend.c:512)
==2542==    by 0x10BDC5: main (rc-status.c:394)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
Dynamic Runlevel: needed/wanted
==2542== Conditional jump or move depends on uninitialised value(s)
==2542==    at 0x10C416: print_service (rc-status.c:160)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BE2C: main (rc-status.c:409)
==2542== 
==2542== Conditional jump or move depends on uninitialised value(s)
==2542==    at 0x48369A1: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BE2C: main (rc-status.c:409)
==2542== 
==2542== Invalid free() / delete / delete[] / realloc()
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BE2C: main (rc-status.c:409)
==2542==  Address 0x572e250 is 0 bytes inside a block of size 4,096 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C6B9: print_services (rc-status.c:208)
==2542==    by 0x10BE2C: main (rc-status.c:409)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4AA35E8: ??? (helpers.h:65)
==2542==    by 0x4AA419E: rc_runlevel_get (librc.c:445)
==2542==    by 0x10C7D4: print_services (rc-status.c:205)
==2542==    by 0x10BE2C: main (rc-status.c:409)
==2542== 
 umountroot                                                                     
                                                                                
                       [  started default ]
 umountfs                                                                       
                                                                                
                       [  started default ]
 umountnfs.sh                                                                   
                                                                                
                       [  started default ]
Dynamic Runlevel: manual
==2542== Invalid free() / delete / delete[] / realloc()
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x4AAC533: rc_stringlist_free (librc-stringlist.c:145)
==2542==    by 0x10B8C4: main (rc-status.c:422)
==2542==  Address 0x4f36b50 is 0 bytes inside a block of size 8 free'd
==2542==    at 0x48369EB: free (vg_replace_malloc.c:530)
==2542==    by 0x10C439: print_service (rc-status.c:162)
==2542==    by 0x10C6FB: print_services (rc-status.c:215)
==2542==    by 0x10BAAB: main (rc-status.c:342)
==2542==  Block was alloc'd at
==2542==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==2542==    by 0x4B5DEF9: strdup (strdup.c:42)
==2542==    by 0x4AAC133: xstrdup (helpers.h:103)
==2542==    by 0x4AAC133: rc_stringlist_add (librc-stringlist.c:35)
==2542==    by 0x10BE69: main (rc-status.c:333)
==2542== 
==2542== 
==2542== HEAP SUMMARY:
==2542==     in use at exit: 141 bytes in 9 blocks
==2542==   total heap usage: 4,238 allocs, 4,242 frees, 11,309,658 bytes 
allocated
==2542== 
==2542== LEAK SUMMARY:
==2542==    definitely lost: 48 bytes in 3 blocks
==2542==    indirectly lost: 93 bytes in 6 blocks
==2542==      possibly lost: 0 bytes in 0 blocks
==2542==    still reachable: 0 bytes in 0 blocks
==2542==         suppressed: 0 bytes in 0 blocks
==2542== Rerun with --leak-check=full to see details of leaked memory
==2542== 
==2542== For counts of detected and suppressed errors, rerun with: -v
==2542== Use --track-origins=yes to see where uninitialised values come from
==2542== ERROR SUMMARY: 8609 errors from 36 contexts (suppressed: 0 from 0)









root@debian:~# gdb -q --args rc-status 
Reading symbols from rc-status...Reading symbols from 
/usr/lib/debug/.build-id/a7/8a9823e572bf06eaa670133aa2af65f028329a.debug...done.
done.
(gdb) run
Starting program: /bin/rc-status 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Runlevel: default
 console-setup.sh                                                               
                                                                                
                       [  started default ]
Stacked Runlevel: 
Stacked Runlevel: shutdown
Stacked Runlevel: nonetwork
Stacked Runlevel: recovery
 killprocs                                                                      
                                                                                
                              [  stopped  ]
 bootlogs                                                                       
                                                                                
                      [  started recovery ]
Stacked Runlevel: default
 console-setup.sh                                                               
                                                                                
                       [  started default ]
Stacked Runlevel: sysinit
 hostname.sh                                                                    
                                                                                
                       [  started sysinit ]
Stacked Runlevel: off
 umountroot                                                                     
                                                                                
                           [  started off ]
Stacked Runlevel: boot
Dynamic Runlevel: hotplugged
corrupted double-linked list

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht 
gefunden.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff7bb42f1 in __GI_abort () at abort.c:79
#2  0x00007ffff7bf5867 in __libc_message (action=action@entry=do_abort, 
fmt=fmt@entry=0x7ffff7cff273 "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff7bfbe0a in malloc_printerr (str=str@entry=0x7ffff7cfd3d6 
"corrupted double-linked list") at malloc.c:5350
#4  0x00007ffff7bfc024 in malloc_consolidate (av=av@entry=0x7ffff7d34c40 
<main_arena>) at malloc.c:4456
#5  0x00007ffff7bfedad in _int_malloc (av=av@entry=0x7ffff7d34c40 <main_arena>, 
bytes=bytes@entry=32816) at malloc.c:3703
#6  0x00007ffff7c0064c in __GI___libc_malloc (bytes=32816) at malloc.c:3057
#7  0x00007ffff7c3d743 in __alloc_dir (fd=3, close_fd=<optimized out>, 
flags=<optimized out>, statp=<optimized out>) at ../sysdeps/posix/opendir.c:216
#8  0x00007ffff7c3d85d in opendir_tail (fd=3) at ../sysdeps/posix/opendir.c:136
#9  0x00007ffff7c3d910 in __opendir (name=name@entry=0x7fffffffdba0 
"/run/openrc/hotplugged") at ../sysdeps/posix/opendir.c:190
#10 0x00007ffff7d62aa9 in ls_dir (dir=dir@entry=0x7fffffffdba0 
"/run/openrc/hotplugged", options=options@entry=1) at librc.c:71
#11 0x00007ffff7d6497d in __RC_rc_services_in_state (state=<optimized out>) at 
librc.c:1006
#12 0x0000555555557b8b in main (argc=<optimized out>, argv=<optimized out>) at 
rc-status.c:353
(gdb) up
...
(gdb) 
#10 0x00007ffff7d62aa9 in ls_dir (dir=dir@entry=0x7fffffffdba0 
"/run/openrc/hotplugged", options=options@entry=1) at librc.c:71
warning: Source file is more recent than executable.
71              if ((dp = opendir(dir)) == NULL)


(gdb) list librc.c:56,72
56
57      #define LS_INITD        0x01
58      #define LS_DIR          0x02
59      static RC_STRINGLIST *
60      ls_dir(const char *dir, int options)
61      {
62              DIR *dp;
63              struct dirent *d;
64              RC_STRINGLIST *list = NULL;
65              struct stat buf;
66              size_t l;
67              char file[PATH_MAX];
68              int r;
69
70              list = rc_stringlist_new();
71              if ((dp = opendir(dir)) == NULL)
72                      return list;




(gdb) b ls_dir
Breakpoint 1 at 0x7ffff7d62a70: file librc.c, line 61.
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb) run
Starting program: /bin/rc-status 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 * Caching service dependencies ...                                             
                                                                                
                                     [ ok ]
Runlevel: default

Breakpoint 1, ls_dir (dir=dir@entry=0x7fffffffdbc0 "/etc/runlevels/default", 
options=options@entry=1) at librc.c:61
warning: Source file is more recent than executable.
61      {
(gdb) b free
Breakpoint 3 at 0x7ffff7bfec50: free. (2 locations)
(gdb) cont








root@debian:~# gdb -q --args rc-status 
Reading symbols from rc-status...Reading symbols from 
/usr/lib/debug/.build-id/a7/8a9823e572bf06eaa670133aa2af65f028329a.debug...done.
done.
(gdb) set height 0
(gdb) set width 0
(gdb) set pagination off
(gdb) directory /root/openrc/orig/openrc-0.38/src/librc
Source directories searched: /root/openrc/orig/openrc-0.38/src/librc:$cdir:$cwd
(gdb) directory /root/openrc/orig/openrc-0.38/src/rc
Source directories searched: 
/root/openrc/orig/openrc-0.38/src/rc:/root/openrc/orig/openrc-0.38/src/librc:$cdir:$cwd
(gdb) b main
Breakpoint 1 at 0x35c0: file rc-status.c, line 246.
(gdb) run
Starting program: /bin/rc-status 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, main (argc=1, argv=0x7fffffffed18) at rc-status.c:246
246             applet = basename_c(argv[0]);
(gdb) b free
Breakpoint 2 at 0x7ffff7bfec50: free. (2 locations)
(gdb) command
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
>silent
>print mem
>bt
>cont
>end
(gdb) cont





gdb -q --args rc-status

set height 0
set width 0
set pagination off
directory /root/openrc/orig/openrc-0.38/src/librc
directory /root/openrc/orig/openrc-0.38/src/rc
b main
run




---------


valgrind --vgdb=yes --vgdb-error=0 rc-status



gdb /bin/rc-status

target remote | vgdb
set height 0
set width 0
set pagination off
directory /root/openrc/orig/openrc-0.38/src/librc
directory /root/openrc/orig/openrc-0.38/src/rc












...
==16052== Continuing ...
==16052== Invalid free() / delete / delete[] / realloc()
==16052==    at 0x48369EB: free (vg_replace_malloc.c:530)
==16052==    by 0x10C439: print_service (rc-status.c:162)
==16052==    by 0x10C6FB: print_services (rc-status.c:215)
==16052==    by 0x10BAAB: main (rc-status.c:342)
==16052==  Address 0x4f38b50 is 0 bytes inside a block of size 8 free'd
==16052==    at 0x48369EB: free (vg_replace_malloc.c:530)
==16052==    by 0x10C439: print_service (rc-status.c:162)
==16052==    by 0x10C6FB: print_services (rc-status.c:215)
==16052==    by 0x10BAAB: main (rc-status.c:342)
==16052==  Block was alloc'd at
==16052==    at 0x48357BF: malloc (vg_replace_malloc.c:299)
==16052==    by 0x4B5FEF9: strdup (strdup.c:42)
==16052==    by 0x4AAE133: xstrdup (helpers.h:103)
==16052==    by 0x4AAE133: rc_stringlist_add (librc-stringlist.c:35)
==16052==    by 0x10BE69: main (rc-status.c:333)
==16052== 
==16052== (action on error) vgdb me ... 




(gdb) 
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000000048369eb in _vgr10050ZU_VgSoSynsomalloc_free (p=0x4f38b50) at 
m_replacemalloc/vg_replace_malloc.c:530
530     m_replacemalloc/vg_replace_malloc.c: Datei oder Verzeichnis nicht 
gefunden.
(gdb) bt
#0  0x00000000048369eb in _vgr10050ZU_VgSoSynsomalloc_free (p=0x4f38b50) at 
m_replacemalloc/vg_replace_malloc.c:530
#1  0x000000000010c43a in print_service (service=<optimized out>) at 
rc-status.c:162
#2  0x000000000010c6fc in print_services (runlevel=0x4f38b50 "default", 
svcs=0x4f66550) at rc-status.c:215
#3  0x000000000010baac in main (argc=1, argv=<optimized out>) at rc-status.c:342




(gdb) list rc-status.c:126,165
126     static void
127     print_service(const char *service)
128     {
129             char *status = NULL;
130             char *uptime = NULL;
131             char *child_pid = NULL;
132             char *start_time = NULL;
133             int cols =  printf(" %s", service);
134             const char *c = ecolor(ECOLOR_GOOD);
135             RC_SERVICE state = rc_service_state(service);
136             ECOLOR color = ECOLOR_BAD;
137
138             if (state & RC_SERVICE_STOPPING)
139                     xasprintf(&status, "stopping ");
140             else if (state & RC_SERVICE_STARTING) {
141                     xasprintf(&status, "starting ");
142                     color = ECOLOR_WARN;
143             } else if (state & RC_SERVICE_INACTIVE) {
144                     xasprintf(&status, "inactive ");
145                     color = ECOLOR_WARN;
146             } else if (state & RC_SERVICE_STARTED) {
147                     errno = 0;
148                     if (rc_service_daemons_crashed(service) && errno != 
EACCES)
149                     {
150                             child_pid = rc_service_value_get(service, 
"child_pid");
151                             start_time = rc_service_value_get(service, 
"start_time");
152                             if (start_time && child_pid)
153                                     xasprintf(&status, " unsupervised ");
154                             else
155                                     xasprintf(&status, " crashed ");
156                             free(child_pid);
157                             free(start_time);
158                     } else {
159                             uptime = get_uptime(service);
160                             if (uptime) {
161                                     xasprintf(&status, " started %s", 
uptime);
162                                     free(uptime);                           
                <<<<<<<<<<<<<<<
163                             } else
164                                     xasprintf(&status, " started ");
165                             color = ECOLOR_GOOD;



(gdb) list rc-status.c:77,124
77
78      static char *get_uptime(const char *service)
79      {
80              RC_SERVICE state = rc_service_state(service);
81              char *start_count;
82              time_t now;
83              char *start_time_string;
84              time_t start_time;
85              time_t time_diff;
86              time_t diff_days = (time_t) 0;
87              time_t diff_hours = (time_t) 0;
88              time_t diff_mins = (time_t) 0;
89              time_t diff_secs = (time_t) 0;
90              char *uptime;
91
92              if (state & RC_SERVICE_STARTED) {
93                      start_count = rc_service_value_get(service, 
"start_count");
94                      start_time_string = rc_service_value_get(service, 
"start_time");
95                      if (start_count && start_time_string) {
96                              start_time = to_time_t(start_time_string);
97                              now = time(NULL);
98                              time_diff = (time_t) difftime(now, start_time);
99                              diff_secs = time_diff;
100                             if (diff_secs > (time_t) 86400) {
101                                     diff_days = diff_secs / (time_t) 86400;
102                                     diff_secs %= diff_days * (time_t) 86400;
103                             }
104                             if (diff_secs > (time_t) 3600) {
105                                     diff_hours = diff_secs / (time_t) 3600;
106                                     diff_secs %= diff_hours * (time_t) 3600;
107                             }
108                             if (diff_secs > (time_t) 60) {
109                                     diff_mins = diff_secs / (time_t) 60;
110                                     diff_secs %= diff_mins * (time_t) 60;
111                             }
112                             if (diff_days > 0)
113                                     xasprintf(&uptime,
114                                                     "%ld day(s) 
%02ld:%02ld:%02ld (%s)",
115                                                     diff_days, diff_hours, 
diff_mins, diff_secs,
116                                                     start_count);
117                             else
118                                     xasprintf(&uptime,
119                                                     "%02ld:%02ld:%02ld 
(%s)",
120                                                     diff_hours, diff_mins, 
diff_secs, start_count);
121                     }
122             }
123             return uptime;
124     }






--------------


gdb -q --args rc-status

set height 0
set width 0
set pagination off
directory /root/openrc/orig/openrc-0.38/src/librc
directory /root/openrc/orig/openrc-0.38/src/rc
directory /root/libc6/orig/glibc-2.27/malloc
b rc-status.c:123
run
display uptime

Reply via email to