BAckintime crash when screen locked

Bug #441628 reported by cliff6056
82
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Back In Time
Fix Released
High
Unassigned

Bug Description

Using up to date Sidux. Seems to occur when unattended and screen has locked, Functions normal when computer in use. Thanks.

Application: Back In Time (backintime.py), signal: Segmentation fault
[KCrash Handler]
#5 0x00007f201fdc2404 in QWidget::metric(QPaintDevice::PaintDeviceMetric) const () from /usr/lib/libQtGui.so.4
#6 0x00007f201ff0ea4a in QFont::QFont(QFont const&, QPaintDevice*) () from /usr/lib/libQtGui.so.4
#7 0x00007f201fd84654 in QWidgetPrivate::updateFont(QFont const&) () from /usr/lib/libQtGui.so.4
#8 0x00007f201fd8458c in QWidgetPrivate::resolveFont() () from /usr/lib/libQtGui.so.4
#9 0x00007f201fd8f3ea in QWidget::setParent(QWidget*, QFlags<Qt::WindowType>) () from /usr/lib/libQtGui.so.4
#10 0x00007f201fd8f712 in QWidget::setParent(QWidget*) () from /usr/lib/libQtGui.so.4
#11 0x00007f201fd94dc6 in QWidgetAction::releaseWidget(QWidget*) () from /usr/lib/libQtGui.so.4
#12 0x00007f2020132c9f in QMenu::~QMenu() () from /usr/lib/libQtGui.so.4
#13 0x00007f201cb750bb in KMenu::~KMenu() () from /usr/lib/libkdeui.so.5
#14 0x00007f201cb22e0e in KSystemTrayIcon::~KSystemTrayIcon() () from /usr/lib/libkdeui.so.5
#15 0x00007f201d2730ee in sipKSystemTrayIcon::~sipKSystemTrayIcon() () from /usr/lib/pymodules/python2.5/PyKDE4/kdeui.so
#16 0x00007f201d25223d in ?? () from /usr/lib/pymodules/python2.5/PyKDE4/kdeui.so
#17 0x00007f2022addf79 in ?? () from /usr/lib/pymodules/python2.5/sip.so
#18 0x000000000045e0d5 in ?? ()
#19 0x0000000000445b33 in ?? ()
#20 0x000000000045e15c in ?? ()
#21 0x0000000000445b33 in ?? ()
#22 0x000000000042249c in ?? ()
#23 0x00000000004387c2 in ?? ()
#24 0x0000000000445b33 in ?? ()
#25 0x000000000042249c in ?? ()
#26 0x00000000004458cb in PyDict_Clear ()
#27 0x0000000000445909 in ?? ()
#28 0x00000000004ba3de in ?? ()
#29 0x00000000004baab4 in PyGC_Collect ()
#30 0x00000000004aeed1 in Py_Finalize ()
#31 0x00000000004ae94e in ?? ()
#32 0x00000000004aeb4d in PyErr_PrintEx ()
#33 0x00000000004af85b in PyRun_SimpleFileExFlags ()
#34 0x0000000000414572 in Py_Main ()
#35 0x00007f202619e5c6 in __libc_start_main () from /lib/libc.so.6
#36 0x00000000004139d9 in _start ()

Revision history for this message
cliff6056 (cliff6056) wrote :
Download full text (4.2 KiB)

Now, I have no idea if the following applies, but the explanation seems to fit: that when the display is active, backintime-kde works fine, however, when the display is not, it fails with no backup, and the systray icon remains frozen in place. Also, when the systray icon is frozen, a mouseover message as follows: "Compare with snapshot 2009-10-05 19:00 :01 (rsync:>F++++++++++++++++++ etx/X11/Xwrapper.config)".

My skill level is such that I have no idea if the above or below information is useful in detecting the Segmentation Fault problem originally posted or if it is related, however, hope it of assistance if anyone else has this problem. Should also point out that if I install backintime-gnome on the kde system, no systray icon ever appears, and subsequently, backintime does not experience any issues, and is the solution I use at this time.

The following is quoted from the le-web.org site: http://www.le-web.org/2008/11/06/pygtk-how-to-display-a-systray-icon-from-a-cronjob/.

PyGTK: How to display a systray icon from a cronjob

