Python-netcdf crashes in Feisty

Bug #113803 reported by togr
14
Affects Status Importance Assigned to Milestone
python-scientific (Ubuntu)
Fix Released
Medium
Unassigned
Feisty
Fix Released
Medium
Scott Kitterman

Bug Description

Binary package hint: python-netcdf

I had Ubuntu 6.10, upgraded to 7.04.

Python 2.5 is from deb python (2.5.1~rc1-0ubuntu3)
Python 2.4 is from deb python2.4 (2.4.4-2ubuntu7)
python-netcdf is (2.4.11-1build1)

Running the following script crashes python 2.5, but runs fine under python 2.4:

#!/usr/bin/python
from Scientific.IO.NetCDF import *
fname = 'crash.nc'
ncfile = NetCDFFile(fname, 'w', 'Created now by me')

Running the sample script in /usr/share/doc/python-netcdf/examples/netcdf_demo.py likewise runs fine under python 2.4 but crashes under python 2.5

Revision history for this message
togr (tom-grydeland) wrote :
Download full text (3.2 KiB)

Output from running test script:

*** glibc detected *** python: free(): invalid pointer: 0xb7de0de0 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7eb27cd]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7eb5e30]
/usr/lib/python2.5/site-packages/Scientific/linux2/Scientific_netcdf.so[0xb7d82efe]
python[0x8085269]
python(PyDict_SetItem+0x6e)[0x8086bae]
python(_PyModule_Clear+0x158)[0x8088808]
python(PyImport_Cleanup+0x153)[0x80dcc63]
python(Py_Finalize+0xbf)[0x80e8e5f]
python(Py_Main+0x4d1)[0x8058e41]
python(main+0x22)[0x8058862]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc)[0xb7e60ebc]
python[0x80587b1]
======= Memory map: ========
08048000-0813f000 r-xp 00000000 08:07 655424 /usr/bin/python2.5
0813f000-08164000 rw-p 000f6000 08:07 655424 /usr/bin/python2.5
08164000-081dd000 rw-p 08164000 00:00 0 [heap]
b7c00000-b7c21000 rw-p b7c00000 00:00 0
b7c21000-b7d00000 ---p b7c21000 00:00 0
b7d23000-b7d2e000 r-xp 00000000 08:05 737554 /lib/libgcc_s.so.1
b7d2e000-b7d2f000 rw-p 0000a000 08:05 737554 /lib/libgcc_s.so.1
b7d2f000-b7d43000 r-xp 00000000 08:07 278720 /usr/lib/python2.5/site-packages/Numeric/_numpy.so
b7d43000-b7d45000 rw-p 00013000 08:07 278720 /usr/lib/python2.5/site-packages/Numeric/_numpy.so
b7d45000-b7d7b000 r-xp 00000000 08:07 132087 /usr/lib/libnetcdf.so.3.6.1
b7d7b000-b7d7c000 rw-p 00035000 08:07 132087 /usr/lib/libnetcdf.so.3.6.1
b7d7c000-b7d7d000 rw-p b7d7c000 00:00 0
b7d7d000-b7d85000 r-xp 00000000 08:07 278713 /usr/lib/python2.5/site-packages/Scientific/linux2/Scientific_netcdf.so
b7d85000-b7d86000 rw-p 00007000 08:07 278713 /usr/lib/python2.5/site-packages/Scientific/linux2/Scientific_netcdf.so
b7d86000-b7d8d000 r--s 00000000 08:07 131864 /usr/lib/gconv/gconv-modules.cache
b7d8d000-b7dc8000 r--p 00000000 08:07 180227 /usr/lib/locale/en_US.utf8/LC_CTYPE
b7dc8000-b7e4b000 rw-p b7dc8000 00:00 0
b7e4b000-b7f86000 r-xp 00000000 08:05 807011 /lib/tls/i686/cmov/libc-2.5.so
b7f86000-b7f87000 r--p 0013b000 08:05 807011 /lib/tls/i686/cmov/libc-2.5.so
b7f87000-b7f89000 rw-p 0013c000 08:05 807011 /lib/tls/i686/cmov/libc-2.5.so
b7f89000-b7f8c000 rw-p b7f89000 00:00 0
b7f8c000-b7fb1000 r-xp 00000000 08:05 807062 /lib/tls/i686/cmov/libm-2.5.so
b7fb1000-b7fb3000 rw-p 00024000 08:05 807062 /lib/tls/i686/cmov/libm-2.5.so
b7fb3000-b7fb5000 r-xp 00000000 08:05 807085 /lib/tls/i686/cmov/libutil-2.5.so
b7fb5000-b7fb7000 rw-p 00001000 08:05 807085 /lib/tls/i686/cmov/libutil-2.5.so
b7fb7000-b7fb8000 rw-p b7fb7000 00:00 0
b7fb8000-b7fba000 r-xp 00000000 08:05 807060 /lib/tls/i686/cmov/libdl-2.5.so
b7fba000-b7fbc000 rw-p 00001000 08:05 807060 /lib/tls/i686/cmov/libdl-2.5.so
b7fbc000-b7fcf000 r-xp 00000000 08:05 807080 /lib/tls/i686/cmov/libpthread-2.5.so
b7fcf000-b7fd1000 rw-p 00013000 08:05 807080 /lib/tls/i686/cmov/libpthread-2.5.so
b7fd1000-b7fd3000 rw-p b7fd1000 00:00 0
b7fe2000-b7fe4000 rw-p b7fe2000 00:00 0
b7fe4000-b7ffd000 r-xp 00000000 08:05 737590 /lib/ld-2.5.so
b7ffd000-b7fff000 rw-p 00019000 08:05 737590 /lib/ld-2.5.so
bfb2c000-bfb42000 rw-p bfb2c000 00:00 0 [stack]
ffffe000-fffff000 r-xp 00000000 ...

