Bug 894347

Summary: [abrt] glances-1.5.2-1.fc17: glances.py:1816:displayMem:UnboundLocalError: local variable 'y' referenced before assignment
Product: [Fedora] Fedora Reporter: Kamil Páral (Red Hat) <kparal>
Component: glancesAssignee: Edouard Bourguignon <madko>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: madko
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:3ddb7dd89757694ea8886c8733702bbbef6a7b8f
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-30 00:38:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: core_backtrace
none
File: environ
none
File: smolt_data none

Description Kamil Páral (Red Hat) 2013-01-11 14:13:32 UTC
Description of problem:
Just run glances.

Version-Release number of selected component:
glances-1.5.2-1.fc17

Additional info:
cmdline:        /usr/bin/python /usr/bin/glances
executable:     /usr/bin/glances
kernel:         3.6.11-1.fc17.x86_64
uid:            1000

Truncated backtrace:
glances.py:1816:displayMem:UnboundLocalError: local variable 'y' referenced before assignment

Traceback (most recent call last):
  File "/usr/bin/glances", line 9, in <module>
    load_entry_point('Glances==1.5.2', 'console_scripts', 'glances')()
  File "/usr/lib/python2.7/site-packages/glances/glances.py", line 3155, in main
    screen.update(stats)
  File "/usr/lib/python2.7/site-packages/glances/glances.py", line 1494, in update
    self.flush(stats, cs_status=cs_status)
  File "/usr/lib/python2.7/site-packages/glances/glances.py", line 1482, in flush
    self.display(stats, cs_status=cs_status)
  File "/usr/lib/python2.7/site-packages/glances/glances.py", line 1452, in display
    self.displayMem(stats.getMem(), stats.getMemSwap(), processlist, load_offset)
  File "/usr/lib/python2.7/site-packages/glances/glances.py", line 1816, in displayMem
    self.term_window.addnstr(self.mem_y + y,
UnboundLocalError: local variable 'y' referenced before assignment

Local variables in innermost frame:
screen_y: 53
memblocksize: 45
screen_x: 185
proclist: []
self: <glances.glances.glancesScreen instance at 0xe7e518>
extblocksize: 15
alert: 'OK'
memswap: {'total': 2147479552, 'percent': 0.0, 'free': 2147479552, 'used': 0}
offset_x: 0
mem: {'used': 1215021056L, 'cached': 2218110976, 'percent': 14.7, 'free': 7037345792L, 'total': 8252366848L, 'buffers': 130129920L}

Comment 1 Kamil Páral (Red Hat) 2013-01-11 14:13:37 UTC
Created attachment 676869 [details]
File: backtrace

Comment 2 Kamil Páral (Red Hat) 2013-01-11 14:13:41 UTC
Created attachment 676870 [details]
File: core_backtrace

Comment 3 Kamil Páral (Red Hat) 2013-01-11 14:13:43 UTC
Created attachment 676871 [details]
File: environ

Comment 4 Kamil Páral (Red Hat) 2013-01-11 14:13:45 UTC
Created attachment 676872 [details]
File: smolt_data

Comment 5 Edouard Bourguignon 2013-01-12 17:33:05 UTC
I can confirm this bug, add to install a Fedora 17 to reproduce it. Works in Fedora 18 but I don't know why.

Have been reported upstream => https://github.com/nicolargo/glances/issues/161

To fix that before I make a new package, add in /usr/lib/python2.7/site-packages/glances/glances.py this line:
        y = 0
after line 1739. You must then have:
    def displayMem(self, mem, memswap, proclist, offset_x=0):
        y = 0
        # Memory
(indentation is important in python)

Comment 6 Fedora Update System 2013-01-13 10:26:40 UTC
glances-1.5.2-2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/glances-1.5.2-2.fc16

Comment 7 Fedora Update System 2013-01-13 10:26:52 UTC
glances-1.5.2-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/glances-1.5.2-2.fc17

Comment 8 Fedora Update System 2013-01-14 04:03:10 UTC
Package glances-1.5.2-2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glances-1.5.2-2.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-0737/glances-1.5.2-2.fc16
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2013-01-30 00:38:27 UTC
glances-1.5.2-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2013-01-30 00:57:40 UTC
glances-1.5.2-2.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.