Bug 1124843

Summary: systemd crashes after systemctl status mariadb
Product: [Fedora] Fedora Reporter: Honza Horak <hhorak>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: johannbg, lnykryn, msekleta, s, systemd-maint, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-208-26.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-02 07:26:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
mariadb.service that systemd crashed with
none
mysqld-compat.conf that systemd crashed with none

Description Honza Horak 2014-07-30 12:46:02 UTC
Description of problem:
I had a file under
/usr/lib/systemd/system/mariadb.service.d/mysqld-compat.conf
that was not owned by any package, since it as a leftover from testing, and mariadb-galera-server installed (not mariadb-server).

Then after running `systemctl status mariadb` systemd crashed with the following backtrace:
(gdb) bt
#0  0x00007f1ecffb762b in raise (sig=11) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1  0x00007f1ed1b02abe in crash (sig=11) at ../src/core/main.c:152
#2  <signal handler called>
#3  0x00007f1ed2e94d00 in ?? ()
#4  0x00007f1ed1b5fcc6 in bucket_hash (p=0x7f1ed2f53000, h=0x7f1ed2e94970) at ../src/shared/hashmap.c:181
#5  hashmap_remove (h=0x7f1ed2e94970, key=key@entry=0x7f1ed2f53000) at ../src/shared/hashmap.c:578
#6  0x00007f1ed1b63735 in set_remove (s=<optimized out>, value=value@entry=0x7f1ed2f53000) at ../src/shared/set.c:75
#7  0x00007f1ed1b7a871 in bidi_set_free (s=0x7f1ed2e94f60, u=0x7f1ed2f53000) at ../src/core/unit.c:343
#8  unit_free (u=0x7f1ed2f53000) at ../src/core/unit.c:436
#9  0x00007f1ed1b04a3e in manager_dispatch_cleanup_queue (m=0x7f1ed2d4ba30) at ../src/core/manager.c:590
#10 0x00007f1ed1b09412 in manager_loop (m=0x7f1ed2d4ba30) at ../src/core/manager.c:1851
#11 0x00007f1ed1b0098e in main (argc=5, argv=0x7fff7a4906e8) at ../src/core/main.c:1672
(gdb) quit

content of mariadb.server and mysqld-compat.conf will be attached later.

Version-Release number of selected component (if applicable):
systemd-208-16.fc20.x86_64 (version the backtrace above came from)
but it crashed the same with the version systemd-208-20.fc20.x86_64

How reproducible:
every-time

Steps to Reproduce:
1. create /usr/lib/systemd/system/mariadb.service.d/mysqld-compat.conf
2. #> systemctl daemon-reload
3. #> systemctl status mariadb

Actual results:
systemd showed status output correctly but crashed in the end with signal 15

Expected results:
no crash

Additional info:
after removing /usr/lib/systemd/system/mariadb.service.d/mysqld-compat.conf and running `systemctl daemon-reload` it started to work fine.

Comment 1 Honza Horak 2014-07-30 12:47:02 UTC
Created attachment 922563 [details]
mariadb.service that systemd crashed with

Comment 2 Honza Horak 2014-07-30 12:47:33 UTC
Created attachment 922564 [details]
mysqld-compat.conf that systemd crashed with

Comment 3 Zbigniew Jędrzejewski-Szmek 2014-08-01 18:34:19 UTC
Just great :(

I cannot reproduce this unfortunately... Seems like a hard nut to crack.

Comment 4 Honza Horak 2014-08-04 15:58:21 UTC
Actually I've reproduced it on a fresh VM (F20) with the mariadb.service and mysqld-compat.conf attached:

Steps to Reproduce:
1. #> systemctl status mariadb
2. #> cp mariadb.service /usr/lib/systemd/system/mariadb.service
3. #> mkdir /usr/lib/systemd/system/mariadb.service.d
4. #> cp mysqld-compat.conf /usr/lib/systemd/system/mariadb.service.d
5. #> systemctl daemon-reload
6. #> systemctl status mariadb

Actual results:
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled)
   Active: inactive (dead)
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled)
  Drop-In: /usr/lib/systemd/system/mariadb.service.d
           └─mysqld-compat.conf
   Active: inactive (dead)
Message from syslogd@bughunting-a at Aug  4 17:49:48 ...
 kernel:[17953.596199] systemd[1]: segfault at 7f1e64d90160 ip 00007f1e64d90160 sp 00007fff4216d038 error 15

Message from syslogd@bughunting-a at Aug  4 17:49:48 ...
 kernel:systemd[1]: segfault at 7f1e64d90160 ip 00007f1e64d90160 sp 00007fff4216d038 error 15

Expected results:
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled)
   Active: inactive (dead)
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled)
  Drop-In: /usr/lib/systemd/system/mariadb.service.d
           └─mysqld-compat.conf
   Active: inactive (dead)

Version-Release number of selected component (if applicable):
#> rpm -q systemd mariadb-server
systemd-208-21.fc20.x86_64
mariadb-server-5.5.38-3.fc20.x86_64

Comment 5 Zbigniew Jędrzejewski-Szmek 2014-08-07 15:27:22 UTC
systemd adds a dependency of mariadb.service Requires=mariadb.service.

Comment 6 Zbigniew Jędrzejewski-Szmek 2014-08-08 00:58:01 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=e66047ff62 upstream. Should be easily backportable.

Comment 7 Fedora Update System 2014-10-26 23:10:30 UTC
systemd-208-25.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/systemd-208-25.fc20

Comment 8 Fedora Update System 2014-10-30 12:00:03 UTC
systemd-208-26.fc20,kmod-15-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/systemd-208-26.fc20,kmod-15-2.fc20

Comment 9 Fedora Update System 2014-11-01 01:40:50 UTC
Package systemd-208-26.fc20, kmod-15-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-208-26.fc20 kmod-15-2.fc20'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-14032/systemd-208-26.fc20,kmod-15-2.fc20
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2014-11-02 07:26:53 UTC
systemd-208-25.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2014-11-05 03:56:38 UTC
systemd-208-26.fc20, kmod-15-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.