Read more...

Changed in python-scientific:
importance: Undecided → Medium
Changed in python-scientific:
assignee: nobody → edoardo-batini
status: Unconfirmed → Confirmed
Revision history for this message
Edoardo Batini (edoardo-batini) wrote :

Python-Scientific NetCDF used PyMem_DEL instead of PyObject_DEL to deallocate memory of an object created with PyObject_NEW.
Python 2.4 used to catch that error and automatically correct it. Python 2.5 has removed this behaviour.

I ask you to test this patch and to let me know if it solved the problem.
Ciao

Revision history for this message
togr (tom-grydeland) wrote : Re: [Bug 113803] Re: Python-netcdf crashes in Feisty

On 5/13/07, eolo999 <email address hidden> wrote:
> Python-Scientific NetCDF used PyMem_DEL instead of PyObject_DEL to deallocate memory of an object created with PyObject_NEW.
> Python 2.4 used to catch that error and automatically correct it. Python 2.5 has removed this behaviour.
>
> I ask you to test this patch and to let me know if it solved the problem.

Thank you! Certainly I will. Could you please point me at a good
description of how this is done with debian-style packages? (I know
how to prepare RPMs from sources, but this Ubuntu box is my first
serious attempt at maintaining a Debian-based distribution)

> Ciao

Best regards,

--
Tom Grydeland
  <Tom.Grydeland@(phys.uit.no|gmail.com)>

Revision history for this message
Edoardo Batini (edoardo-batini) wrote :

First Debdiff :)

Revision history for this message
Edoardo Batini (edoardo-batini) wrote :

Ok this hopefully is a valid debdiff.

Changed in python-scientific:
assignee: edoardo-batini → nobody
Revision history for this message
Scott Kitterman (kitterman) wrote :

Tom,

MOTU is the place to start here. Lots of work and lots of people willing to help you learn how to do it. See https://wiki.ubuntu.com/MOTU. Mostly it's done via the #ubuntu-motu IRC channel.

Revision history for this message
Barry deFreese (bddebian) wrote :

Uploaded for gutsy. Please keep an eye on it. Thank you for your contribution!

Changed in python-scientific:
status: Confirmed → Fix Committed
Changed in python-scientific:
status: Fix Committed → Fix Released
Revision history for this message
togr (tom-grydeland) wrote :

Tested (with good help from Scott K) on feisty, and fixes the above test cases!

Thanks for your great help!

William Grant (wgrant)
Changed in python-scientific:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote :

Made a feisty-proposed version and tested that it corrects the problem. Uploaded and waiting for the archive admins to publish it for testing.

Changed in python-scientific:
assignee: nobody → kitterman
status: Confirmed → In Progress
Revision history for this message
Emmet Hikory (persia) wrote :

I've unsubscribed ubuntu-universe-sponsors, as it appears that no further sponsoring is required.

Revision history for this message
Scott Kitterman (kitterman) wrote :

A testing version of python-netcdf has landed in feisty-proposed. To test,
please add:

deb http://archive.ubuntu.com/ubuntu/ feisty-proposed universe

to your sources.list(5). Then, update and upgrade (or install) python-netcdf.

Please provide feedback here. We need two reports of works for me before we can publish it to feisty-updates.

Running the following script should no longer crash:

#!/usr/bin/python
from Scientific.IO.NetCDF import *
fname = 'crash.nc'
ncfile = NetCDFFile(fname, 'w', 'Created now by me')

Changed in python-scientific:
status: In Progress → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

python-scientific (2.4.11-1build1.1) feisty-proposed; urgency=low

  * NetCDF file causing invalid pointer error (LP: #113803)
  * Changed maintainer to MOTU
  * Added python-central (>= 0.5) to the build-depends field in debian/control

 -- Scott Kitterman <email address hidden> Sat, 07 Jul 2007 00:41:51 -0400

Changed in python-scientific:
status: Fix Committed → Fix Released
Changed in python-scientific:
status: Fix Released → Fix Committed
Revision history for this message
deadwill (deadwill-deactivatedaccount) wrote :

The update in -proposed works.

Revision history for this message
Ivan Vilata i Balaguer (ivilata) wrote :

The update also works for me wth the script at bug 123949. Thanks.

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to feisty-updates.

Changed in python-scientific:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.