Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Bus error, possibly from recursive call
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eddie Sholl  
View profile  
 More options Oct 19 2012, 7:56 am
From: Eddie Sholl <eddie.sh...@gmail.com>
Date: Fri, 19 Oct 2012 04:56:42 -0700 (PDT)
Local: Fri, Oct 19 2012 7:56 am
Subject: Re: [cherrypy-users] Bus error, possibly from recursive call

HI all,

Thanks for your feedback. Initially I saw the 'Bus error' and assumed this
was coming out of the cherrypy 'bus' feature, but its totally unrelated to
that. The 'Bus error' I mentioned is just a plain old hard crash of python
itself.

My recursion was blowing past the default stack size settings of python.
Using threading.stack_size and sys.setrecursionlimit, I can get my app to
run for longer, but its all just pointing to the fact that I need to
rethink my basic use of recursion here. I'm going to have a play with
stackless python, it seems to offer a bunch of advantages for what Im
trying to do, including more efficient use of the stack (from what I've
read so far).

Ideally I'd get to a solution where my cherrypy server and python runtime
are totally isolated from terminal errors in my app logic, but thats
probably some way down the track.

Cheers,
Eddie

On Wednesday, October 17, 2012 11:26:49 PM UTC+11, Sylvain Hellegouarch
wrote:

> Hi Eddie,

> On Wed, Oct 17, 2012 at 2:19 PM, Eddie Sholl <eddie...@gmail.com<javascript:>
> > wrote:

>> Hi all,

>> I'm quite new to cherrypy, I've been playing around with it over the last
>> few weeks and enjoying the simple and minimal approach taken with the
>> framework. Ive been using it for a small project of mine, which is
>> primarily for running a turn based strategy game engine, and an AI for
>> playing that game.

>> I've run into a problem that Im having trouble investigating further. I'm
>> basically just getting a 'Bus error' message in my console output, and
>> everything dies at that point. The code that runs to produce the failure is
>> a recursive method, and obviously thats not ideal to be running during a
>> request. But my profiling and tracing suggests its only being called ~100
>> times before cherrypy falls over, and its only to a max depth of 2.

> I've never come across a "Bus error" issue like you've had. Could you
> provide more context? What is your app, hence the bus, doing at the point
> where it dies?

>> So ive got a couple of questions that can help me deal with the issue.
>> First of all, I was looking for a nice example of async request handling.
>> The best hints so far are either the BackgroundTask or Monitor documented
>> at
>> http://docs.cherrypy.org/stable/refman/process/plugins/index.html#mon... really like to see an example to get my head around how to use these),
>> or the wiki article http://tools.cherrypy.org/wiki/BackgroundTaskQueue.
>> Is this how I should proceed to shift the load of my game AI out of a
>> straight synchronous request handler?

> If you don't mind threads and having everything within your main Python
> process, those are great. If you want something more distributed you could
> look at writing a plugin interfacing celery [1] or something similar.

> You could get some inspiration from some recipes I wrote [2].

> [1] http://celeryproject.org/
> [2]
> https://bitbucket.org/Lawouach/cherrypy-recipes/src/c899e1b914171d3c3...

> --
> - Sylvain
> http://www.defuze.org
> http://twitter.com/lawouach


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.