I am running a basic Pyramid application with apache mod_Wsgi. My application setup seems Ok since I can access the home Pyramid template under Apache.
As soon as I issue a request to this app, the apache process crashes with 'premature end of script headers - segmentation fault'. This is how the sqlalchemy code looks for the request. (I've added this code to _views._py itself since I am trying to create a RESTful framework without the use of models.)
try:
print >> sys.stderr, 'entering sql execute'
value=session.execute(s)
for row in value:
listofclients.append(row[0])
return listofclients
session.close()
except exc.SQLAlchemyError, exc:
print >> sys.stderr, exc.message
I can see 'entering sql execute' in the apache error log. Immediately after which the process crashes. Commenting out the execute statement and returning sample values works. Running this app under pserve provided by pyramid works like a charm.
Any help why Apache does not like the execute statment? Let me know if you need any other information.
Try reading the mod_wsgi FAQ about process crashes.
The most probably cause being:
To get a better idea use a debugger to capture a stack trace: