Bug 1393595

Summary: DNF 2.0rc1 segfaults when attempting to undo or redo a transaction
Product: [Fedora] Fedora Reporter: Neal Gompa <ngompa13>
Component: dnfAssignee: Michal Luscon <mluscon>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: high    
Version: rawhideCC: jsilhan, mluscon, ngompa13, packaging-team-maint, pnemade, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-07 03:50:47 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:
Attachments:
Description Flags
Backtrace of dnf history undo 81 none

Description Neal Gompa 2016-11-09 23:05:39 UTC
Description of problem:
Whenever attempting to undo or redo a specific transaction by ID number, DNF crashes with a segmentation fault. Listing transactions or getting info on a transaction does not cause a segfault.

Name-Version-Release of components (if applicable):
dnf-2.0.0-0.0.1.rc1.mga6 (= dnf-2.0.0-0.rc1.4.fc26)
libdnf-0.7.0-0.0.1.20161010.git.817d2a1.mga6
libdnf-0.7.0-0.0.2.20161108.git.f102fd3.mga6

How reproducible:
Always

Steps to Reproduce:
1. Install something with DNF
2. Get the transaction ID of the transaction with "dnf history list"
3. Use "dnf history undo <ID>" or "dnf history redo <ID>"

Actual results:
Crashes with "Segmentation fault"

Expected results:
Does the redo/undo operation with the transaction

Additional info:
This issue was discovered on Mageia Cauldron using the DNF 2.0 Copr for Cauldron[1]. The "last" keyword wasn't used because of bug 1393594.

[1]: https://copr.fedorainfracloud.org/coprs/ngompa/dnf2-mga/

Comment 1 Igor Gnatenko 2016-11-10 05:42:24 UTC
Please provide backtrace.

Comment 2 Neal Gompa 2016-11-10 12:33:05 UTC
Created attachment 1219368 [details]
Backtrace of dnf history undo 81

Backtrace generated from running: "sudo gdb -ex r --args python3 /usr/bin/dnf history undo 81 | tee dnfhistoryundo.txt"

Comment 3 Michal Luscon 2016-11-18 09:18:24 UTC
*** Bug 1393594 has been marked as a duplicate of this bug. ***

Comment 4 Michal Luscon 2016-11-18 11:06:33 UTC
Take a look at https://github.com/rpm-software-management/libhif/pull/213

Comment 5 Neal Gompa 2016-11-18 14:00:13 UTC
I locally applied the patch and attempted the test case again, and I was able to undo and redo transactions.

Comment 6 Neal Gompa 2016-12-07 03:50:47 UTC
Fixed in dnf 2.0 rc2.