Code Monkey home page Code Monkey logo

Comments (11)

Schnouki avatar Schnouki commented on June 22, 2024

Interesting. Apparently the error is in the code that converts server time to your local timezone.
What channel were you browsing when bccc crashed, and in which timezone do you live?

from bccc.

Zackrobat avatar Zackrobat commented on June 22, 2024

09:36:49 [zbrown] ~/Desktop/bccc/bccc/bccc$ date +%z
-0400
09:36:53 [zbrown] ~/Desktop/bccc/bccc/bccc$

The bccc UI was only active for a couple of seconds, and since I've
never used it before, I'm not sure what channel it was set to browse.
If there's a default channel, I was probably browsing that.

On Wed, May 30, 2012 at 9:10 AM, Thomas Jost
[email protected]
wrote:

Interesting. Apparently the error is in the code that converts server time to your local timezone.
What channel were you browsing when bccc crashed, and in which timezone do you live?


Reply to this email directly or view it on GitHub:
#9 (comment)

Zack Brown

from bccc.

Schnouki avatar Schnouki commented on June 22, 2024

The default is to browse your personal channel. If you tell me your
channel JID I'll be able to do some tests and try to fix this problem.

from bccc.

Zackrobat avatar Zackrobat commented on June 22, 2024

jid = [email protected]

from bccc.

Schnouki avatar Schnouki commented on June 22, 2024

Your channel is private. Could you please accept my request to subscribe to it?

from bccc.

Zackrobat avatar Zackrobat commented on June 22, 2024

I have done so.

from bccc.

Schnouki avatar Schnouki commented on June 22, 2024

Hmm, I can't reproduce this issue, I can display your channel without any trouble. So I'll need some help :)

Could you please:

  1. enable logging in your config file
  2. replace the LocalTimezone._isdst() method in bccc/ui/util.py (lines 47--53) with http://pastebin.com/sujEKYpc
  3. make bccc crash again
  4. post the end of the log, especially the line with "OverflowError".

(The best would be to set the log level to "debug", remove your password from the log and mail it to me at [email protected])

from bccc.

Zackrobat avatar Zackrobat commented on June 22, 2024

OK. Logging was already enabled at the "warning" level, so I left it as it was.

I replaced the _isdst with the code from the link you included.

I rebuilt and reinstalled bccc

I ran bccc. It lasted a few seconds longer this time, then crashed with the following message:

"Fatal Python error. Cannot recover from stack overflow. Aborted (core dumped)"

I looked in ~/.bccc.log and found it was empty.

I changed the logging level to 'debug' and ran bccc again. I got the same error at crashtime.

This time when I looked in ~/.bccc.log I got a metric ton of output, but none of it included "OverflowError" anywhere.

Here are the last several lines of the log file:

2012-05-31 06:00:34,330 sleekxmpp.xmlstream.xmlstream:DEBUG RECV:
2012-05-31 06:00:34,332 sleekxmpp.xmlstream.xmlstream:DEBUG SEND:
2012-05-31 06:00:34,572 sleekxmpp.xmlstream.xmlstream:DEBUG RECV:
2012-05-31 06:00:34,573 sleekxmpp.plugins.xep_0030.disco:DEBUG Received disco items result frombuddycloud.org to [email protected]/901f8766-d844-4a90-87e9-97581ae694cf.
2012-05-31 06:00:34,574 sleekxmpp.plugins.xep_0030.disco:DEBUG Received disco info result fromchannels.buddycloud.org to [email protected]/901f8766-d844-4a90-87e9-97581ae694cf.
2012-05-31 06:00:34,584 sleekxmpp.plugins.xep_0030.disco:DEBUG Received disco info result fromtopics.buddycloud.org to [email protected]/901f8766-d844-4a90-87e9-97581ae694cf.
2012-05-31 06:00:34,585 sleekxmpp.plugins.xep_0030.disco:DEBUG Received disco info result fromanon.buddycloud.org to [email protected]/901f8766-d844-4a90-87e9-97581ae694cf.
2012-05-31 06:00:34,586 sleekxmpp.plugins.xep_0030.disco:DEBUG Received disco info result fromsearch.buddycloud.org to [email protected]/901f8766-d844-4a90-87e9-97581ae694cf.
2012-05-31 06:00:34,587 sleekxmpp.plugins.xep_0030.disco:DEBUG Received disco info result fromoembed.buddycloud.org to [email protected]/901f8766-d844-4a90-87e9-97581ae694cf.

