Bug 2172771

Summary: [ppc64le] pandoc --version segfaults
Product: [Fedora] Fedora Reporter: Jens Petersen <petersen>
Component: ghcAssignee: Jens Petersen <petersen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: code, loganjerry, michel, ngompa13, petersen, quantum.analyst
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard:
Fixed In Version: ghc-9.4.5-142.fc39 ghc-9.4.5-142.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-07-24 12:11:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2177568    

Description Jens Petersen 2023-02-23 04:34:21 UTC
Description of problem:
pandoc --version segfaults on ppc64le

Version-Release number of selected component (if applicable):
pandoc-2.19.2-19.fc38

How reproducible:
100%

Steps to Reproduce:
1. run `pandoc -v` inside a build on ppc64le

Actual results:
+ pandoc -v
/var/tmp/rpm-tmp.C99aks: line 43:    31 Segmentation fault      (core dumped) pandoc -v

Expected results:
no error or segfault

Additional info:
This started with the recent move to ghc-9.2

I suspect this might actually be a ghc bug.

Comment 1 Jens Petersen 2023-02-23 04:52:40 UTC
I wanted to test on eln too, but that buildroot seems broken currently.

Comment 2 Jens Petersen 2023-02-23 06:45:11 UTC
Same thing with pandoc-2.19.2-20.fc39.ppc64le

Comment 3 Jens Petersen 2023-02-23 11:39:21 UTC
I built pandoc-2.19.2 with ghc9.4 in copr and then pandoc -v also segfaulted:
https://copr.fedorainfracloud.org/coprs/petersen/pandoc-test-ppc64le/build/5560008/

Comment 4 Jens Petersen 2023-02-23 13:33:02 UTC
No segfault when built with ghc9.0
https://copr.fedorainfracloud.org/coprs/petersen/pandoc-test-ppc64le/build/5560217/

Comment 5 Jens Petersen 2023-02-23 16:52:02 UTC
Reported to ghc upstream in https://gitlab.haskell.org/ghc/ghc/-/issues/23034

Comment 6 Elliott Sales de Andrade 2023-02-23 21:34:23 UTC
The backtrace is not great, but looks like:
(gdb) bt
#0  0x0000000017e436e8 in lua_type ()
#1  0x0000000017e3b428 in ghczuwrapperZC1ZCluazm2zi2zi1zmKRmEomuYCwNASKOuLK7fDIZCLuaziPrimaryZCluazutype ()
#2  0x0000000017df7ca8 in hsluazmmarshallingzm2zi2zi1zmCyWh4OZZgxoeJYv9YK7F33ZZ_HsLuaziMarshallingziPeekers_zdwtoByteString_entry ()
#3  0x000000001bf29710 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Maybe something to do with FFI.

Comment 7 Jens Petersen 2023-02-27 09:59:07 UTC
Thanks, indeed it seems to be crashing the hslua version code of the --version output function.

Apparently it affects all minor versions of ghc-9.2 (and 9.4 I suppose).

Comment 8 Jens Petersen 2023-02-27 10:00:34 UTC
(Also as mentioned in the upstream ticket epel9 ghc9.2 is also affected.)

Comment 9 Fedora Update System 2023-03-13 15:44:10 UTC
FEDORA-2023-4295d28b2a has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-4295d28b2a

Comment 10 Fedora Update System 2023-03-13 15:46:48 UTC
FEDORA-2023-4295d28b2a has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Jens Petersen 2023-03-13 16:36:18 UTC
I intend to leave this open until a fix is available for ghc.

(I accidentally quoted this bug instead of the pandoc one in the workaround changelog.)

Comment 12 Jens Petersen 2023-09-28 14:13:11 UTC
Happened again in F40 Rawhide today (ghc-9.4.5 and hslua-marshalling-2.3.0)

Comment 13 Jens Petersen 2023-09-29 06:45:29 UTC
Actually looks more serious now with pandoc 3:
in particular hslua-cli seems to crash even if I disable
the version output (well in itself not surprising)
but then now there is no workaround...

At this rate I might have to push pandoc lua broken for ppc64le.

Comment 14 Jens Petersen 2023-09-29 07:09:48 UTC
Instead I am trying the more obvious thing: disabling LUA on ppc64le

Comment 15 Jens Petersen 2024-02-28 05:32:14 UTC
Still happens as of pandoc-3.1.3-28.fc41 and pandoc-cli-0.1.1.1-28.fc41
built with ghc-9.4.5-140.fc41

Comment 16 Jens Petersen 2024-06-16 06:56:06 UTC
There is now a upstream MR with a fix by Peter Trommler, which I will backport to Fedora ghc packages.

Comment 17 Fedora Update System 2024-07-15 07:48:34 UTC
FEDORA-2024-0efdd2ff63 (ghc-9.4.5-142.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-0efdd2ff63

Comment 18 Fedora Update System 2024-07-15 15:43:08 UTC
FEDORA-2024-8a3d1ca685 (ghc-9.4.5-142.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-8a3d1ca685

Comment 19 Jens Petersen 2024-07-15 15:54:20 UTC
This is now fixed in various ghc packages, but note the pandoc (actually hslua) stack
still needs to be recompiled to fix the issue (or rather be able to re-enable LUA) there.

Comment 20 Fedora Update System 2024-07-16 01:25:34 UTC
FEDORA-2024-0efdd2ff63 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-0efdd2ff63`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-0efdd2ff63

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 21 Fedora Update System 2024-07-16 02:10:42 UTC
FEDORA-2024-8a3d1ca685 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-8a3d1ca685`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-8a3d1ca685

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 22 Fedora Update System 2024-07-24 12:11:29 UTC
FEDORA-2024-8a3d1ca685 (ghc-9.4.5-142.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 23 Fedora Update System 2024-07-24 15:45:57 UTC
FEDORA-2024-0efdd2ff63 (ghc-9.4.5-142.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.