[Bug 1580577] Re: python2.7 crashes with SegFault when running Zope

Ján Jockusch jan.jockusch at perfact.de
Tue May 17 12:14:40 UTC 2016

The Debian (testing) version of Python2.7.11 does also exhibit the
problem. I already told the Debian maintainer, Matthias Klose
<doko at debian.org>, via email because I wanted to know exactly where he
prefers to have it posted. He has already contributed here.

@Matthias: The issue remains open. Please advise on how I should proceed
concerning Debian.

In the mean time, I have attempted to narrow the debian/patches/* files
down so I can find which patch produces the problem.

But the patches quite heavily depend on each other, so I have not yet
succeeded in producing a debianized build which does not have the
problem. Still working at that.

The bug can be traced in gdb by executing the testing setup, then saying "gdb ./zope-virtualenv/bin/python2.7-dbg" and in gdb: "run ./zope-virtualenv/bin/runzope -C ./zope-virtualenv/instance/etc/zope.conf".

After sending the curl commands to produce the error, gdb exits with the
above mentioned error:

"Fatal Python error: ../Objects/descrobject.c:10 object at 0x1572240 has negative ref count -1
Program received signal SIGABRT, Aborted."

Then the stack trace can be inspected. My knowledge of Python's memory
management is not deep enough to really make any sense of what I'm
seeing, other than it looks remotely like a "double free".

I'll try to contribute more. Anyone with better understanding of Python
internals, your help is much appreciated!

You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python2.7 in Ubuntu.

  python2.7 crashes with SegFault when running Zope

Status in python2.7 package in Ubuntu:

Bug description:
  Source package / Package:



  Description:	Ubuntu 16.04 LTS
  Release:	16.04

  This is a bug report originating from the findings documented in


  The expected behaviour is this:
  - Upon installing Zope2 in a virtualenv a default instance should work with no issues.

  What happens instead:
  - The freshly installed Zope instance causes Python to SegFault after only a few requests.

  But Python should never SegFault.

  The following program produces the error:

  set -e

  # Call this testing script with an argument "setup" for the first time
  # to build the testing case
  # After that, the script only performs the test as described below.
  # Requirements: apt-get install virtualenv python2.7-dbg
  # This script needs internet access when running.

  # The python version to test:

  # This part builds the testing environment

  if [ "$1" == "setup" ] ; then
      # Virtual environment with the chosen python 
      virtualenv --python ${python} --no-site-packages zope-virtualenv
      cd zope-virtualenv
      # Basic Zope installation
      ./bin/easy_install -i http://download.zope.org/Zope2/index/2.13.24 Zope2
      # Simplest possible Zope instance
      ./bin/mkzopeinstance --dir instance --user admin:admin
      cd ..


  # Run Zope instance in the background
  zope-virtualenv/instance/bin/runzope &

  # Give Zope some time to start up
  sleep 3

  # Call a few management URLs, nothing too fancy...

  while true ; do
      for url in ${urls} ; do 
  	echo ${url}
          curl -s $url -o /dev/null

  # This test fails after about 10 requests with
  # Fatal Python error: ../Objects/descrobject.c:10 object at 0x??? has negative ref count -1

To manage notifications about this bug go to:

More information about the foundations-bugs mailing list