It is nice to give some user feedback when someting happen in a background application. For example when a cronjob is running it would be nice to show a systray icon.

When the cron-job runs the DISPLAY environment variable is not defined so your gtk application can’t access to xserver. So before importing pygtk you should check if DISPLAY is defined. If not just define it to default value “:0.0″.

import os

#if DISPLAY is not set, then set it to default ':0.0'
if len( os.getenv( 'DISPLAY', '' ) ) == 0:
 os.putenv( 'DISPLAY', ':0.0' )

import pygtk
pygtk.require("2.0")

But what happens if your gtk application really can’t connect to the xserver (xserver is not runnig, you are not logged in …). In this case your application should not try to use xserver related functions. For example when I try to use gtk.StatusIcon the application ends with a segmentation fault.

To check if your application can access to xserver just get the default display. If it is None then you can’t access it.

display = gtk.gdk.display_get_default()
if not display is None:
 ...

Now, putting all together I made this simple application: notify.py.

import os

#if DISPLAY is not set, then set it to default ':0.0'
if len( os.getenv( 'DISPLAY', '' ) ) == 0:
 os.putenv( 'DISPLAY', ':0.0' )

import pygtk
pygtk.require("2.0")
import gtk
import threading
import time

#GTK main loop thread
class GTKMainThread(threading.Thread):
 def run(self):
  gtk.main()

#get default display. None means it can't connect to xserver
display = gtk.gdk.display_get_default()
statusIcon = None

#if the display is not None show status icon
if not display is None:
 #start a gtk loop in another thread
 gtk.gdk.threads_init()
 GTKMainThread().start()

 try:
  statusIcon = gtk.StatusIcon()
  statusIcon.set_from_stock( gtk.STOCK_INFO )
  statusIcon.set_visible( True )
  statusIcon.set_tooltip(_("Back In Time: take snapshot ..."))
 except:
  pass

#do something here
print "Begin"
time.sleep( 5 ) #wait 5 seconds
print "End"

#hide status icon
if not statusIcon is None:
 statusIcon.set_visible( False )

#quit GTK main look
if not display is None:
 gtk.main...

Read more...

Revision history for this message
Bart de Koning (bratdaking) wrote : Re: [Bug 441628] Re: BAckintime crash when screen locked
Download full text (5.2 KiB)

Are more people experiencing this bug?

Notify.py is implemented for the GTK (GNOME version) of backintime indeed,
however I guess the KDE version fails to detect if the xserver is running or
not and whether there is a display, (KDE does not use GTK). What might be
the solution is to implement the notify solutions also in the KDE version,
however I am not an expert on KDE and have not really a clue how to do
that...

Cheers,
Bart

2009/10/6 cliff6056 <email address hidden>

> Now, I have no idea if the following applies, but the explanation seems
> to fit: that when the display is active, backintime-kde works fine,
> however, when the display is not, it fails with no backup, and the
> systray icon remains frozen in place. Also, when the systray icon is
> frozen, a mouseover message as follows: "Compare with snapshot
> 2009-10-05 19:00 :01 (rsync:>F++++++++++++++++++
> etx/X11/Xwrapper.config)".
>
> My skill level is such that I have no idea if the above or below
> information is useful in detecting the Segmentation Fault problem
> originally posted or if it is related, however, hope it of assistance if
> anyone else has this problem. Should also point out that if I install
> backintime-gnome on the kde system, no systray icon ever appears, and
> subsequently, backintime does not experience any issues, and is the
> solution I use at this time.
>
> The following is quoted from the le-web.org site: http://www.le-
> web.org/2008/11/06/pygtk-how-to-display-a-systray-icon-from-a-cronjob/.
>
>
> PyGTK: How to display a systray icon from a cronjob
>
> It is nice to give some user feedback when someting happen in a
> background application. For example when a cronjob is running it would
> be nice to show a systray icon.
>
>
> When the cron-job runs the DISPLAY environment variable is not defined so
> your gtk application can’t access to xserver. So before importing pygtk you
> should check if DISPLAY is defined. If not just define it to default value
> “:0.0″.
>
> import os
>
> #if DISPLAY is not set, then set it to default ':0.0'
> if len( os.getenv( 'DISPLAY', '' ) ) == 0:
> os.putenv( 'DISPLAY', ':0.0' )
>
> import pygtk
> pygtk.require("2.0")
>
> But what happens if your gtk application really can’t connect to the
> xserver (xserver is not runnig, you are not logged in …). In this case
> your application should not try to use xserver related functions. For
> example when I try to use gtk.StatusIcon the application ends with a
> segmentation fault.
>
> To check if your application can access to xserver just get the default
> display. If it is None then you can’t access it.
>
> display = gtk.gdk.display_get_default()
> if not display is None:
> ...
>
>
> Now, putting all together I made this simple application: notify.py.
>
> import os
>
> #if DISPLAY is not set, then set it to default ':0.0'
> if len( os.getenv( 'DISPLAY', '' ) ) == 0:
> os.putenv( 'DISPLAY', ':0.0' )
>
> import pygtk
> pygtk.require("2.0")
> import gtk
> import threading
> import time
>
> #GTK main loop thread
> class GTKMainThread(threading.Thread):
> def run(self):
> gtk.main()
>
> #get default display. None means it can't connect...

