Bug 20956

Summary: MCC drakclock crash (Can't call method \"set_antialias\" on an undefined value at /usr/libexec/drakclock line 350.)
Product: Mageia Reporter: Patrick GUILLEMET <pguilt>
Component: RPM PackagesAssignee: Mageia tools maintainers <mageiatools>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: LpSolit, marja11, thierry.vignaud
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: drakxtools CVE:
Status comment:
Attachments: log.txt asked by Marja van Waes
MCC screen
try to workaround mga#20956

Description Patrick GUILLEMET 2017-05-27 23:21:16 CEST
Description of problem:
clic on date & time icone ..then crash

Version-Release number of selected component (if applicable):
Mageia6 RC

How reproducible:


Steps to Reproduce:
1.
2.
3.
Comment 1 Marja Van Waes 2017-05-29 20:41:46 CEST
Hi Patrick,

Do I correctly understand that you tried to click on "Manage date and time" in a screen similar to this one http://doc.mageia.org/mcc/5/en/content/mcc-system.html and then MCC crashed? 

Please reproduce the crash and open a terminal/konsole right after the crash, become root and give the command:

     journalctl -ab > log.txt


Then attach log.txt to this bug report.

Thanks!

Marja

Keywords: (none) => NEEDINFO
Source RPM: (none) => drakxtools
Assignee: bugsquad => mageiatools
Summary: MCC date and time => MCC date and time crash
CC: (none) => marja11

Comment 2 Patrick GUILLEMET 2017-05-29 22:14:32 CEST
Created attachment 9356 [details]
log.txt asked by Marja van Waes
Comment 3 Patrick GUILLEMET 2017-05-29 22:18:10 CEST
just launch MCC in root mode
clic on Manage date and time ... then it crashes
Comment 4 Patrick GUILLEMET 2017-05-29 22:24:26 CEST
Created attachment 9357 [details]
MCC screen
Comment 5 Marja Van Waes 2017-05-29 22:31:47 CEST
mai 29 22:06:49 localhost drakclock[2935]: ### Program is starting ###
mai 29 22:06:50 localhost drakclock[2935]: launched command: systemctl is-active chronyd.service >/dev/null
mai 29 22:06:51 localhost drakbug[2935]: ### Program is starting ###
mai 29 22:06:53 localhost dbus[745]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
mai 29 22:06:53 localhost plasmashell[2491]: Parsing "exist Exec and ('/usr/bin/perl /usr/bin/drakbug --error Can't call method \"set_antialias\" on an undefined value at /usr/libexec/drakclock line 350. Perl's trace: drakbug::bug_handler() called from /usr/lib/perl5/vendor_perl/5.22.3/Gtk3.pm:524 Gtk3::__ANON__() called from /usr/lib/libDrakX/mygtk3.pm:1550 mygtk3::main() called from /usr/lib/libDrakX/ugtk3.pm:857 ugtk3::main() called from /usr/libexec/drakclock:230 --incident drakclock' =~ Exec)" gave: syntax error
mai 29 22:06:53 localhost plasmashell[2491]: Parsing "exist Exec and ('perl /usr/bin/drakbug --error Can't call method \"set_antialias\" on an undefined value at /usr/libexec/drakclock line 350. Perl's trace: drakbug::bug_handler() called from /usr/lib/perl5/vendor_perl/5.22.3/Gtk3.pm:524 Gtk3::__ANON__() called from /usr/lib/libDrakX/mygtk3.pm:1550 mygtk3::main() called from /usr/lib/libDrakX/ugtk3.pm:857 ugtk3::main() called from /usr/libexec/drakclock:230 --incident drakclock' =~ Exec)" gave: syntax error


Patrick, did you see the drakbug screen (a screen like this one http://doc.mageia.org/mcc/5/en/content/drakbug.html )?

Summary: MCC date and time crash => MCC drakclock crash (Can't call method \"set_antialias\" on an undefined value at /usr/libexec/drakclock line 350.)
Keywords: NEEDINFO => (none)

Comment 6 Patrick GUILLEMET 2017-05-29 22:54:55 CEST
yes, this kind of screen appeared that's why i logged the bug
Comment 7 Frédéric "LpSolit" Buclin 2017-05-29 23:06:23 CEST
(In reply to Marja van Waes from comment #5)
> Can't call method \"set_antialias\"
> on an undefined value at /usr/libexec/drakclock line 350.

This means that the Cairo object is undefined when Repaint() is called, which makes little sense to me. I cannot reproduce the issue.

CC: (none) => LpSolit

Comment 8 Thierry Vignaud 2017-05-30 18:02:04 CEST
There's nothing magic:
You use a global variable ($cairo) that isn't initialized early enough, depending on gtk+ order of signals which can vary.

Ie if a call to Repaint() happens before a call to Draw(), then $cairo will be undefined.

Eg if any of the following happens before first draw() call:
- DrawingArea's 'motion_notify_event'
- any of the SpinButton event is fired
- $timer happens too early (120ms after startup),
  thus it will break if startup takes too much time

CC: (none) => thierry.vignaud

Comment 9 Thierry Vignaud 2017-05-30 18:02:17 CEST
Created attachment 9363 [details]
try to workaround mga#20956

You can try this patch.
To apply against /usr/libexec/drakconf on a live system
Comment 10 Thierry Vignaud 2017-05-30 18:05:37 CEST
It's indeed easily reproducable by reducing the 120ms timer
Comment 11 Mageia Robot 2017-05-30 18:16:40 CEST
commit d5d6d77e981dbe8a514d6b48ced4ed680bad0abf
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Tue May 30 18:10:03 2017 +0200

    fix crash introduced in 17.77 (mga#20956)
    
    Depending on machine speed/slowness, signals will not be fired in the
    order expected and Repaint() will be called before global variable
    $cairo is set by draw().
    
    This can be reproduced by making $timer to happens much faster than
    every 120ms so that it happens before the first call to draw()
    
    This workaround fix the bug introduced in commit 1a30f422b41250e338d2c1d209aec1b64204c8e0
    
    But it would probably be saner to get rid of the $cairo global variable
    and to create a Cairo context in every Repaint() caller instead...
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=d5d6d77e981dbe8a514d6b48ced4ed680bad0abf
Comment 12 Thierry Vignaud 2017-05-30 18:17:35 CEST
Fixed in git

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