Bug 15353

Summary: drakrpm-update crashed because of wrong syntax in skip list
Product: Mageia Reporter: Morgan Leijström <fri>
Component: RPM PackagesAssignee: Mageia tools maintainers <mageiatools>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: Low CC: anaselli, jyri2000, marja11, thierry.vignaud
Version: CauldronKeywords: PATCH
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: MGA5TOO
Source RPM: perl-URPM CVE:
Status comment:
Attachments: patch to avoid the crash that print a warning message

Description Morgan Leijström 2015-02-25 00:37:24 CET
The "drakrpm-update" program crashed. Drakbug-16.62 caught it.

I put wrong syntax in the skip list:

/*nvidia-current/

Preferrably it should not crash, but pop up a message about syntax...



Quantifier follows nothing in regex; marked by <-- HERE in m/(?:* <-- HERE nvidia-current)/ at /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/URPM/Resolve.pm line 1949.
Perl's trace:
drakbug::bug_handler() called from /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/URPM/Resolve.pm:1949
URPM::compute_flags() called from /usr/lib/perl5/vendor_perl/5.20.1/urpm/media.pm:846
urpm::media::_compute_flags_for_skiplist() called from /usr/lib/perl5/vendor_perl/5.20.1/urpm/media.pm:740
urpm::media::configure() called from /usr/lib/perl5/vendor_perl/5.20.1/Rpmdrake/open_db.pm:157
Rpmdrake::open_db::open_urpmi_db() called from /usr/lib/perl5/vendor_perl/5.20.1/Rpmdrake/pkg.pm:444
Rpmdrake::pkg::get_pkgs() called from /usr/lib/perl5/vendor_perl/5.20.1/Rpmdrake/gui.pm:642
Rpmdrake::gui::pkgs_provider() called from /usr/libexec/drakrpm-update:266
main::run_treeview_dialog() called from /usr/libexec/drakrpm-update:293

Theme name: oxygen-gtk
Kernel version = 3.19.0-desktop-2.mga5
Distribution=Mageia release 5 (Cauldron) for x86_64
CPU=Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
Thierry Vignaud 2015-02-25 09:41:35 CET

Priority: Normal => Low
CC: (none) => thierry.vignaud
Severity: normal => minor

Comment 1 Angelo Naselli 2015-02-25 11:08:33 CET
Created attachment 5945 [details]
patch to avoid the crash that print a warning message

A quick patch to avoid the problem.

dragoraUpdated is affected too, obviously.

CC: (none) => anaselli

Comment 2 Angelo Naselli 2015-02-25 11:12:30 CET
patch does skip any lines of skip-list if a regexp is wrong, but that is better than crashing imo
Comment 3 Morgan Leijström 2015-05-05 06:37:47 CEST
Maybe try that patch in cauldron after mga5 release

And update the bug to ask for popping up and/or log a message when syntax is wrong?
Thierry Vignaud 2015-05-05 06:42:16 CEST

Keywords: (none) => PATCH

Comment 4 Thierry Vignaud 2015-05-05 06:44:03 CEST
It would be better to use $urpm->{debug} instead of warn
Samuel Verschelde 2015-05-31 21:41:10 CEST

Whiteboard: (none) => MGA5TOO

Comment 5 Morgan Leijström 2016-06-06 22:54:46 CEST
for mga6 ?
Marja Van Waes 2016-10-15 23:43:12 CEST

CC: (none) => marja11
Assignee: bugsquad => mageiatools

Comment 6 Marja Van Waes 2016-10-15 23:43:21 CEST
*** Bug 19382 has been marked as a duplicate of this bug. ***

CC: (none) => jyri2000

Comment 7 Mageia Robot 2016-10-16 12:44:36 CEST
commit 070f1be3d5c3aa813f61d061c2a0fd38c2477c08
Author: Angelo Naselli <anaselli@...>
Date:   Sun Oct 16 12:43:49 2016 +0200

    mga#15353 don't crash if re is wrong
---
 Commit Link:
   http://gitweb.mageia.org/software/rpm/perl-URPM/commit/?id=070f1be3d5c3aa813f61d061c2a0fd38c2477c08
Comment 8 Angelo Naselli 2016-10-16 12:45:17 CEST
@thierry please review it I used debug but i could not be able to test it :(
Thierry Vignaud 2016-10-16 12:51:35 CEST

Source RPM: rpmdrake-6.15-1.mga5 => perl-URPM

Comment 9 Thierry Vignaud 2016-10-16 13:24:35 CEST
Looks good to me.
I'm considering just backporting future URPM-5.0.9 to mga5...
Comment 10 Mageia Robot 2016-10-16 13:57:50 CEST
commit a31506d8123747d15346f7808e8c14bce91bcd9b
Author: Angelo Naselli <anaselli@...>
Date:   Sun Oct 16 12:43:49 2016 +0200

    mga#15353 don't crash if re is wrong
---
 Commit Link:
   http://gitweb.mageia.org/software/rpm/perl-URPM/commit/?id=a31506d8123747d15346f7808e8c14bce91bcd9b
Comment 11 Thierry Vignaud 2016-10-16 14:05:14 CEST
Closing

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

Comment 12 Mageia Robot 2016-10-20 16:22:52 CEST
commit 49d5faf692708da20ce26dd4e0b7d6ab6da2b71f
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Thu Oct 20 16:20:01 2016 +0200

    fix crash introduced by mga#15353 fix (mga#19618)
    
    rationale:
    - {debug_URPM} only exists if we're in debug mode
    - as this is an actual error, let's just always report it
    
    bug introduced in commit 070f1be3d5c3aa813f61d061c2a0fd38c2477c08
---
 Commit Link:
   http://gitweb.mageia.org/software/rpm/perl-URPM/commit/?id=49d5faf692708da20ce26dd4e0b7d6ab6da2b71f

 Bug links:
   Mageia
      https://bugs.mageia.org/15353
      https://bugs.mageia.org/19618
Comment 13 Mageia Robot 2016-10-20 16:27:42 CEST
commit 9921c980dc294b6ce31450c2160a5247d4f04e6d
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Thu Oct 20 16:20:01 2016 +0200

    fix crash introduced by mga#15353 fix (mga#19618)
    
    rationale:
    - {debug_URPM} only exists if we're in debug mode
    - as this is an actual error, let's just always report it
    
    bug introduced in commit 070f1be3d5c3aa813f61d061c2a0fd38c2477c08
    
    (cherry picked from commit 49d5faf692708da20ce26dd4e0b7d6ab6da2b71f)
---
 Commit Link:
   http://gitweb.mageia.org/software/rpm/perl-URPM/commit/?id=9921c980dc294b6ce31450c2160a5247d4f04e6d

 Bug links:
   Mageia
      https://bugs.mageia.org/15353
      https://bugs.mageia.org/19618
Comment 14 Thierry Vignaud 2016-10-20 16:35:26 CEST
Grrr....
Comment 15 Angelo Naselli 2016-10-20 21:09:03 CEST
it happens :D