Issue140

Title Compiler crash in matplotlib module
Priority bug Status resolved
Superseder Nosy List bosmart, kayhayen
Assigned To kayhayen Keywords compiler_crash

Created on 2014-07-03.16:54:31 by bosmart, last changed by kayhayen.

Messages
msg705 (view) Author: kayhayen Date: 2014-07-11.08:15:20
This has been released already.
msg697 (view) Author: kayhayen Date: 2014-07-03.18:45:15
The issue is indeed like this, try/finally statements were saying they only 
needed frames when they raise, where in fact, they should say they need it, if 
on their blocks need it.

Also matplotlib is on Debian installed to yet another location 
"/usr/lib/pymodules", where there is a few other things as well. I am just 
running the library compilation test on it, to see if it reveals more things.

I am going to make a hotfix out of it, on git factory branch there is the fix to 
it already.
msg696 (view) Author: kayhayen Date: 2014-07-03.17:38:10
I reproduced the issue. This code triggers it:

def is_numlike(obj):
    try:
        obj
    except:
        return False
    else:
        return True

It's related to the exception restoration that is in the re-formulation of 
try/except, which leaves a exception restoration behind, without a frame being 
present.

That should not occur. When tracing it, I don't see the frame being optimized 
away, so there is at least a trace of that missing. And then it's being made too 
small.
msg695 (view) Author: bosmart Date: 2014-07-03.16:54:31
Nuitka:WARNING:Problem with statement at <SourceCodeReference to c:\Python27\Lib\site-
packages\matplotlib\cbook.py:711>:
Nuitka:WARNING:Problem with statement at <SourceCodeReference to c:\Python27\Lib\site-
packages\matplotlib\cbook.py:711>:
Nuitka:WARNING:Problem with statement at <SourceCodeReference to c:\Python27\Lib\site-
packages\matplotlib\cbook.py:711>:
Nuitka:WARNING:Problem with statement at <SourceCodeReference to c:\Python27\Lib\site-
packages\matplotlib\cbook.py:709>:
Traceback (most recent call last):
  File "c:\Python27\Scripts\nuitka", line 147, in <module>
    MainControl.main()
  File "c:\Python27\Lib\site-packages\nuitka\MainControl.py", line 626, in main
    filename = filename
  File "c:\Python27\Lib\site-packages\nuitka\MainControl.py", line 100, in 
createNodeTree
    Optimization.optimize()
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\Optimization.py", line 175, 
in optimize
    changed = optimizePythonModule(current_module)
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\Optimization.py", line 117, 
in optimizePythonModule
    module = module
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\Optimization.py", line 68, 
in _optimizeModulePass
    module        = module
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 743, in __init__
    constraint_collection = self
  File "c:\Python27\Lib\site-packages\nuitka\nodes\StatementNodes.py", line 186, in 
computeStatementsSequence
    constraint_collection
  File "c:\Python27\Lib\site-packages\nuitka\nodes\StatementNodes.py", line 359, in 
computeStatementsSequence
    statement = statement
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 521, in onStatement
    statement.computeStatement(self)
  File "c:\Python27\Lib\site-packages\nuitka\nodes\AssignNodes.py", line 85, in 
computeStatement
    constraint_collection.onExpression(self.getAssignSource())
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 406, in onExpression
    constraint_collection = self
  File "c:\Python27\Lib\site-packages\nuitka\nodes\NodeBases.py", line 990, in 
computeExpressionRaw
    expression = sub_expression
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 406, in onExpression
    constraint_collection = self
  File "c:\Python27\Lib\site-packages\nuitka\nodes\FunctionNodes.py", line 592, in 
computeExpressionRaw
    function_body = function_body
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 643, in __init__
    constraint_collection = self
  File "c:\Python27\Lib\site-packages\nuitka\nodes\StatementNodes.py", line 190, in 
computeStatementsSequence
    statement = statement
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 521, in onStatement
    statement.computeStatement(self)
  File "c:\Python27\Lib\site-packages\nuitka\nodes\TryNodes.py", line 149, in 
computeStatement
    constraint_collection = constraint_collection
  File "c:\Python27\Lib\site-packages\nuitka\nodes\StatementNodes.py", line 190, in 
computeStatementsSequence
    statement = statement
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 521, in onStatement
    statement.computeStatement(self)
  File "c:\Python27\Lib\site-packages\nuitka\nodes\TryNodes.py", line 565, in 
computeStatement
    branch = self.getExceptionHandling()
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 593, in __init__
    constraint_collection = self
  File "c:\Python27\Lib\site-packages\nuitka\nodes\StatementNodes.py", line 190, in 
computeStatementsSequence
    statement = statement
  File "c:\Python27\Lib\site-packages\nuitka\optimizations\ConstraintCollections.py", 
line 521, in onStatement
    statement.computeStatement(self)
  File "c:\Python27\Lib\site-packages\nuitka\nodes\StatementNodes.py", line 497, in 
computeStatement
    if self.getParentStatementsFrame().needsExceptionFramePreservation():
AttributeError: 'NoneType' object has no attribute 'needsExceptionFramePreservation'
History
Date User Action Args
2014-07-11 08:15:21kayhayensetstatus: testing -> resolved
messages: + msg705
2014-07-03 18:45:15kayhayensetstatus: in-progress -> testing
messages: + msg697
2014-07-03 17:38:10kayhayensetstatus: unread -> in-progress
keyword: + compiler_crash
title: AttributeError: 'NoneType' object has no attribute 'needsExceptionFramePreservation' -> Compiler crash in matplotlib module
nosy: + kayhayen
messages: + msg696
assignedto: kayhayen
2014-07-03 16:54:31bosmartcreate