xz crashed with SIGSEGV in lzma_lzma_optimum_normal

Bug #2032577 reported by Mike
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xz-utils (Ubuntu)
New
Undecided
Unassigned

Bug Description

xz segfaults. More details in
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2032379

From Dmesg.txt on that report

[114838.184191] xz[431483]: segfault at 7f9a93f3701a ip 00007f9b3f780c1a sp 00007f9a957baa50 error 4 in liblzma.so.5.2.5[7f9b3f771000+1b000]

ProblemType: Crash
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
DistroRelease: Ubuntu 22.04
ExecutablePath: /usr/bin/xz
ExecutableTimestamp: 1649422298
InstallationDate: Installed on 2021-04-09 (863 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
Package: xz-utils 5.2.5-2ubuntu1
ProcCmdline: xz --check=crc32 --threads=0 -c /var/tmp/mkinitramfs-MAIN_E1GbD9
ProcCwd: /
ProcEnviron:
 LC_CTYPE=C.UTF-8
 TERM=linux
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
ProcVersionSignature: Ubuntu 5.19.0-38.39~22.04.1-generic 5.19.17
SegvAnalysis:
 Segfault happened at: 0x7f9b3f780c1a: movzbl (%rdi,%r8,1),%r10d
 PC (0x7f9b3f780c1a) ok
 source "(%rdi,%r8,1)" (0x7f9a93f3701a) in non-readable VMA region: 0x7f9a90021000-0x7f9a94000000 ---p None
 destination "%r10d" ok
 Stack memory exhausted (SP below stack segment)
SegvReason: reading VMA None
Signal: 11
SourcePackage: xz-utils
Uname: Linux 5.19.0-38-generic x86_64
UpgradeStatus: Upgraded to jammy on 2023-01-29 (204 days ago)
UserGroups: N/A
StacktraceTop:
 bt_find_func (len_limit=64, pos=9137198, cur=0x7f9a943edc3d "", cur_match=4194304, depth=24, son=son@entry=0x7f9a8afbd010, cyclic_pos=748589, cyclic_size=8388609, matches=0x7f9adc0ec324, len_best=11) at ../../../../src/liblzma/lz/lz_encoder_mf.c:483
 lzma_mf_bt4_find (mf=0x7f9a90000c70, matches=0x7f9adc0ec304) at ../../../../src/liblzma/lz/lz_encoder_mf.c:721
 lzma_mf_find (mf=mf@entry=0x7f9a90000c70, count_ptr=count_ptr@entry=0x7f9adc0ecb94, matches=matches@entry=0x7f9adc0ec304) at ../../../../src/liblzma/lz/lz_encoder_mf.c:28
 lzma_lzma_optimum_normal (position=<optimized out>, len_res=<synthetic pointer>, back_res=<synthetic pointer>, mf=<optimized out>, coder=<optimized out>) at ../../../../src/liblzma/lzma/lzma_encoder_optimum_normal.c:846
 lzma_lzma_optimum_normal (position=<optimized out>, len_res=<synthetic pointer>, back_res=<synthetic pointer>, mf=<optimized out>, coder=<optimized out>) at ../../../../src/liblzma/lzma/lzma_encoder_optimum_normal.c:804

Revision history for this message
Benjamin Drung (bdrung) wrote :

To analyze the crash we need the crashdump. Is there a crash report in /var/crash/ for xz?

Changed in initramfs-tools (Ubuntu):
status: New → Incomplete
affects: initramfs-tools (Ubuntu) → xz-utils (Ubuntu)
Revision history for this message
Mike (strayobject) wrote :

Full crash file for xz

Revision history for this message
Mike (strayobject) wrote :

I hope this contains what you need :)

Revision history for this message
Benjamin Drung (bdrung) wrote :

Attached is the retraced crash.

Changed in xz-utils (Ubuntu):
status: Incomplete → New
description: updated
Benjamin Drung (bdrung)
description: updated
summary: - xz segfault error in liblzma.so.5.2.5
+ xz crashed with SIGSEGV in lzma_lzma_optimum_normal
description: updated
Revision history for this message
Adrien Nader (adrien) wrote :

XZ developers have a couple questions regarding this after looking at the trace:
- is it reproducible? did it happen several times?
- does the machine use ECC memory?

Revision history for this message
Mike (strayobject) wrote :

Hello,

RAM: not ECC, 4x32GB @2133MHz, nothing fancy.

It has been happening regularly, often enough to drive me to set up an account here and report it, however it does happen any more. At some point it has stopped.

The pc in question is still using the same kernel and the same version of liblzma. I think that at some point after I reported the bug I have switched from wayland to x11, however I may be misremembering. It could also be an irrelevant change (not sure what the link would be), but I will try to verify and switch back to wayland this week and see if the error returns.

Revision history for this message
Mike (strayobject) wrote :

Hi,

correction to the above. The issue does NOT happen any more.

It has been happening regularly, often enough to drive me to set up an account here and report it, however it does **NOT** happen any more.

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

That sounds even more like a RAM issue (that it stopped occurring with the same kernel and software version).

Perhaps when you switched away from Wayland, your graphics card is now used less heavily, and when the GPU was used more, the RAM got hotter or got minimally less power and therefore had issues, or something. (This is something people have indeed seen, so…)

If you can trigger it reliably again, the changes would indeed be interesting.

Revision history for this message
Mike (strayobject) wrote :

Interesting thought.

After the switch to Wayland all has been well so far. I will update if this changes, but if the issue is indeed RAM and temps related, then there is another factor to consider, it is "winter" now, ambient temperature is between 19-21 degrees vs. 23-25 for the summer (when I reported the issue). I've installed psensor to monitor temps as well.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.