List Info

Thread: mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix




mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-15 22:19:26
	Dear django-users,

  I have been getting a segmentation fault when using 
django.utils.feedgenerator to generate an RSS feed of my
site. This 
works fine with 'django-admin runserver', but when run
under mod_python, 
I get (in Apache's error log):

[Wed Feb 15 22:02:41 2006] [notice] mod_python:
(Re)importing module 
'django.core.handlers.modpython'
[Wed Feb 15 22:02:42 2006] [notice] mod_python:
(Re)importing module 
'django.core.handlers.modpython'
[Wed Feb 15 22:02:43 2006] [notice] child pid 21119 exit
signal 
Segmentation fault (11)
[Wed Feb 15 22:02:44 2006] [notice] child pid 21075 exit
signal 
Segmentation fault (11)

  Bizarrely I only get this on my live server, not on my
staging 
mod_python server. I found an IRC transcript that suggested
this was 
something to do with also using mod_php on that Apache
(which I do).
( http:/
/simon.bofh.ms/logger/django/2006/01/23/ about two
thirds of the 
way down ).

  In django/utils/feedgenerator.py if you comment out lines
24 and 25:

# from xml.dom import minidom
# from xml.parsers.expat import ExpatError

  it works ! Those lines do not seem to be used.

  Has anyone else encountered this ? Why those two imports
if they are 
not used ?

  Best regards,
  Graham.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-15 23:24:08
On Feb 15, 2006, at 4:19 PM, Graham King wrote:
>   I have been getting a segmentation fault when using
> django.utils.feedgenerator to generate an RSS feed of
my site. This
> works fine with 'django-admin runserver', but when
run under  
> mod_python,

99% of the time this is because you're running mod_php and
mod_python  
in the same Apache instance.  Is this the case for you?

Jacob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-16 03:57:33
On 2/15/06, Jacob Kaplan-Moss <jacobjacobian.org> wrote:
> On Feb 15, 2006, at 4:19 PM, Graham King wrote:
> >   I have been getting a segmentation fault when
using
> > django.utils.feedgenerator to generate an RSS feed
of my site. This
> > works fine with 'django-admin runserver', but
when run under
> > mod_python,
>
> 99% of the time this is because you're running mod_php
and mod_python
> in the same Apache instance.  Is this the case for you?

I've added this to the mod_python documentation. If anybody
has more
information (or other causes), please speak up.

http://www.djangoproject.co
m/documentation/modpython/#if-you-get-a-segmentation-fault

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-16 09:06:51
Hi, I had problems running Django with mod_python, so I had
the
possibility to investigate and obtain some detailed info,
which I'd
like to share here.

I'd like to suggest "Expat Causing Apache
Crash", which explains
problems caused due to mismatches in the version of the
"expat" library
embedded into Python and that linked into Apache, how to
verifying if
expat is the problem and finally a resolution.
(h
ttp://www.dscpl.com.au/articles/modpython-006.html)

Another reading is mod_python FAQ Entry - mod_python and
MySQLDb won't
work together
(http://www.modpython.org/FAQ/faqw.py?req=sho
w&file=faq02.013.htp)

Then, a good way to obtain useful information that can be
used to ask
for help is - first of all - check if mod_python works
alone, without
involve Django. The procedure is detailed here:

http://www.dscpl.com.au/articles/modpython-001.html.

Again, it's useful to locate which is the problematic
module (if it's
true that an imported module causes the crash) that make the
segmentation fault happen. For this I'd like to cite
textually the
answer I had on mod_python mailing list (here is the whole
thread, in
case anyone would care to read it,
http://www.modpython.org/pipermail/mod_py
thon/2005-December/019647.html):


"Next step then would be to import into the handler of
your test code,
the module which you specify needs to be imported in order
to make
use of Django. If done in the test handler function,
accessing the
test URL will cause it to be imported and if it does crash
at that
point
you have confirmed that it is the actual import of the
Django stuff
that
is the problem. If that is confirmed, then look internally
at Django
and
see what module it imports, and instead of importing the
Django top
level module, import what it imports. Gradually reduce the
set of
imports
until it stops crashing so as to find the specific module
that causes
the
problem. Drop down further into modules and look at their
imports as
necessary.

This sort of process of elimination is the only way you are
going to
be able to narrow it down. Unless you can determine
precisely which
module is the issue, we aren't really going to be able to
help."

This is all I gathered around.

HTH, regards


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-16 09:53:23


paolo wrote:
> Hi, I had problems running Django with mod_python, so I
had the
> possibility to investigate and obtain some detailed
info, which I'd
> like to share here.
> 
> I'd like to suggest "Expat Causing Apache
Crash", which explains
> problems caused due to mismatches in the version of the
"expat" library
> embedded into Python and that linked into Apache, how
to verifying if
> expat is the problem and finally a resolution.
> (h
ttp://www.dscpl.com.au/articles/modpython-006.html)
> 

  Commenting out this line in feedgenerator.py fixes my
problem, so that 
does seem to be the cause:

from xml.parsers.expat import ExpatError

  An expat version mismatch would also explain why it works
with 
mod_python on my staging server (which is a more recent
build).
  This evening I will check the expat versions and try
rebuilding Apache 
as advised in the link, and post my results.

  Thanks very much.
  Graham.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-16 09:48:25
  Yes, that is the case.

Jacob Kaplan-Moss wrote:
> On Feb 15, 2006, at 4:19 PM, Graham King wrote:
> 
>>  I have been getting a segmentation fault when
using
>>django.utils.feedgenerator to generate an RSS feed
of my site. This
>>works fine with 'django-admin runserver', but when
run under  
>>mod_python,
> 
> 
> 99% of the time this is because you're running mod_php
and mod_python  
> in the same Apache instance.  Is this the case for you?
> 
> Jacob
> 
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-16 11:55:56


Graham King wrote:
> 
> 
> paolo wrote:
> 
>>Hi, I had problems running Django with mod_python,
so I had the
>>possibility to investigate and obtain some detailed
info, which I'd
>>like to share here.
>>
>>I'd like to suggest "Expat Causing Apache
Crash", which explains
>>problems caused due to mismatches in the version of
the "expat" library
>>embedded into Python and that linked into Apache,
how to verifying if
>>expat is the problem and finally a resolution.
>>(h
ttp://www.dscpl.com.au/articles/modpython-006.html)
>>
> 

  That was my problem. Python was using expat 1.95.8, and
Apache was 
symlinked to 1.95.7.
  I upgraded expat ('emerge expat' on Gentoo), restarted
Apache, and it 
now works fine.

  I've added a comment to 
http://www.djangoproject.com/documentation/modpython/

  Thanks for the help.

  Graham.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-16 16:03:18
On 2/16/06, paolo <paolophp3gmail.com> wrote:
> Hi, I had problems running Django with mod_python, so I
had the
> possibility to investigate and obtain some detailed
info, which I'd
> like to share here.

Thanks very much for this fine collection of information and
links.
I've updated the documentation:

http://www.djangoproject.co
m/documentation/modpython/#if-you-get-a-segmentation-fault

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix
user name
2006-02-16 20:23:00

On Feb 16, 2006, at 11:03 AM, Adrian Holovaty wrote:

>
> On 2/16/06, paolo <paolophp3gmail.com> wrote:
>> Hi, I had problems running Django with mod_python,
so I had the
>> possibility to investigate and obtain some detailed
info, which I'd
>> like to share here.
>
> Thanks very much for this fine collection of
information and links.
> I've updated the documentation:
>
> http://www.djangoproject.com/documentation/mo
dpython/#if-you-get-a- 
> segmentation-fault
>
> Adrian
>
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com | chicagocrime.org
>

	Excellent information. Having that stuff in the docs will
save some  
future django-nauts a bunch of time -- I spent  a couple
hours last  
week on diagnosing the same issue.
	I can't ditch PHP (yet), so I ended up setting up two
separate  
Apache instances running side-by-side to get around the
mod_php  
problem. Does anybody know of a better solution than that,
short of  
re-compiling PHP? Or which versions, distros, etc., this
issue pops  
up in?

Thanks,
--P


Paul Smith
paulblinkylights.org



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )