Django

Code

Ticket #8020 (closed: fixed)

Opened 4 months ago

Last modified 3 months ago

python process crashes when using sitemaps after [8088]

Reported by: Boo Assigned to: nobody
Milestone: 1.0 Component: Contrib apps
Version: SVN Keywords: sitemap
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by mtredinnick)

When I go to http://example.com/sitemap.xml, python process crashes without any errors or core dumps.

Django-version: trunk after [8088]
DB-backends: PostgreSQL or SQLite3
URLs in sitemap: less than 50000

Attachments

testcase.tar.gz (5.7 kB) - added by Boo on 07/29/08 15:40:02.
TestCase? to repeat the problem
testcase2.tar.gz (5.6 kB) - added by Boo on 07/31/08 00:15:06.
Corrected INSTALLED_APPS
sitemap-crash.diff (0.7 kB) - added by johndagostino on 08/03/08 00:38:45.
fixes development server crash sitemaps framework

Change History

07/29/08 14:05:51 changed by mtredinnick

  • needs_better_patch changed.
  • description changed.
  • needs_tests changed.
  • needs_docs changed.

There isn't really enough information here to work out what's going on or what the problem being reported is. You say "it crashed", but what do you mean? How can we replicate the problem? Do you have a small example that shows what is going on?

A problem that cannot be repeated cannot be fixed.

07/29/08 15:40:02 changed by Boo

  • attachment testcase.tar.gz added.

TestCase? to repeat the problem

07/29/08 15:58:23 changed by Boo

I've added TestCase? to repeat this problem. I use Python-2.5.2, OS: FreeBSD and MacOSX.

I run development server and go to http://127.0.0.1:8000/sitemap.xml, and devserver crushes without any errors.

Boo:~/projects/testcase boo$ ./manage.py runserver
Validating models...
0 errors found

Django version 1.0-alpha-SVN-8138, using settings 'testcase.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Boo:~/projects/testcase boo$

07/29/08 18:41:39 changed by Boo

  • needs_tests set to 1.

07/30/08 19:39:19 changed by evan_schulz

As long as I add "django.contrib.sitemaps" to INSTALLED_APPS the attached test case works fine for me: displaying the sitemap file without any sign of errors or crashing. I happen to be at changeset [8156] on python 2.5.2.

07/31/08 00:15:06 changed by Boo

  • attachment testcase2.tar.gz added.

Corrected INSTALLED_APPS

07/31/08 08:55:41 changed by julianb

The test case works for me. Python 2.5.2 at [8161]

08/03/08 00:38:45 changed by johndagostino

  • attachment sitemap-crash.diff added.

fixes development server crash sitemaps framework

08/03/08 00:47:57 changed by johndagostino

I can reproduce this on MacOSX with Python 2.5.1 The attached patch fixes the crash for me.

from django.contrib.sitemaps import Sitemap
from blog.models import Post

class PostSitemap(Sitemap):
    changefreq = "never"
    priority = 0.5

    def items(self):
        return Post.objects.all()

    def lastmod(self, obj):
        return obj.pub_date

08/03/08 17:34:08 changed by johndagostino

  • has_patch set to 1.
  • needs_tests deleted.
  • milestone set to 1.0 beta.

08/08/08 09:49:29 changed by julianb

  • stage changed from Unreviewed to Ready for checkin.

Seems obvious...

08/08/08 10:40:33 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [8231]) Fixed #8020 -- Fixed paginator initialisation in sitemaps framework. Thanks, John D'Agostino.

08/26/08 17:47:19 changed by hvendelbo

  • status changed from closed to reopened.
  • resolution deleted.

This change recurses for me on Mac OSX, I don't understand why it wouldn't infinitely recurse on all platforms???

Is it because I changed the Sitemap class to a new-style class?

get_urls gets the paginator entering _get_paginator It already has the property paginator, so it returns the property paginator which triggers a call to _get_paginator as it already has ....

08/26/08 17:55:34 changed by hvendelbo

I believe reverting the fix and making Sitemaps new-style classes fixes the cause of this ticket.

08/26/08 18:38:07 changed by mtredinnick

  • milestone changed from 1.0 beta to 1.0.

08/26/08 18:38:14 changed by mtredinnick

  • stage changed from Ready for checkin to Accepted.

08/27/08 03:28:53 changed by mtredinnick

  • status changed from reopened to closed.
  • resolution set to fixed.

From your description, it sounds like you are running a version from earlier than [8231], where the infinite loop problem with referring to a bad attribute was fixed. So I'm going to reclose this.

If you are still seeing a problem on unmodified code that is up to date, please open a new ticket explaining how to repeat the problem.


Add/Change #8020 (python process crashes when using sitemaps after [8088])




Change Properties
Action