Description

This bug is very similar to the integer overflow problem reported (and fixed) in RecentChanges.py:

MoinMoinBugs/IntegerOverflowInRecentChangesMacro

also

MoinMoinBugs/FreshInstallOnRHEL3

Steps to reproduce

View the PageHits page.

Example

Opening the PageHits page produces the following stack trace:

Traceback (most recent call last):
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/request.py", line 775, in run
    Page(self, pagename).send_page(self, count_hit=1)
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/Page.py", line 914, in send_page
    self.send_page_content(request, Parser, body, format_args=pi_formatargs, do_cache=do_cache)
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/Page.py", line 1045, in send_page_content
    exec code
  File "PageHits", line 6, in ?
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/formatter/base.py", line 221, in macro
    return macro_obj.execute(name, args)
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/wikimacro.py", line 101, in execute
    return macro(self, args)
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/macro/PageHits.py", line 28, in execute
    for event in event_log.reverse():
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/logfile/logfile.py", line 88, in reverse
    result = self.previous()
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/logfile/logfile.py", line 259, in previous
    result = self.__previous()
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/logfile/logfile.py", line 249, in __previous
    return self.parser(self.__buffer.lines[self.__rel_index])
  File "/usr0/igdev/public/html/wiki/moin/lib/python2.3/site-packages/MoinMoin/logfile/eventlog.py", line 53, in parser
    return (int(time_usecs), eventtype, web.parseQueryString(kvpairs))
ValueError: int() literal too large: 1104428392223656

Details

MoinMoin Version

1.3.1

OS and Version

Linux 2.6.8-24.5-smp

Python Version

Python 2.3.3

Server Setup

Apache/2.0.46

Server Details

Workaround

Edit line 53 of eventlog.py from:

return (int(time_usecs), eventtype, web.parseQueryString(kvpairs))

to

return (long(time_usecs), eventtype, web.parseQueryString(kvpairs))

-- TonyGarland

Discussion

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/PageHitsIntegerOverflow (last edited 2007-10-29 19:07:35 by localhost)