GtkWarning: called set_fraction() with percentage not between 0.0 to 1.0 (minor)

Bug #496368 reported by David Wagner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Low
Mathias Brodala

Bug Description

I got the following GtkWarning message (in ~/.xsession-errors) when starting up Exaile:

...
INFO : Playing file:///home/daw/more/music/taverner/music/fools_game/reality_divine/mass_psychosis.mp3
shm_open() failed: Permission denied
INFO : Attempting to submit "Now Playing" information to AudioScrobbler...
INFO : Submitted "Now Playing" successfully to AudioScrobbler
/usr/local/lib/exaile/xlgui/main.py:143: GtkWarning: gtk_progress_set_percentage: assertion `percentage >= 0 && percentage <= 1.0' failed
  self.bar.set_fraction(self.player.get_progress())
INFO : Playing file:///home/daw/more/music/taverner/music/fools_game/reality_divine/when_the_beginning_meets_the_end.mp3
...

Looking at line 143 of xlgui/main.py, I see this:

main.py:143: self.bar.set_fraction(self.player.get_progress())

The implementation of get_progress() in ExailePlayer (xl/player/_base.py) suggests that get_progress can return -1:

    def get_progress(self):
        try:
            progress = self.get_position()/float(
                    self.current.get_tag_raw("__length")*gst.SECOND)
        except ZeroDivisionError: # track doesnt have duration info
            progress = 0
        except AttributeError: # no current track
            progress = 0
        except AttributeError:
            progress = -1
        return progress

It sounds like passing a negative number to set_fraction() triggers an error. Perhaps this code should be re-factored a bit to avoid passing negative numbers to set_fraction(). Perhaps there should be a conditional to avoid calling set_fraction() if the argument would fall outside the range 0.0 .. 1.0, or something.

I'm using bzr r2726, on Fedora 11 (x86_64). Here are some RPM version numbers, in case they're relevant:

gtk2-2.16.6-2.fc11.x86_64
gtk+-1.2.10-68.fc11.x86_64
gtk2-devel-2.16.6-2.fc11.x86_64
pygtk2-2.14.1-2.fc11.x86_64

I'm not sure if I know how to reproduce this bug reliably. I'd classify it as lower priority, since it didn't seem to cause any loss of function that I noticed.

Revision history for this message
Mathias Brodala (mathbr) wrote :

Fixed in trunk with r2727 and in 0.3.0.x with r2472.

Changed in exaile:
assignee: nobody → Mathias Brodala (mathbr)
importance: Undecided → Low
milestone: none → 0.3.0.3
status: New → Fix Committed
reacocard (reacocard)
Changed in exaile:
milestone: 0.3.0.3 → 0.3.1
Revision history for this message
David Wagner (daw-bugzilla) wrote :

For what it's worth, I just saw this again in the latest bzr head (r2803), so I'm not sure if it's fixed all the way. I got the following in my ~/.xsession-errors:

INFO : Playing file:///home/daw/music/8_foot_sativa/season_for_assault/season_for_assault.mp3
INFO : Attempting to submit "Now Playing" information to AudioScrobbler...
INFO : Submitted "Now Playing" successfully to AudioScrobbler
/usr/local/lib/exaile/xlgui/main.py:146: GtkWarning: gtk_progress_set_percentage: assertion `percentage >= 0 && percentage <= 1.0' failed
  self.bar.set_fraction(self.player.get_progress())

I still haven't figured out how to reproduce it, and I only saw it once.

reacocard (reacocard)
Changed in exaile:
status: Fix Committed → Fix Released
Revision history for this message
Johannes Sasongko (sjohannes) wrote :

Feel free to reopen if anyone is still getting this in 0.3.1.

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.