Read more...

Changed in backintime:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Bart de Koning (bratdaking) wrote :

Hello everybody,

Cliff6065 suggested that an old bug was actually quite similar to a bug he experienced, and more recently Sergiom99. That is why I linked all those old bug reports to this one, in the hope we can solve it quite soon. My question is: are you all still encountering this Tray Icon bug also in the newest release 0.9.26?

Cheers,
Bart

Revision history for this message
cliff6056 (cliff6056) wrote :

Yes in KDE4.3.2.

Bart de Koning wrote:
> Hello everybody,
>
> Cliff6065 suggested that an old bug was actually quite similar to a bug
> he experienced, and more recently Sergiom99. That is why I linked all
> those old bug reports to this one, in the hope we can solve it quite
> soon. My question is: are you all still encountering this Tray Icon bug
> also in the newest release 0.9.26?
>
> Cheers,
> Bart
>
>

Dan (danleweb)
Changed in backintime:
status: Triaged → Fix Committed
Revision history for this message
Bart de Koning (bratdaking) wrote : Re: [Bit-team] [Bug 441628] Re: BAckintime crash when screen locked

Hey Dan,

What was the main problem, and how did you solve this?

Cheers,
Bart

2009/12/2 Dan <email address hidden>

> ** Changed in: backintime
> Status: Triaged => Fix Committed
>
> --
> BAckintime crash when screen locked
> https://bugs.launchpad.net/bugs/441628
> You received this bug notification because you are a member of Back In
> Time Team, which is subscribed to Back In Time.
>
> Status in Back In Time: Fix Committed
>
> Bug description:
> Using up to date Sidux. Seems to occur when unattended and screen has
> locked, Functions normal when computer in use. Thanks.
>
> Application: Back In Time (backintime.py), signal: Segmentation fault
> [KCrash Handler]
> #5 0x00007f201fdc2404 in QWidget::metric(QPaintDevice::PaintDeviceMetric)
> const () from /usr/lib/libQtGui.so.4
> #6 0x00007f201ff0ea4a in QFont::QFont(QFont const&, QPaintDevice*) () from
> /usr/lib/libQtGui.so.4
> #7 0x00007f201fd84654 in QWidgetPrivate::updateFont(QFont const&) () from
> /usr/lib/libQtGui.so.4
> #8 0x00007f201fd8458c in QWidgetPrivate::resolveFont() () from
> /usr/lib/libQtGui.so.4
> #9 0x00007f201fd8f3ea in QWidget::setParent(QWidget*,
> QFlags<Qt::WindowType>) () from /usr/lib/libQtGui.so.4
> #10 0x00007f201fd8f712 in QWidget::setParent(QWidget*) () from
> /usr/lib/libQtGui.so.4
> #11 0x00007f201fd94dc6 in QWidgetAction::releaseWidget(QWidget*) () from
> /usr/lib/libQtGui.so.4
> #12 0x00007f2020132c9f in QMenu::~QMenu() () from /usr/lib/libQtGui.so.4
> #13 0x00007f201cb750bb in KMenu::~KMenu() () from /usr/lib/libkdeui.so.5
> #14 0x00007f201cb22e0e in KSystemTrayIcon::~KSystemTrayIcon() () from
> /usr/lib/libkdeui.so.5
> #15 0x00007f201d2730ee in sipKSystemTrayIcon::~sipKSystemTrayIcon() () from
> /usr/lib/pymodules/python2.5/PyKDE4/kdeui.so
> #16 0x00007f201d25223d in ?? () from
> /usr/lib/pymodules/python2.5/PyKDE4/kdeui.so
> #17 0x00007f2022addf79 in ?? () from /usr/lib/pymodules/python2.5/sip.so
> #18 0x000000000045e0d5 in ?? ()
> #19 0x0000000000445b33 in ?? ()
> #20 0x000000000045e15c in ?? ()
> #21 0x0000000000445b33 in ?? ()
> #22 0x000000000042249c in ?? ()
> #23 0x00000000004387c2 in ?? ()
> #24 0x0000000000445b33 in ?? ()
> #25 0x000000000042249c in ?? ()
> #26 0x00000000004458cb in PyDict_Clear ()
> #27 0x0000000000445909 in ?? ()
> #28 0x00000000004ba3de in ?? ()
> #29 0x00000000004baab4 in PyGC_Collect ()
> #30 0x00000000004aeed1 in Py_Finalize ()
> #31 0x00000000004ae94e in ?? ()
> #32 0x00000000004aeb4d in PyErr_PrintEx ()
> #33 0x00000000004af85b in PyRun_SimpleFileExFlags ()
> #34 0x0000000000414572 in Py_Main ()
> #35 0x00007f202619e5c6 in __libc_start_main () from /lib/libc.so.6
> #36 0x00000000004139d9 in _start ()
>
> _______________________________________________
> Mailing list: https://launchpad.net/~bit-team<https://launchpad.net/%7Ebit-team>
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~bit-team<https://launchpad.net/%7Ebit-team>
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Dan (danleweb) wrote :

