btrfs segmentation fault (LM20)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
wrealcon

btrfs segmentation fault (LM20)

Post by wrealcon »

Hi,

I have just successfully upgraded LM 19.3 to LM 20.
Unfortunately I've spotted some strange error related to btrfs. The following command:

Code: Select all

sudo btrfs subvolume list /
throws a segmentation fault from time to time.
Let's say I execute it 5 times, then 2x I got an error and 3x a list of my subvolumes.
Kern.log says this:

Code: Select all

Oct 25 11:34:54 pc kernel: [ 4236.295678] btrfs[33658]: segfault at 7fff67eae27b ip 000055b895f84264 sp 00007fff63ead9d0 error 4 in btrfs[55b895f40000+6c000]
Oct 25 11:34:54 pc kernel: [ 4236.295683] Code: 44 24 14 00 00 00 00 31 c0 4c 8d bc 24 c0 00 00 00 8b 7c 24 14 3b bc 24 98 00 00 00 0f 83 ed 01 00 00 49 8d 14 07 48 83 c0 20 <8b> 72 18 8b 4a 1c 48 89 44 24 08 48 8b 6a 08 4c 8b 62 10 89 74 24
From the other hand, this command:

Code: Select all

sudo btrfs subvolume show /run/timeshift/backup/timeshift-btrfs/snapshots/2020-10-25_11-00-01/@home
does not end with segmentation fault.

Now questions:
1. Did anyone encounter this kind of error with btrfs in LM20?
2. Is there a way to get more info about the crash?
3. Is it possible (and safe) to upgrade btrfs-progs to 5.7 or 5.9 and see if this issue was fixed there?


Kind regards,
Max.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
LanceM

Re: btrfs segmantation fault (LM20)

Post by LanceM »

Never saw such errors on any of mine. My output of

Code: Select all

sudo btrfs subvolume list /

Code: Select all

sudo btrfs subvolume list /
ID 369 gen 46986 top level 5 path @home
ID 452 gen 46986 top level 5 path @
ID 453 gen 43701 top level 5 path timeshift-btrfs/snapshots/2020-10-16_17-04-32/@
ID 454 gen 41630 top level 5 path timeshift-btrfs/snapshots/2020-10-16_17-04-32/@home
ID 455 gen 43701 top level 5 path timeshift-btrfs/snapshots/2020-10-19_10-02-34/@
ID 456 gen 41680 top level 5 path timeshift-btrfs/snapshots/2020-10-19_10-02-34/@home
ID 459 gen 43701 top level 5 path timeshift-btrfs/snapshots/2020-10-20_18-36-09/@
ID 460 gen 43015 top level 5 path timeshift-btrfs/snapshots/2020-10-20_18-36-09/@home
ID 461 gen 43701 top level 5 path timeshift-btrfs/snapshots/2020-10-21_13-49-38/@
ID 462 gen 43703 top level 5 path timeshift-btrfs/snapshots/2020-10-21_13-49-38/@home
Have you tried the scrub command to fix errors?
To run

Code: Select all

sudo btrfs scrub start /
After it completes (the HDD activity light quits blinking) you run

Code: Select all

sudo btrfs scrub status /
bronger

Re: btrfs segmantation fault (LM20)

Post by bronger »

I also experience this problem with Ubuntu 20.04. I think this has not happened until a couple of days ago.
wrealcon

Re: btrfs segmentation fault (LM20)

Post by wrealcon »

So it is not only my configuration if it happens on bronger's machine.

LanceM, segmentation fault should not happen ever. Actually I'm scared of running any tool of btrfs, because what if it will start doing something with a file system and segmentation fault happens?

Does anyone know if upgrading to btrfs-tools 5.7 or 5.9 is safe?
LanceM

Re: btrfs segmentation fault (LM20)

Post by LanceM »

If you are afraid to run scrub for errors, I suppose you'll have to find another possible solution. That is what scrub is for.

Code: Select all

lance@LM:~$ sudo btrfs scrub start /
scrub started on /, fsid 4fb39f12-12d9-406c-abc5-9c1b866cfde7 (pid=3781)
lance@LM:~$ sudo btrfs scrub status /
UUID:             4fb39f12-12d9-406c-abc5-9c1b866cfde7
Scrub started:    Mon Oct 26 08:19:01 2020
Status:           finished
Duration:         0:00:16
Total to scrub:   7.43GiB
Rate:             475.51MiB/s
Error summary:    no errors found
LanceM

Re: btrfs segmentation fault (LM20)

Post by LanceM »

As an alternative, you can run scrub during a live session. Mount the desired partition with Disks and note the mounted path below the Disks layout window. You can copy and paste the path into the Terminal, using the same scrub commands I left above. I can't see how that wouldn't be safe, with the drive offline.
wrealcon

Re: btrfs segmentation fault (LM20)

Post by wrealcon »

LanceM, thank you for your answers.
Please note, that my main point of the post is the fact that btrfs application is crashing (segmentation fault).
Additionally, I've written, that the crash happens circa 50% of times when listing subvolumes. For other commands, it seems to be working.

I did not have this issue on LM 19.3 and I was playing around with subvolumes a lot.

So, the problem does not relate to my filesystem (thus scrubbing is irrelevant in this case), but to the fact that btrfs app (/bin/btrfs) is crashing when listing subvolumes.
Last edited by wrealcon on Mon Oct 26, 2020 5:06 pm, edited 1 time in total.
LanceM

Re: btrfs segmentation fault (LM20)

Post by LanceM »

I don't even know what a submodule is. I do know what a subvolume is.
wrealcon

Re: btrfs segmentation fault (LM20)

Post by wrealcon »

Of course I've meant subvolumes :D
I was working with git when writing the last reply :D
bronger

Re: btrfs segmentation fault (LM20)

Post by bronger »

I ended up creating a wrapper script that calls Btrfs until it exits normally. I can wait for a fix. Besides, I doesn’t seem to occur today. Maybe it goes as magically as it came.

I want to add that this is a segmentation fault in a user land tool. The kernel part of Btrfs is unaffected. Moreover, it is a reading operation. Therefore, I don’t think that it can do any harm to my data. If “ls” would exit with a segfault, I would not be afraid either.
matzzzl

Re: btrfs segmentation fault (LM20)

Post by matzzzl »

I am also experiencing this bug under Ubuntu 18.04 LTS with HWE-Kernel 5.4.0-52-generic and opened the following bug report:
https://bugs.launchpad.net/ubuntu/+sour ... ug/1902525
Locked

Return to “Beginner Questions”