Issue340

Title build fails on "await super().mycoro()"
Priority bug Status resolved
Superseder Nosy List fussel, kayhayen
Assigned To kayhayen Keywords compiler_crash

Created on 2016-11-17.16:06:21 by fussel, last changed by kayhayen.

Messages
msg2201 (view) Author: kayhayen Date: 2017-07-19.17:50:41
This has been released as stable.
msg2081 (view) Author: kayhayen Date: 2016-11-22.09:10:33
Hello Martin,

I would be OK with you waiting for the Issue#341 solution, I am pretty much 
convinced this should be better now, but with that issue, I plan to make the 
hotfix that is all good. Both issues are about compiled coroutine compatibility.

Yours,
Kay
msg2080 (view) Author: fussel Date: 2016-11-22.09:07:58
Hello Kay,

even though I am not that deep into your tree building, I am sure, that your fix
will solve the issue. I will test it as soon as possible.

Best Regards,

Martin
msg2075 (view) Author: kayhayen Date: 2016-11-18.06:00:11
The obvious code fix leads to a compiler warning of mismatch for __cell__ 
variable and subsequently a crash, trying to execute that. That is because in 
tree building, "has_super" flag is not considered for couroutines, which is of 
course a bug.

I am pushing the change through my buildbots and on the factory branch soon. 
Your example code seemed to compile and didn't crash anymore, so I think it 
ought to be good, but it's not used of course.

Yours,
Kay
msg2070 (view) Author: fussel Date: 2016-11-17.16:06:21
The following code compilation will fail (Py 3.5.2 @ win7 x64) with nuitka
0.5.25rc2 and below


class Parent():
    async def mycoro(self)
        return True

class Child(Parent):

    def __init__(self)
        asyncio.ensure_future(self.mycoro())
        asyncio.get_loop().run_forever

    async def mycoro(self)
        
        # this fails
        myflag = await super().mycoro()
        
        # this will compile happily
        myflag = await Parent.mycoro(self)


The trace is:

Traceback (most recent call last):
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Scripts\nuitka"
, line 193, in <module>
    MainControl.main()
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\MainControl.py", line 702, in main
    filename = filename
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\MainControl.py", line 101, in createNodeTree
    Optimization.optimize()
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\Optimization.py", line 391, in optimize
    finished = makeOptimizationPass(False)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\Optimization.py", line 358, in makeOptimizationPass
    changed = optimizeModule(current_module)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\Optimization.py", line 156, in optimizeModule
    changed = optimizeCompiledPythonModule(module)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\Optimization.py", line 92, in optimizeCompiledPythonModu
le
    module.computeModule()
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\ModuleNodes.py", line 418, in computeModule
    trace_collection = self.trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\StatementNodes.py", line 165, in computeStatementsSequence
    trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\FrameNodes.py", line 195, in computeStatementsSequence
    statement = statement
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 566, in onStatement
    statement.computeStatement(self)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\TryNodes.py", line 128, in computeStatement
    trace_collection = trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\StatementNodes.py", line 169, in computeStatementsSequence
    statement = statement
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 566, in onStatement
    statement.computeStatement(self)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\AssignNodes.py", line 155, in computeStatement
    trace_collection.onExpression(self.getAssignSource())
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\NodeBases.py", line 1198, in computeExpressionRaw
    expression = sub_expression
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\NodeBases.py", line 1198, in computeExpressionRaw
    expression = sub_expression
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\FunctionNodes.py", line 828, in computeExpressionRaw
    trace_collection = function_body.trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\StatementNodes.py", line 169, in computeStatementsSequence
    statement = statement
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 566, in onStatement
    statement.computeStatement(self)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\AssignNodes.py", line 155, in computeStatement
    trace_collection.onExpression(self.getAssignSource())
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\NodeBases.py", line 1198, in computeExpressionRaw
    expression = sub_expression
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\FunctionNodes.py", line 828, in computeExpressionRaw
    trace_collection = function_body.trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\StatementNodes.py", line 169, in computeStatementsSequence
    statement = statement
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 566, in onStatement
    statement.computeStatement(self)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\TryNodes.py", line 128, in computeStatement
    trace_collection = trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\StatementNodes.py", line 169, in computeStatementsSequence
    statement = statement
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 566, in onStatement
    statement.computeStatement(self)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\ReturnNodes.py", line 52, in computeStatement
    trace_collection.onExpression(self.getExpression())
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\NodeBases.py", line 1198, in computeExpressionRaw
    expression = sub_expression
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\FunctionNodes.py", line 828, in computeExpressionRaw
    trace_collection = function_body.trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\StatementNodes.py", line 169, in computeStatementsSequence
    statement = statement
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 566, in onStatement
    statement.computeStatement(self)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\TryNodes.py", line 128, in computeStatement
    trace_collection = trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\StatementNodes.py", line 165, in computeStatementsSequence
    trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\FrameNodes.py", line 195, in computeStatementsSequence
    statement = statement
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 566, in onStatement
    statement.computeStatement(self)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\AssignNodes.py", line 155, in computeStatement
    trace_collection.onExpression(self.getAssignSource())
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\NodeBases.py", line 1198, in computeExpressionRaw
    expression = sub_expression
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\NodeBases.py", line 1198, in computeExpressionRaw
    expression = sub_expression
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\NodeBases.py", line 1198, in computeExpressionRaw
    expression = sub_expression
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\TraceCollections.py", line 524, in onExpression
    trace_collection = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\NodeBases.py", line 1219, in computeExpressionRaw
    trace_collection = trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\CallNodes.py", line 196, in computeExpression
    trace_collection = trace_collection
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\nodes\BuiltinRefNodes.py", line 122, in computeExpressionCall
    called    = self
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\OptimizeBuiltinCalls.py", line 1230, in computeBuiltinCa
ll
    new_node = _dispatch_dict[builtin_name](call_node)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\OptimizeBuiltinCalls.py", line 1063, in super_extractor
    builtin_spec  = BuiltinOptimization.builtin_super_spec
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\BuiltinOptimization.py", line 431, in extractBuiltinArgs

    source_ref = node.getSourceReference()
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\Builtins.py", line 205, in wrapper
    return f(*args, **new_kw)
  File "C:\eigene\entwicklung\app\frameworks\python\python35_x64\Lib\site-packag
es\nuitka\optimizations\OptimizeBuiltinCalls.py", line 1025, in wrapSuperBuiltin

    if parameter_provider.getParameters().getArgumentCount() > 0:
AttributeError: 'ExpressionCoroutineObjectBody' object has no attribute 'getPara
meters'
History
Date User Action Args
2017-07-19 17:50:41kayhayensetstatus: testing -> resolved
messages: + msg2201
2016-11-22 09:10:33kayhayensetmessages: + msg2081
2016-11-22 09:07:58fusselsetmessages: + msg2080
2016-11-18 06:00:11kayhayensetstatus: unread -> testing
assignedto: kayhayen
messages: + msg2075
keyword: + compiler_crash
nosy: + kayhayen
2016-11-17 16:06:21fusselcreate