Hi Bard,

The crash happens in KDE4 plugin (KSystemTrayIcon).
Qt/KDE like to have the message loop in the main thread. As a GUI plugin I tried to put it into another thread.
Gnome plugin behave OK but the KDE4 crashes (not always).
I changed the KDE4 plugin to start another process for displaying the icon.

Regards,
Dan

cliff6056 (cliff6056)
Changed in backintime:
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
Jan Schnackenberg (yehaa) wrote :

I installed the "testing" version yesterday. Today I find the following status:

- Backup ran successfully (I guess)
- The icon is still in the system area, tooltip says "Finalizing"
- The only backintime process still running is
  /usr/bin/python /usr/share/backintime/kde4/kde4systrayicon.py 1
- Backup started today 15:15:02 (booted the computer) with syslog-lines
Dec 20 15:15:02 UltraSnake backintime (jan): INFO: Lock
Dec 20 15:15:02 UltraSnake backintime (jan): INFO: on process begins
Dec 20 15:15:02 UltraSnake backintime (jan): INFO: Profile_id: 1
Dec 20 15:15:02 UltraSnake backintime (jan): INFO: Compare with old snapshot: 20091219-162237
- Last entries in syslog are:
Dec 20 15:57:35 UltraSnake backintime (jan): INFO: [smart remove] keep snapshots: ['20091220-151502-436', '20091219-162237', '20091212-082153', '20091206-000001', '20090419-194140', '20090630-000003', '20090731-000002', '20090831-000001', '20090911-105013', '20091030-064718', '20091128-000001']
Dec 20 15:57:35 UltraSnake backintime (jan): INFO: Keep min free disk space: 1024 Mb
- Starting BackInTime shows state "Fertig" (German for "ready" or "finished") in statusbar and the list of backups shows a backup with timestamp 15:15:02
- quitting BackInTime again leaves the system area icon running

For me this bug seems to not be completely fixed. The backup is finished, though. So the bug is not as severe as it was.

Or do you think this is a new bug?

Revision history for this message
Kap4Lin (kap4lin) wrote :
Download full text (6.0 KiB)

I was told (some time back) to post my log to this bug. My actual post is here:
https://answers.launchpad.net/backintime/+question/91217

