wicd-curses crashes for an IndexError exception

Bug #1421918 reported by Vincenzo Maffione
72
This bug affects 14 people
Affects Status Importance Assigned to Milestone
wicd
New
Undecided
Unassigned
wicd (Arch Linux)
New
Undecided
Unassigned
wicd (Debian)
Fix Released
Unknown

Bug Description

Distribution: Arch
Package version: 1.7.3

I get this stack trace using wicd-curses in an environment with multiple wifi connection available:

ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 230, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/wicd/curses/wicd-curses.py", line 97, in wrapper
    return func(*args, **kargs)
  File "/usr/share/wicd/curses/wicd-curses.py", line 850, in update_netlist
    self.wiredCB.get_body().set_list(wiredL)
  File "/usr/share/wicd/curses/wicd-curses.py", line 469, in set_list
    wired.ReadWiredNetworkProfile(self.get_selected_profile())
  File "/usr/share/wicd/curses/wicd-curses.py", line 535, in get_selected_profile
    return self.theList[loc]
IndexError: list index out of range

This error is triggered at exit (i.e. when I press 'q'):

1) when I first run wicd-curses right after boot
2) If a when I first disable wifi (hardware switch), then I reenable it again and rerun wicd-curses

It seems the profiles list is not update correctly in some case, or there is some inconsistency with get_focus().

Revision history for this message
Vincenzo Maffione (v-maffione) wrote :
description: updated
description: updated
Revision history for this message
Matthew Rooney (joemonk) wrote :

This patch fixes the index out of bounds error by returning the last item in the list when variable loc is not a valid index.

Revision history for this message
Joe Rawson (joseph-rawson) wrote :

I hit this bug every time i use wicd-curses, regardless of connection state.

This seems like a trivial fix, can we get someone to merge this patch or look into the issue?

Revision history for this message
Alex Talker (alextalker) wrote :

Hello! My name is Alex and I'm maintainer few packages on AUR.

Since I've been looked for minimalistic way to management connection to wifi points, I am looked in direction of wicd.
Seems easy to use for me but because few bugs in curses inteface, I'd to collect few patches from different sources that solve them and put into a single package.

I'll apprechiate if you'll test it out https://aur.archlinux.org/packages/wicd-patched/ .

Also, thanks for the great tool, seems helpful to me.

And patches that developers made to fix users issues!!

Have a lucky day.

Revision history for this message
Isaac Wilder (imwilder511) wrote :

@alextalker

Working perfectly for me. Thanks for your work.

I can finally use wicd-curses again, instead of wicd-gtk. Yay!

Revision history for this message
Axel Beckert (xtaran) wrote :

@alextalker: I default to 0 instead of -1 as proposed in the patch posted at https://bugs.launchpad.net/wicd/+bug/1448685/comments/1

Reason is that your patch defaults to "Add new profile" which is confusing. Choosing the first item instead of the last one makes more sense to me.

Revision history for this message
Matthew Rooney (joemonk) wrote :

I can't really test this any time soon but for me it only seemed to be a selection highlighted. Perhaps the bug is different to what I first thought. If 0 works for you then what does it affect later in the code?

Changed in wicd (Debian):
status: Unknown → New
Changed in wicd (Debian):
status: New → Fix Released
Revision history for this message
Armin (syntaxdog) wrote :

Hi,

I was able to fix this on my machine by simply including a try/except handler in the get_selected_profile() function of the WiredComboBox() class, like so:
<code>
    def get_selected_profile(self):
        """Get the selected wired profile"""
        try:
            loc = self.get_focus()[1]
            return self.theList[loc]
        except:
            return ""
</code>

- Armin

Revision history for this message
Armin (syntaxdog) wrote :

Oh, forgot to add this: Line 535 in wicd-curses.py that was, on my machine.

- Armin

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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