This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python throws an error when unpacking bz2 file
Type: crash Stage: test needed
Components: Extension Modules Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: alanmcintyre, georg.brandl, runnig
Priority: normal Keywords:

Created on 2007-05-08 08:23 by runnig, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (8)
msg31980 - (view) Author: runnig (runnig) Date: 2007-05-08 08:23
C:\work\python>c:\work\python\25\py.exe
Python 2.5 (r25:51908, Feb 13 2007, 14:33:20) [MSC v.1400 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
C:\work\python>ez_setup.py wxpython
Searching for wxpython
Reading http://cheeseshop.python.org/pypi/wxpython/
Couldn't find index page for 'wxpython' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://cheeseshop.python.org/pypi/
Reading http://cheeseshop.python.org/pypi/wxPython/2.6.3.2
Reading http://wxPython.org/
Reading http://wxPython.org/download.php
Best match: wxPython src-2.8.3.0
Downloading http://prdownloads.sourceforge.net/wxpython/wxPython-src-2.8.3.0.tar.bz2
Processing wxPython-src-2.8.3.0.tar.bz2


I think, when unpacking bz2, an error occurs and windows shows an error about 
"python.exe has encountered a problem and needs to close"
msg31981 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-05-13 07:54
Can you try to take the .tar.bz2 file and unpack it yourself using Python's bz2 module?
We can then find out where exactly the segfault occurs.
msg31982 - (view) Author: Alan McIntyre (alanmcintyre) * (Python committer) Date: 2007-05-14 16:53
I downloaded the file from the URL given above, and when I tried to decompress it in a single shot (with bz2.decompress), python crashes.  Reading the raw bz2 data from file into a string in memory works ok, but attempting to use bz2.decompress on that data causes the crash.

I could only get this to happen under 2.5.1 on a Windows XP machine (media center edition); it seems to work ok on OSX (Python 2.5) and Linux (both 2.4.4 and the current trunk).  I will be able to take a closer look at this tomorrow when I have access to a Windows machine with a compiler on it.

msg31983 - (view) Author: Alan McIntyre (alanmcintyre) * (Python committer) Date: 2007-05-16 02:34
Well, this problem doesn't seem to occur on my Windows XP Pro (SP2) machine for 2.5.1 (both the "official" build and one I built locally).  It's going to be a week or two before I'll be able to get back to the one machine on which it crashes.  If the original poster can provide any additional information (crash logs, etc) before then I'll try to have a look.
msg31984 - (view) Author: runnig (runnig) Date: 2007-05-16 04:54
i've downloaded file wxPython-src-2.8.4.0.tar.bz2 manually and wrote a test script:
----------
import bz2

arch = bz2.BZ2File( 'wxPython-src-2.8.4.0.tar.bz2','r' )
lines = arch.readlines()
----------
as i can understand, python crashes right after start of reading this bz2 file
msg31985 - (view) Author: Alan McIntyre (alanmcintyre) * (Python committer) Date: 2007-05-30 16:09
I managed to make this crash happen by loading up the computer with memory-intensive processes and then running the test script provided by the original poster repeatedly.  The crash report seems to indicate an attempt to dereference a NULL pointer somewhere in the bz2 library, but I haven't had time to dig any further to find out where this happens (I'm guessing a memory allocation call is missing a follow-up NULL check).  

This was done with a standard install of 2.5 on a Windows XP Media Edition laptop.  I'll post more when I get time to play with this again.
msg31986 - (view) Author: runnig (runnig) Date: 2007-05-30 23:47
I can try to figure this out if you can tell me the way :) 
I've got vc8 installed and lots developer tools. Actually I tried to compile python on my machine, after that run tests and bz2 test also failed that time...
msg84891 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-03-31 20:29
This was apparently fixed sometime in trunk.
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 44943
2009-03-31 20:29:42georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg84891
2009-03-30 16:49:54ajaksu2setstage: test needed
type: crash
components: + Extension Modules, - None
versions: + Python 2.6, - Python 2.5
2007-05-08 08:23:05runnigcreate