from bccc.

Schnouki avatar Schnouki commented on June 22, 2024

Wow, a stack overflow in the CPython interpreter caused by pure Python code -- I don't think I had managed to do that yet.
I think the problem in the patch I sent you is that calling str(dt) triggers a call to _isdst(), which raises an exception that causes a call to str(dt), etc., infinite recursion, and boom stack overflow :D

Here's a new version of _isdst without the call to str(dt): http://pastebin.com/Pi8Ft9nk
Could you please tell me if this one "works" (i.e. OverflowError, not stack overflow in Python interpreter), and if it does, could you please mail me the full log? (gzip it if it's too big...)

from bccc.

Zackrobat avatar Zackrobat commented on June 22, 2024

OK, I used your new version of _isdst, and got this output from a run:

10:45:34 [zbrown] ~/Desktop/bccc/bccc$ bccc

Traceback (most recent call last):
File "/usr/local/bin/bccc", line 5, in
pkg_resources.run_script('bccc==0.0.1', 'bccc')
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1236, in run_script
exec(compile(open(script_filename).read(), script_filename, 'exec'), namespace, namespace)
File "/usr/local/lib/python3.2/dist-packages/bccc-0.0.1-py3.2.egg/EGG-INFO/scripts/bccc", line 70, in
ui.run()
File "/usr/local/lib/python3.2/dist-packages/bccc-0.0.1-py3.2.egg/bccc/ui/ui.py", line 101, in run
self.loop.run()
File "/usr/local/lib/python3.2/dist-packages/urwid-1.0.1-py3.2-linux-i686.egg/urwid/main_loop.py", line 274, in run
self.screen.run_wrapper(self._run)
File "/usr/local/lib/python3.2/dist-packages/urwid-1.0.1-py3.2-linux-i686.egg/urwid/raw_display.py", line 237, in run_wrapper
return fn()
File "/usr/local/lib/python3.2/dist-packages/urwid-1.0.1-py3.2-linux-i686.egg/urwid/main_loop.py", line 307, in _run
self.event_loop.run()
File "/usr/local/lib/python3.2/dist-packages/urwid-1.0.1-py3.2-linux-i686.egg/urwid/main_loop.py", line 682, in run
self._loop()
File "/usr/local/lib/python3.2/dist-packages/urwid-1.0.1-py3.2-linux-i686.egg/urwid/main_loop.py", line 720, in _loop
self._watch_filesfd
File "/usr/local/lib/python3.2/dist-packages/urwid-1.0.1-py3.2-linux-i686.egg/urwid/main_loop.py", line 187, in cb
rval = callback(data)
File "/usr/local/lib/python3.2/dist-packages/bccc-0.0.1-py3.2.egg/bccc/ui/ui.py", line 135, in _handle_callback
func(_args, *_kwargs)
File "/usr/local/lib/python3.2/dist-packages/bccc-0.0.1-py3.2.egg/bccc/ui/sidebar.py", line 76, in pubsub_posts_callback
if atom_pub > self.most_recent_activity:
File "/usr/local/lib/python3.2/dist-packages/bccc-0.0.1-py3.2.egg/bccc/ui/util.py", line 33, in utcoffset
if self._isdst(dt):
File "/usr/local/lib/python3.2/dist-packages/bccc-0.0.1-py3.2.egg/bccc/ui/util.py", line 52, in _isdst
stamp = time.mktime(tt)
OverflowError: mktime argument out of range
10:45:45 [zbrown] ~/Desktop/bccc/bccc$

This time the debugging output in the log file did include an overflow line:

2012-05-31 10:46:48,400 root:ERROR OverflowError: (1900, 1, 1, 0, 0, 0, 0, 0, 0) -- -1 day, 20:00:00 -- -1 day, 19:00:00

I've sent the full log file to you via email.

from bccc.

Schnouki avatar Schnouki commented on June 22, 2024

Ok, I've been able to reproduce this bug. It's i686-specific (I had to set up a 32bit chroot): on x86_64, time.mktime() returns negative timestamps when its arg has a year < 1970, but on i686 it raises OverflowError instead.

I'll push a workaround later; a cleaner fix would probably require adding a new dependency (pytz), which I would like to avoid.

from bccc.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.