I tried to setup an hourly cron job with the "Smart Remove" option checked. This hourly job was setup around 6.20 pm on 20 Dec. So, the immediate next job at 7 pm ran making relevant backups. The log looks like this:

+++++++++++++++++++++++++++++++++++++++++++++++++
Dec 20 19:00:01 nebu backintime (apoc): INFO: Lock
Dec 20 19:00:01 nebu backintime (apoc): INFO: Include folders: ['/home/apoc/.config', '/home/apoc/.emacs.d'... long list...]
Dec 20 19:00:01 nebu backintime (apoc): INFO: Ignore folders: []
Dec 20 19:00:01 nebu backintime (apoc): INFO: Last snapshots: {}
Dec 20 19:00:01 nebu backintime (apoc): INFO: [KDE4Plugin.Systray.run]
Dec 20 19:00:02 nebu backintime (apoc): INFO: Compare with old snapshot: 20091220-171809
Dec 20 19:00:02 nebu backintime (apoc): INFO: [KDE4Plugin.Systray.run] begin loop
Dec 20 19:00:09 nebu backintime (apoc): INFO: Command "rsync -aEAX -i --dry-run --chmod=Fa-w,D+w --whole-file --delete --exclude="/media/wd500g1/Home" --exclude="/home/apoc/.local .... long list ....
Dec 20 19:00:09 nebu backintime (apoc): INFO: Create hard-links
Dec 20 19:00:13 nebu backintime (apoc): INFO: Command "cp -al "/media/wd500g1/Home/backintime/20091220-171809/backup/"* "/media/wd500g1/Home/backintime/new_snapshot/backup/"" returns
Dec 20 19:00:13 nebu backintime (apoc): INFO: Call rsync to take the snapshot
Dec 20 19:00:20 nebu backintime (apoc): INFO: Command "rsync -aEAX -v --delete-excluded --chmod=Fa-w,D+w --whole-file --delete --exclude="/media/wd500g1/Home" --exclude="/home/apo
Dec 20 19:00:20 nebu backintime (apoc): INFO: Save permissions
Dec 20 19:00:37 nebu backintime (apoc): INFO: Remove backups older than: 19991220-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep all >= 20091219-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20091207-000000 and < 20091214-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20091130-000000 and < 20091207-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090101-000000 and < 20090201-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090201-000000 and < 20090301-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090301-000000 and < 20090401-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090401-000000 and < 20090501-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090501-000000 and < 20090601-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090601-000000 and < 20090701-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090701-000000 and < 20090801-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090801-000000 and < 20090901-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smart remove] keep first >= 20090901-000000 and < 20091001-000000
Dec 20 19:00:37 nebu backintime (apoc): INFO: [smar...

Read more...

Revision history for this message
Dan (danleweb) wrote :

There was a merge problem. Please try beta6 version (testing repository).

Revision history for this message
Jan Schnackenberg (yehaa) wrote :

I, for myself, seem to not suffer from this bug anymore. Thank you.

Revision history for this message
cliff6056 (cliff6056) wrote :

Hi Dan. I am using 0.9.99beta6 and the backup file itself seems to be working fine. However, I am just testing on a small file at 5 minute intervals, having done 5 backups, the first manual, the remaining automatically by scheduler. I now have five icons of backintime running in the tray, a mouseover says "Finalizing" on all. Hmm, make that six icons now.

Thanks for you assistance.

Cliff

Revision history for this message
Martin Fisher (yusuf-martin) wrote :

Same here, also with beta6.

Martin

Revision history for this message
Cyberdude (gabor-sunseaker) wrote :

I filed a bug (bug 506876) that turned out to be a duplicate of this so I've been directed here.

@Jan Schnackenberg, can you say what you did that resolved the problem for you?

I use openSUSE 11.2 and see that there is no packaged 0.9.99beta6 for me so I'll try build it from source. I cannot find the beta 6 source. All I can find are the sources that refer to revision 666. It this what I should use?

Revision history for this message
Dan (danleweb) wrote :

There only Ubuntu package available for version 0.9.99beta.
You need to get sources from bzr: "bzr checkout lp:backintime"

Revision history for this message
Jan Schnackenberg (yehaa) wrote :

As I use Kubuntu, all I did was use the provided beta-package.

Dan (danleweb)
Changed in backintime:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.