Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 May 2021 13:35:55 -0800
From:      Rob Wing <rob.fx907@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Kirk McKusick <mckusick@freebsd.org>,  "src-committers@freebsd.org" <src-committers@freebsd.org>,  "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>,  "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: f190f9193bc1 - main - Fix fsck_ufs segfaults with gjournal (SU+J)
Message-ID:  <CAF3%2Bn_e1Xcf4jC64hzYmVVzT1vmjyNFyPdGAu=MJCtc=mkLF9w@mail.gmail.com>
In-Reply-To: <CAF3%2Bn_cJ0uWwT6deSXHFGWWyx6PhOPCDw_0C0KsZQXE4=m0iUQ@mail.gmail.com>
References:  <202105212038.14LKcb3U062829@gitrepo.freebsd.org> <4faa0667-ca1b-923b-fbae-c97b0b863589@FreeBSD.org> <CAF3%2Bn_cJ0uWwT6deSXHFGWWyx6PhOPCDw_0C0KsZQXE4=m0iUQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I put a revision up https://reviews.freebsd.org/D30537 if anyone wants to
have a look.

As John already pointed out, readsb() is what sets fs_bsize.

I considered placing the setup() routine after sblock_init()..but decided
to add an additional bufinit() call just before gjournal_check as it is the
least intrusive fix I can come up with at the moment, while still fixing
the original bug and (hopefully) not introducing others.

-Rob

On Fri, May 28, 2021 at 1:21 AM Rob Wing <rob.fx907@gmail.com> wrote:

> Hmm, I provided a fix for (
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D245907) and it appear=
s
> to have created a spiderweb of breakage - as noted by jhb and chs (in com=
mit
> 84768d114951e88288024f09d4beae0956c3cf21).
>
> I=E2=80=99ll have some time to dig into this in the next day or two.
>
> In the meantime, the best idea I have for an immediate fix is to revert
> the aforementioned commit and commit f190f9193bc10a8193c87e0a02fa91400e4e=
b159,
> then apply/test the patch found at:
> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D225092&action=3Ddif=
f
>
> If there=E2=80=99s any input or suggestions, let me know.
>
> Thanks,
> Rob
>
>
> On Thursday, May 27, 2021, John Baldwin <jhb@freebsd.org> wrote:
>
>> On 5/21/21 1:38 PM, Kirk McKusick wrote:
>>
>>> The branch main has been updated by mckusick:
>>>
>>> URL:
>>> https://cgit.FreeBSD.org/src/commit/?id=3Df190f9193bc10a8193c87e0a02fa9=
1400e4eb159
>>>
>>> commit f190f9193bc10a8193c87e0a02fa91400e4eb159
>>> Author:     Kirk McKusick <mckusick@FreeBSD.org>
>>> AuthorDate: 2021-05-21 20:41:40 +0000
>>> Commit:     Kirk McKusick <mckusick@FreeBSD.org>
>>> CommitDate: 2021-05-21 20:42:37 +0000
>>>
>>>      Fix fsck_ufs segfaults with gjournal (SU+J)
>>>           The segfault was being hit in ckfini() (sbin/fsck_ffs/fsutil.=
c)
>>>      while attempting to traverse the buffer cache to flush dirty
>>> buffers.
>>>      The tail queue used for the buffer cache was not initialized befor=
e
>>>      dropping into gjournal_check(). Move the buffer initialization
>>> earlier
>>>      so that it has been done before calling gjournal_check().
>>>
>>
>> This appears to have broken fsck in at least some use cases.  On my rpi
>> I get this error trying to boot:
>>
>> Setting hostid: 0x4ce29432.
>> Starting file system checks:
>> fsck_ufs: Initial malloc(-1515870811) failed
>> fsck_ufs: Initial malloc(-1515870811) failed
>> Automatic file system check failed; help!
>> ERROR: ABORTING BOOT (sending SIGTERM to parent)!
>>
>> The amount being passed to malloc() is malloc junk:
>>
>> (gdb) p/x -1515870811
>> $1 =3D 0xa5a5a5a5
>>
>> The i386 CI jobs in jenkins have been failing with the same error recent=
ly
>> as well.
>>
>> I guess this means sblock isn't fully initialized by sblock_init()?  At
>> least
>> not enough to set fs_bsize?  Hmm, perhaps readsb() is what sets fs_bsize=
?
>>
>> --
>> John Baldwin
>>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF3%2Bn_e1Xcf4jC64hzYmVVzT1vmjyNFyPdGAu=MJCtc=mkLF9w>