"Variable referenced before initialization" using Cython 0.15 to compile extensions

Bug #837221 reported by John A Meinel on 2011-08-30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Denys Duchier
Martin Packman
bzr (Ubuntu)
Jelmer Vernooij

Bug Description

I did a test build, upgrading to Cython 0.15 (the current latest). They changed the code so that now variables are no longer implicitly initialized. eg:

cdef foo

if foo is not None:

In earlier Cython (and Pyrex) objects were always initialized to None, and other variables to a reasonable default (pointers to NULL, etc).

The one bit I investigated was spurious, the variable was being set by a function call as an 'out' parameter. However, there were about 10 warnings, and it would be nice to be warning free.

This would apply to older versions of bzr as well, since the windows build host uses the same version of Cython across all versions.

Related branches

Martin Packman (gz) wrote :

Apparently quite a few people are now running into this in the form of errors like:

Traceback (most recent call last):
   File "_dirstate_helpers_pyx.pyx", line 1459, in bzrlib._dirstate_helpers_pyx.ProcessEntryC.__next__ (bzrlib/_dirstate_helpers_pyx.c:12037)
   File "_dirstate_helpers_pyx.pyx", line 1732, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next (bzrlib/_dirstate_helpers_pyx.c:14786)
   File "_dirstate_helpers_pyx.pyx", line 1888, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._loop_one_block (bzrlib/_dirstate_helpers_pyx.c:16487)
 UnboundLocalError: local variable 'changed' referenced before assignment

Changed in bzr:
assignee: John A Meinel (jameinel) → Denys Duchier (denys.duchier)
importance: Low → Medium
milestone: none → 2.5b1
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Martin Pitt (pitti) on 2011-11-04
affects: bazaar (Ubuntu) → bzr (Ubuntu)
Changed in bzr (Ubuntu):
status: New → Confirmed
Martin Pitt (pitti) wrote :

Please update bzr in precise first, as per SRU policy. Otherwise this can't progress into -updates.

Changed in bzr (Ubuntu Oneiric):
status: New → Fix Committed
tags: added: verification-needed

Hello John, or anyone else affected,

Accepted bzr into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Jelmer Vernooij (jelmer) on 2011-11-04
Changed in bzr (Ubuntu):
status: New → In Progress
assignee: nobody → Jelmer Vernooij (jelmer)
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr - 2.5.0~beta2-0ubuntu1

bzr (2.5.0~beta2-0ubuntu1) precise; urgency=low

  * New upstream release.
   + Fixes compatibility with cython 0.15. LP: #837221
   + Fixes handling of timestamps in diffs for absent files in working tree.
     LP: #847435
   + Fixes overflow error in dirstate when dealing with large files.
     LP: #683191
  * Merge from Debian. Remaining changes:
   + Drop build dependencies on python-{subunit,meliae,lzma,medusa}, which are
     not in main.
   + Disable support for running selftest in parallel (requires subunit).
 -- Jelmer Vernooij <email address hidden> Fri, 04 Nov 2011 22:55:11 +0100

Changed in bzr (Ubuntu):
status: In Progress → Fix Released

The fix for this bug has been awaiting testing feedback in the -proposed repository for oneiric for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Martin Packman (gz) wrote :

Ran an oneiric instance using the following image:


Upgraded bzr and related packaged to 2.4.2 from the -proposed archive:

 Commandline: apt-get upgrade bzr
 Upgrade: byobu:amd64 (4.37-0ubuntu1, 4.37-0ubuntu1.1), unattended-upgrades:amd64 (0.73ubuntu1, 0.73ubuntu1.1), python-bzrlib.tests:amd64 (2.4.1-1ubuntu1, 2.4.2-0ubuntu1), procps:amd64 (3.2.8-10ubuntu5, 3.2.8-10ubuntu5.1), python-bzrlib:amd64 (2.4.1-1ubuntu1, 2.4.2-0ubuntu1), bzr:amd64 (2.4.1-1ubuntu1, 2.4.2-0ubuntu1), libgcrypt11:amd64 (1.5.0-1, 1.5.0-1ubuntu0.1)

To verify that the upgrade from 2.4.1 to 2.4.2 worked as expected, ran the test suite:

 ubuntu@test:~$ bzr selftest
 bzr selftest: /usr/bin/bzr
    bzr-2.4.2 python-2.7.2 Linux-3.0.0-23-virtual-x86_64-with-Ubuntu-11.10-oneiric
 Ran 26912 tests in 1392.984s

 FAILED (failures=1, known_failure_count=34)
 1299 tests skipped

The test failure is some minor apport/vm weirdness in bt.test_crash that also failed prior to the package upgrade.

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr - 2.4.2-0ubuntu1

bzr (2.4.2-0ubuntu1) oneiric-proposed; urgency=low

  * New upstream release.
   + Fix OverflowError in _dirstate_helpers_pyx.c. LP: #683191
   + Fix compatibility with Cython 0.15. LP: #837221
 -- Jelmer Vernooij <email address hidden> Wed, 02 Nov 2011 15:01:08 +0100

Changed in bzr (Ubuntu Oneiric):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers