Bug 19744

Summary: dnf2 segfaults when running "dnf history undo" to remove a package
Product: Mageia Reporter: Marja Van Waes <marja11>
Component: RPM PackagesAssignee: Neal Gompa <ngompa13>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: mageiatools
Version: CauldronKeywords: UPSTREAM
Target Milestone: ---   
Hardware: All   
OS: Linux   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=1393595
Whiteboard:
Source RPM: dnf-2.0.0-0.0.1.rc1.mga6 CVE:
Status comment:
Bug Depends on:    
Bug Blocks: 19564    
Attachments: terminal output of the command with and without --debuglevel=10
Backtrace of dnf history undo 81

Description Marja Van Waes 2016-11-09 16:05:01 CET
dnf-2.0.0-0.0.1.rc1.mga6 segfaults when running "dnf history undo" to remove a package

[root@localhost marja]# LANGUAGE=C dnf history undo 9
Last metadata expiration check: 0:13:17 ago on Wed Nov 09 15:44:50 2016 CET.
Undoing transaction 9, from Wed Nov 09 15:57:16 2016 CET
    Install ri-li-2.0.1-13.mga6.x86_64 @cauldron-x86_64
Segmentatiefout (geheugendump gemaakt)
[root@localhost marja]# 


This still happens with lib64dnf1-0.7.0-0.0.2.20161108.git.f102fd3.mga6.x86_64

It isn't caused by ri-li, it happens with a random other package, too:

[root@localhost marja]# LANGUAGE=C dnf history undo 10
Last metadata expiration check: 0:18:53 ago on Wed Nov 09 15:44:50 2016 CET.
Undoing transaction 10, from Wed Nov 09 16:03:23 2016 CET
    Install aajohan-comfortaa-fonts-2.004-4.mga6.noarch @cauldron-x86_64
Segmentatiefout (geheugendump gemaakt)
[root@localhost marja]# 

I'll try to reproduce in a different cauldron later.
Comment 1 Neal Gompa 2016-11-09 16:08:55 CET
Can you try the action with "--debuglevel=10" and attach the output to the report?
Comment 2 Marja Van Waes 2016-11-09 16:33:38 CET
Created attachment 8643 [details]
terminal output of the command with and without --debuglevel=10

Where should I have put "--debuglevel=10"?

I tried both:

LANGUAGE=C dnf history undo 13 --debuglevel=10 2>&1 | tee dnfhistoryundo.txt
and 
LANGUAGE=C dnf  --debuglevel=10 history undo 13 2>&1 | tee dnfhistoryundo.txt


but it doesn't get to the "undoing transaction 13" part. That line + the segfault only appear when running the command without "--debuglevel=10"

(See attachment for the outputs of the above 3 commands)
Comment 3 Neal Gompa 2016-11-09 16:34:38 CET
(In reply to Marja van Waes from comment #2)
> LANGUAGE=C dnf  --debuglevel=10 history undo 13 2>&1 | tee dnfhistoryundo.txt

This is the right form.
Comment 4 Neal Gompa 2016-11-09 23:29:15 CET
Reproduced with both redo and undo commands. list and info are unaffected.

[ngompa@mgacauldron-dnftst ~]$ sudo dnf history undo 81
Last metadata expiration check: 0:03:38 ago on Wed Nov 09 17:24:31 2016 EST.
Undoing transaction 81, from Wed Nov 09 17:25:14 2016 EST
    Install lib64SDL_mixer1.2_0-1.2.12-10.mga6.x86_64 @mageia-x86_64
    Install ri-li-2.0.1-13.mga6.x86_64                @mageia-x86_64
Segmentation fault
[ngompa@mgacauldron-dnftst ~]$ sudo dnf history redo 81
Last metadata expiration check: 0:03:42 ago on Wed Nov 09 17:24:31 2016 EST.
Repeating transaction 81, from Wed Nov 09 17:25:14 2016 EST
    Install lib64SDL_mixer1.2_0-1.2.12-10.mga6.x86_64 @mageia-x86_64
    Install ri-li-2.0.1-13.mga6.x86_64                @mageia-x86_64
Segmentation fault
[ngompa@mgacauldron-dnftst ~]$
Comment 5 Neal Gompa 2016-11-10 00:06:19 CET
Bug is filed upstream.

See Also: (none) => https://bugzilla.redhat.com/show_bug.cgi?id=1393595

Samuel Verschelde 2016-11-10 10:30:54 CET

Keywords: (none) => UPSTREAM

Comment 6 Neal Gompa 2016-11-10 13:31:40 CET
Created attachment 8644 [details]
Backtrace of dnf history undo 81

After installing all the debuginfo packages using "dnf debuginfo-install", I've got a backtrace on it, and I've attached to this report.

Backtrace was done with: "sudo gdb -ex r --args python3 /usr/bin/dnf history undo 81 | tee dnfhistoryundo.txt"
Comment 7 Neal Gompa 2016-11-18 15:04:16 CET
Fix pending merge: https://github.com/rpm-software-management/libhif/pull/213

I'll be releasing a fixed libdnf with the patch momentarily.

Status: NEW => ASSIGNED

Comment 8 Neal Gompa 2016-11-18 15:36:15 CET
I've released libdnf-0.7.0-0.0.3.20161116.git.248dc84.mga6. Please verify that the issue is fixed, and note accordingly.

Thanks!
Comment 9 Marja Van Waes 2016-11-18 15:44:59 CET
(In reply to Neal Gompa from comment #8)
> I've released libdnf-0.7.0-0.0.3.20161116.git.248dc84.mga6. Please verify
> that the issue is fixed, and note accordingly.
> 
> Thanks!

It is, both history undo and history redo work fine, now :-)

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED