Edgewall Software

Opened 14 years ago

Closed 14 years ago

#381 closed defect (fixed)

Segmentation fault

Reported by: jcigar@… Owned by: cmlenz
Priority: blocker Milestone:
Component: General Version: 0.5.1
Keywords: Cc:

Description

Hello,

I'm using Genshi (0.5.1) with Pylons 0.9.7 under FreeBSD 8.0 AMD64 and Python 2.6.4.

Python has been compiled through the ports with the following options :

  • _OPTIONS_READ=python26-2.6.4
  • WITH_THREADS=true
  • WITHOUT_HUGE_STACK_SIZE=true
  • WITHOUT_SEM=true
  • WITHOUT_PTH=true
  • WITH_UCS4=true
  • WITH_PYMALLOC=true
  • WITHOUT_IPV6=true
  • WITHOUT_FPECTL=true

I overrided the default Pylons render_genshi function to be able to use Genshi Filters :

def render_genshi(template_name, extra_vars=None, cache_key=None,
                  cache_type=None, 
                  cache_expire=None, method='xhtml', filters=[]):

    def render_template():
        globs = extra_vars or {}
        globs.update(pylons_globals())
        template = globs['app_globals'].genshi_loader.load(template_name)

        return literal(template.generate(**globs).\
                       filter(*filters).render(method=method, encoding=None))

    return cached_template(template_name, render_template, cache_key=cache_key, cache_type=cache_type, 
                           cache_expire=cache_expire, ns_options=('method'), method=method)

I have a controller with the following code :

    def show(self, title):
        try:
            c.page = model.Page.query.filter_by(title=title).first()
        except:
            abort(404)

        if request.is_xhr:
            return render('page/_content.html')
        else:
            return render('page/show.html')

I'm using virtualenv, and paster is launched as :

sudo -u www-generic paster serve production.ini

When I call http://mysite/page/show/mypage Genshi the Python process segfaults :

serving on 0.0.0.0:5012 view at http://127.0.0.1:5012
zsh: segmentation fault (core dumped)  sudo -u www-generic paster serve production.ini

I have this problem only with Genshi 0.5.1 and AMD64. I tried to replace 0.5.1 with 0.4.4 and it works fine, so maybe a bug in the C extension which appeared in 0.5 ..?

Change History (1)

comment:1 Changed 14 years ago by jcigar@…

  • Resolution set to fixed
  • Status changed from new to closed

ok.. seems to be a bug in the Python interpreter, I just compiled Python 2.6.5 from sources (with --disable-ipv6 --enable-unicode=ucs4 --with-pymalloc --with-threads --with-pydebug) and it doesn't segfault anymore

Note: See TracTickets for help on using tickets.