Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 527370

Summary: sys-apps/openrc-0.13.2: Crash in rc_service_daemons_crashed
Product: Gentoo Hosted Projects Reporter: Martin Cyr <spooler>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: critical    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 520144    
Attachments: fixes incorrent handling of chroot option

Description Martin Cyr 2014-10-29 18:37:42 UTC
When running /sbin/rc, I had the following errors:
*** Error in `/sbin/openrc': free(): invalid next size (fast): 0x000000000065f850 ***
*** Error in `/sbin/openrc': malloc(): memory corruption: 0x000000000065f870 ***
Inconsistency detected by ld.so: dl-open.c: 220: dl_open_worker: Assertion `_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT' failed!

After emerging 0.13.1, everything works.

gdb backtrace show the culprit as
#20 __RC_rc_service_daemons_crashed (service=0x65e990 "dhcpd") at librc-daemon.c:568
568                             if ((fp = fopen(spidfile, "r"))) {

Reproducible: Always

Steps to Reproduce:
1. emerge =sys-apps/openrc-0.13.2
2. /sbin/rc
3. Crash
Actual Results:  
*** Error in `/sbin/openrc': free(): invalid next size (fast): 0x000000000065f850 ***
*** Error in `/sbin/openrc': malloc(): memory corruption: 0x000000000065f870 ***
Inconsistency detected by ld.so: dl-open.c: 220: dl_open_worker: Assertion `_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT' failed!

Expected Results:  
* Starting X service..
Comment 1 Alexander Vershilov (RETIRED) gentoo-dev 2014-10-29 18:49:24 UTC
Hello, Martin.

Thanks for the report. We will inverstigate it soon. Just a question, do you happen to use services that are using chroot functionality?
Comment 2 Martin Cyr 2014-10-29 19:00:20 UTC
From what I can see, in init.d/dhcpd checkconfig(), there is a "set -- ${DHCPD_OPTS} ${chroot:+-chroot} ${chroot} -t".

So I guess dhcpd is chrooting, right?
Comment 3 Martin Cyr 2014-10-29 19:05:25 UTC
I did not check conf.d to see if it was enabled, but it is not.
So I don't think I have anything chrooted via any conf.d.
Any way to make sure?
Comment 4 Alexander Vershilov (RETIRED) gentoo-dev 2014-10-29 19:08:56 UTC
(In reply to Martin Cyr from comment #3)
> I did not check conf.d to see if it was enabled, but it is not.
> So I don't think I have anything chrooted via any conf.d.
> Any way to make sure?

I'm personally don't know better way then manually check pidfile existance and ps output. It seems that this is exactly the failure path. I'm going to test dhcpd and fix issue asap.
Comment 5 Alexander Vershilov (RETIRED) gentoo-dev 2014-10-29 19:20:37 UTC
Bug can be reproduced on dhcp[server] service.
Comment 6 Alexander Vershilov (RETIRED) gentoo-dev 2014-10-29 20:13:43 UTC
Created attachment 387758 [details, diff]
fixes incorrent handling of chroot option
Comment 7 Alexander Vershilov (RETIRED) gentoo-dev 2014-10-29 20:14:42 UTC
(In reply to Martin Cyr from comment #3)
> I did not check conf.d to see if it was enabled, but it is not.
> So I don't think I have anything chrooted via any conf.d.
> Any way to make sure?

I have attached a patch that fixes situation for me, you can use it via patchuser that exists in ebuild. Also I'll create a pull request.
Comment 8 Martin Cyr 2014-10-29 21:44:08 UTC
I can confirm it works here too.

Thanks.
Comment 9 Alexander Vershilov (RETIRED) gentoo-dev 2014-10-29 21:55:54 UTC
Thanks for(In reply to Martin Cyr from comment #8)
> I can confirm it works here too.
> 
> Thanks.

Thanks for the test.

Please, keep bug open until this fix will land into a portage tree.
Comment 10 William Hubbs gentoo-dev 2014-11-05 22:49:08 UTC
This is included in commit be952be and will be part of openrc-0.14 and
OpenRC-0.13.3.