Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liblzma compress/uncompress mismatch when built with llvm >=12 on FreeBSD powerpc64 (BE) #51056

Closed
adalava mannequin opened this issue Sep 2, 2021 · 9 comments
Closed
Labels
bugzilla Issues migrated from bugzilla regression

Comments

@adalava
Copy link
Mannequin

adalava mannequin commented Sep 2, 2021

Bugzilla Link 51714
Resolution FIXED
Resolved on Sep 08, 2021 20:49
Version unspecified
OS FreeBSD
Blocks #48661 #50580
CC @DimitryAndric,@efriedma-quic,@emaste,@LebedevRI,@preames,@sparker-arm,@tstellar
Fixed by commit(s) 34badc4 b77c810

Extended Description

On FreeBSD 13/powerpc64 (BE, ELFv2 ABI), a xz (liblzma.so) compiled with llvm12 or later isn't able to uncompress files produced by other machines or downloaded from the Internet (data corruption).
It can uncompress files compressed by itself (the same library binary), but other machines won't recognize the .xz as well (data corruption).

Bisect points to this commit[1] as source of regression. Reverting it makes liblzma.so work correctly again, but it's not clear to me how it's interefering.

FreeBSD 13/powerpc64le and amd64 are not affected.

How to reproduce:
1 - install FreeBSD 13/powerpc64
2 - install llvm12 or latest devel (pkg install llvm12 llvm-devel)
3 - take source from http://git.tukaani.org/xz.git and compile branch v5.0 using clang12 or later as CC
4 - download an .xz from the internet and try to uncompress it

[1] 42eaf4f

@sparker-arm
Copy link
Contributor

Thanks for raising this bug. I've asked Chen Zheng, of IBM, to take a look at it.

@llvmbot
Copy link
Member

llvmbot commented Sep 2, 2021

Thanks, Sam. Will work on this soon.

@adalava
Copy link
Mannequin Author

adalava mannequin commented Sep 2, 2021

reverts 42eaf4fe0adef3344adfd9fbccd49f325cb549ef on llvm12
just FYI, since code moved from the location it was when patch ws commited, that's how I reverted it in LLVM12

@adalava
Copy link
Mannequin Author

adalava mannequin commented Sep 2, 2021

Chen, Sam, on FreeBSD side I'm proposing temporarily revert[1] it in order to unbreak FreeBSD powerpc64.

Is it safe to revert it? I tested the full system on powerpc64 only. Is something else relying on this change?

[1] https://reviews.freebsd.org/D31804

@llvmbot
Copy link
Member

llvmbot commented Sep 3, 2021

That patch is not functionality right for some cases and is reverted in https://reviews.llvm.org/rG34badc409cc452575c538c4b6449546adc38f121

@adalava
Copy link
Mannequin Author

adalava mannequin commented Sep 3, 2021

That patch is not functionality right for some cases and is reverted in
https://reviews.llvm.org/rG34badc409cc452575c538c4b6449546adc38f121

Thanks, Chen!

Reverted on FreeBSD in-tree LLVM12 as well: https://reviews.freebsd.org/R10:f21fcae487026987f44154de981c03b69efbc945

@tstellar
Copy link
Collaborator

tstellar commented Sep 3, 2021

That patch is not functionality right for some cases and is reverted in
https://reviews.llvm.org/rG34badc409cc452575c538c4b6449546adc38f121

So we only to need to cherry-pick this one patch to the release/13.x branch?

@llvmbot
Copy link
Member

llvmbot commented Sep 6, 2021

That patch is not functionality right for some cases and is reverted in
https://reviews.llvm.org/rG34badc409cc452575c538c4b6449546adc38f121

So we only to need to cherry-pick this one patch to the release/13.x branch?

I think we need to cherry-pick the revert patch to release/12.x and release/13.x

@tstellar
Copy link
Collaborator

tstellar commented Sep 9, 2021

Merged: b77c810

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla regression
Projects
None yet
Development

No branches or pull requests

3 participants