OpenSolaris

Printable Version Enter a New Search
Bug ID 6790249
Synopsis svc.startd drops core when libscf_note_method_log() succeeds
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:smf
Keywords
Responsible Engineer Sean Wilcox
Reported Against
Duplicate Of
Introduced In solaris_10
Commit to Fix snv_107
Fixed In snv_107
Release Fixed solaris_nevada(snv_107)
Related Bugs 6790251 , 6183620
Submit Date 5-January-2009
Last Update Date 28-January-2009
Description
See bugzilla bug 5956 for additional info, http://defect.opensolaris.org/bz/show_bug.cgi?id=5956

Beginning with build 105 of OpenSolaris, the live CD fails to boot successfully, because svc.startd is dropping core and filling the ramdisk, which then leads to other service failures as the repository can't be updated, and the boot process drops to maintenance. Proximate cause is this error shown on the console:

libscf.c:3875: libscf_note_method_log() failed with unexpected error 0.
Aborting.

A value of zero here is success, but is interpreted as failure, for no good reason.  The code block in question is:

   3856 	ret = libscf_note_method_log(inst, LOG_PREFIX_EARLY,
   3857 	    STARTD_DEFAULT_LOG);
   3858 	if (ret == 0) {
   3859 		ret = libscf_note_method_log(inst, LOG_PREFIX_NORMAL,
   3860 		    STARTD_DEFAULT_LOG);
   3861 	}
   3862 
   3863 	switch (ret) {
   3864 		case ECONNABORTED:
   3865 		case EPERM:
   3866 		case EACCES:
   3867 		case EROFS:
   3868 		case EAGAIN:
   3869 			break;
   3870 
   3871 		case ECANCELED:
   3872 			goto add_inst;
   3873 
   3874 		default:
   3875 			bad_error("libscf_note_method_log", ret);
   3876 	}

This never should have worked, but I suspect we had race conditions causing the second call to libscf_note_method_log() at 3859 masking it for the last 4 years.  Fixing it appears to require only adding 0 to the first case block, so that we exit the function normally.
Work Around
N/A
Comments
I've verified that svc.startd patched as shown in the suggested fix no longer aborts on the live CD image.