Bug 1060338

Summary: marshal.load hangs reading a .pyc file
Product: [Fedora] Fedora Reporter: Michael K Johnson (@SAS) <Michael.Johnson>
Component: python3Assignee: Bohuslav "Slavek" Kabrda <bkabrda>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 20CC: amcnabb, bkabrda, mstuchli, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: python3-3.3.2-11.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-15 15:20:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
test case that reproduces the error none

Description Michael K Johnson (@SAS) 2014-01-31 20:47:05 UTC
Created attachment 857969 [details]
test case that reproduces the error

Description of problem:

While attempting to parse modules with modulefinder, when
modulefinder.ModuleFinder.load_module calls marshal.load(),
marshal.load() hangs consuming 100% CPU continually trying
to read:

...
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
...

Version-Release number of selected component (if applicable):

# rpm -q python3 python3-slip
python3-3.3.2-8.fc20.x86_64
python3-slip-0.6.0-1.fc20.noarch

How reproducible:

100%

Steps to Reproduce:
1. Install python3-slip
2. download the attached t.py file
3. python3 t.py

Actual results:

Python process consumes 100% CPU in loop.

Expected results:

Process completes without error.

Comment 1 Bohuslav "Slavek" Kabrda 2014-02-26 09:50:43 UTC
This is caused by ModuleFinder.load_module skipping a wrong number of bytes in the pyc file (it's skipping 8, but it should be skipping 12 since Python 3.3). I reported it at [1] with a patch, let's see what the upstream thinks about it.

[1] http://bugs.python.org/issue20778

Comment 2 Michael K Johnson (@SAS) 2014-02-26 15:05:34 UTC
Good hunting!

I don't know whether you want to release the fix for this in an update; at least, I doubt it's worth an update only to fix this issue.

From my perspective as the reporter, closing it as upstream would be a reasonable response, if you want to.

Comment 3 Bohuslav "Slavek" Kabrda 2014-02-27 06:51:48 UTC
(In reply to Michael K Johnson from comment #2)
> Good hunting!
> 
> I don't know whether you want to release the fix for this in an update; at
> least, I doubt it's worth an update only to fix this issue.
> 
> From my perspective as the reporter, closing it as upstream would be a
> reasonable response, if you want to.

Thanks :)
I'll wait to see how this gets fixed in upstream (my patch/different patch) and then I'll fix in F20 + rawhide.

Comment 4 Fedora Update System 2014-03-05 10:01:45 UTC
python3-3.3.2-11.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/python3-3.3.2-11.fc20

Comment 5 Fedora Update System 2014-03-06 08:20:37 UTC
Package python3-3.3.2-11.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python3-3.3.2-11.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-3505/python3-3.3.2-11.fc20
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2014-03-15 15:20:12 UTC
python3-3.3.2-11.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.