From nobody@FreeBSD.org  Sat Feb 15 14:06:33 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id E92588CF
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 15 Feb 2014 14:06:33 +0000 (UTC)
Received: from newred.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id D439919C1
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 15 Feb 2014 14:06:33 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by newred.freebsd.org (8.14.7/8.14.7) with ESMTP id s1FE6XVs049068
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 15 Feb 2014 14:06:33 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.7/8.14.7/Submit) id s1FE6XOM049067;
	Sat, 15 Feb 2014 14:06:33 GMT
	(envelope-from nobody)
Message-Id: <201402151406.s1FE6XOM049067@cgiserv.freebsd.org>
Date: Sat, 15 Feb 2014 14:06:33 GMT
From: Oleg Ginzburg <olevole@olevole.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: fsck_ffs/ufs segmentation violation in SU+J mode on SIGINT before check cycle
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         186793
>Category:       bin
>Synopsis:       fsck_ffs/ufs segmentation violation in SU+J mode on SIGINT before check cycle
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 15 14:10:00 UTC 2014
>Closed-Date:    Wed Mar 12 07:33:30 UTC 2014
>Last-Modified:  Wed Mar 12 07:33:30 UTC 2014
>Originator:     Oleg Ginzburg
>Release:        11.0-CURRENT #0 r261907
>Organization:
>Environment:
>Description:
fsck have own signal handler for SIGINT for performing ckfini(0). In some cases (eg: interrupting fsck on reply("USE JOURNAL") stage) it provokes segmentation violation.

Look's like cgbufs[X].b_un.b_cg is not initialized here:

-- in ckfini() from fsutil.c --
 for (cnt = 0; cnt < sblock.fs_ncg; cnt++) {
                if (cgbufs[cnt].b_un.b_cg == NULL)
--

>How-To-Repeat:
Just send SIGINT (or hit Ctrl+C) for "USE JOURNAL?" question

% truncate -s1g /tmp/test.img

% mdconfig -a -t vnode -f /tmp/test.img
md0

% newfs -j /dev/md0

% fsck_ufs /dev/md0
** /dev/md0

USE JOURNAL? [yn] ^CSegmentation fault (core dumped)

>Fix:
sorry

>Release-Note:
>Audit-Trail:

From: Oleg Ginzburg <olevole@olevole.ru>
To: bug-followup@freebsd.org, olevole@olevole.ru, Petr Lampa <lampa@fit.vutbr.cz>, mckusick@freebsd.org
Cc:  
Subject: Re: bin/186793: fsck_ffs/ufs segmentation violation in SU J mode on SIGINT before check cycle
Date: Wed, 12 Mar 2014 05:43:47 +0400

 Please close this PR due to r263062 / PR187221 solve this issue.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Mar 12 07:33:17 UTC 2014 
State-Changed-Why:  
now fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186793 
>Unformatted:
