Discussion:
[BitPim-devel] Exception: OverflowError in comm_notify.py on startup
David Lonie
2008-07-13 19:23:43 UTC
Permalink
version: trunk
platform: amd64 gentoo 2.6.25

This was working fine for me yesterday. Today I start bitpim up and get the
error below. I tried checking out a fresh copy of trunk and clearing out
~/.bitpim*. Any ideas what could have changed/what I need to do?


BitPim version: trunk-bitpim-developer build
An unexpected exception has occurred.
Please see the help for details on what to do.

Traceback (most recent call last):
File "/usr/src/bitpim/src/gui.py", line 248, in OnClose
self.goforit()
File "/usr/src/bitpim/src/gui.py", line 245, in goforit
self.app.makemainwindow()
File "/usr/src/bitpim/src/gui.py", line 548, in makemainwindow
self.frame=MainWindow(None, -1, title, self.config)
File "/usr/src/bitpim/src/gui.py", line 963, in __init__
comm_notify.start_server(self)
File "/usr/src/bitpim/src/comm_notify.py", line 110, in start_server
return run_server(mainwindow)
File "/usr/src/bitpim/src/comm_notify.py", line 104, in run_server
fcntl.DN_MODIFY|fcntl.DN_CREATE|fcntl.DN_MULTISHOT)
OverflowError: signed integer is greater than maximum

Variables by last 8 frames, innermost last

Frame OnClose in /usr/src/bitpim/src/gui.py at line 248
self = <gui.MySplashScreen; proxy of <Swig Object of type
'wxSplashScreen *' at 0x173d2
evt = <wx._core.CloseEvent; proxy of <Swig Object of type
'wxCloseEvent *' at 0x7fff01

Frame goforit in /usr/src/bitpim/src/gui.py at line 245
self = <gui.MySplashScreen; proxy of <Swig Object of type
'wxSplashScreen *' at 0x173d2

Frame makemainwindow in /usr/src/bitpim/src/gui.py at line 548
self = <gui.MainApp; proxy of <Swig Object of type 'wxPyApp *'
at 0xfaaf30> >
name = None
title = 'BitPim'

Frame __init__ in /usr/src/bitpim/src/gui.py at line 963
help = 'Export Media Files to a Zip file'
pos = 200
expmenu = <wx._core.Menu; proxy of <Swig Object of type 'wxMenu *'
at 0x1796690> >
ib = <wx._gdi.IconBundle; proxy of <Swig Object of type
'wxIconBundle *' at 0x176ee00
id = -1
x = 184
title = 'BitPim'
menu = <wx._core.Menu; proxy of <Swig Object of type 'wxMenu *'
at 0x17ae500> >
self = <gui.MainWindow; proxy of <Swig Object of type 'wxFrame
*' at 0x1754910> >
_desc = 'Execute'
_help = 'Perform Auto Calendar Import'
config = <bp_config.Config instance at 0x7f8aebb99e18>
_func = None
impmenu = <wx._core.Menu; proxy of <Swig Object of type 'wxMenu *'
at 0x178ac20> >
parent = None
func = <function OnFileExportMediaZip at 0x1515758>
desc = 'Media to Zip File...'
sz = wx.Size(32, 32)
_submenu = <wx._core.Menu; proxy of <Swig Object of type 'wxMenu *'
at 0x178d720> >
sb = <guiwidgets.MyStatusBar; proxy of <Swig Object of type
'wxStatusBar *' at 0x1757
_id = 179
menuBar = <wx._core.MenuBar; proxy of <Swig Object of type
'wxMenuBar *' at 0x1782bd0> >

Frame start_server in /usr/src/bitpim/src/comm_notify.py at line 110
mainwindow = <gui.MainWindow; proxy of <Swig Object of type 'wxFrame
*' at 0x1754910> >

Frame run_server in /usr/src/bitpim/src/comm_notify.py at line 104
mainwindow = <gui.MainWindow; proxy of <Swig Object of type 'wxFrame
*' at 0x1754910> >
David Lonie
2008-07-13 20:20:35 UTC
Permalink
Commenting out lines 103 and 104 in comm_notify.py allows bitpim to be
usable again, but I'm not sure of the implications of doing this.
Post by David Lonie
version: trunk
platform: amd64 gentoo 2.6.25
This was working fine for me yesterday. Today I start bitpim up and get the
error below. I tried checking out a fresh copy of trunk and clearing out
~/.bitpim*. Any ideas what could have changed/what I need to do?
Aaron M. Ucko
2008-07-14 17:46:49 UTC
Permalink
I'm not sure why you didn't encounter the error earlier (perhaps the
file to monitor wasn't yet present?), but I'd suggest the following
patch:

--- bitpim-1.0.5.dfsg.1.orig/src/comm_notify.py
+++ bitpim-1.0.5.dfsg.1/src/comm_notify.py
@@ -14,6 +14,7 @@
import signal
import sys

+import ctypes
import wx

bpCOMM_NOTIFICATION_EVENT = wx.NewEventType()
@@ -98,8 +99,10 @@
if __debug__:
raise
return False
- fcntl.fcntl(_global_fd, fcntl.F_NOTIFY,
- fcntl.DN_MODIFY|fcntl.DN_CREATE|fcntl.DN_MULTISHOT)
+ flags=fcntl.DN_MODIFY|fcntl.DN_CREATE|fcntl.DN_MULTISHOT
+ # The business with ctypes ensures that fcntl's argument fits into
+ # a C integer, which might not otherwise occur on 64-bit systems.
+ fcntl.fcntl(_global_fd, fcntl.F_NOTIFY, ctypes.c_int(flags).value)
mainwindow.log('USB Comm Watch started')
return True

(One of the flags in question is 2^31, which 64-bit builds normally
treat as positive.)
--
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
Finger ***@monk.mit.edu (NOT a valid e-mail address) for more info.
Loading...