Ticket #665 (closed defect: fixed)

Opened 2 years ago

Last modified 22 months ago

Compiler crash on if(!x)

Reported by: hoytak Owned by: somebody
Priority: minor Milestone: 0.15
Component: Error Reporting Keywords:
Cc:

Description

The following (wrong) code fragment crashes the compiler:

if(!okay):
    pass

)switching between C++ and cython too many times led to this bug.)

The compiler crashes with the following traceback:

Traceback (most recent call last):
  File "/home/hoytak/sysroot/bin/cython", line 8, in <module>
    main(command_line = 1)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 814, in main
    result = compile(sources, options)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 789, in compile
    return compile_multiple(source, options)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 761, in compile_multiple
    result = run_pipeline(source, options)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 625, in run_pipeline
    err, enddata = context.run_pipeline(pipeline, source)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 244, in run_pipeline
    data = phase(data)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 567, in parse
    tree = context.parse(source_desc, scope, pxd = 0, full_module_name = full_module_name)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Compiler/Main.py", line 506, in parse
    tree = Parsing.p_module(s, pxd, full_module_name)
  File "Parsing.py", line 2801, in Cython.Compiler.Parsing.p_module (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:45499)
  File "Parsing.py", line 2816, in Cython.Compiler.Parsing.p_module (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:45293)
  File "Parsing.py", line 1773, in Cython.Compiler.Parsing.p_statement_list (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:29084)
  File "Parsing.py", line 1778, in Cython.Compiler.Parsing.p_statement_list (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:28909)
  File "Parsing.py", line 1692, in Cython.Compiler.Parsing.p_statement (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:28786)
  File "Parsing.py", line 1760, in Cython.Compiler.Parsing.p_statement (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:28512)
  File "Parsing.py", line 1334, in Cython.Compiler.Parsing.p_if_statement (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:22184)
  File "Parsing.py", line 1344, in Cython.Compiler.Parsing.p_if_clause (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:22342)
  File "Parsing.py", line 123, in Cython.Compiler.Parsing.p_test (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4303)
  File "Parsing.py", line 144, in Cython.Compiler.Parsing.p_or_test (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4526)
  File "Parsing.py", line 147, in Cython.Compiler.Parsing.p_rassoc_binop_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4582)
  File "Parsing.py", line 158, in Cython.Compiler.Parsing.p_and_test (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4772)
  File "Parsing.py", line 160, in Cython.Compiler.Parsing.p_and_test (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4736)
  File "Parsing.py", line 147, in Cython.Compiler.Parsing.p_rassoc_binop_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4582)
  File "Parsing.py", line 164, in Cython.Compiler.Parsing.p_not_test (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4925)
  File "Parsing.py", line 170, in Cython.Compiler.Parsing.p_not_test (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4885)
  File "Parsing.py", line 176, in Cython.Compiler.Parsing.p_comparison (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:4975)
  File "Parsing.py", line 200, in Cython.Compiler.Parsing.p_starred_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:5285)
  File "Parsing.py", line 242, in Cython.Compiler.Parsing.p_bit_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:5742)
  File "Parsing.py", line 78, in Cython.Compiler.Parsing.p_binop_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:3569)
  File "Parsing.py", line 247, in Cython.Compiler.Parsing.p_xor_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:5785)
  File "Parsing.py", line 78, in Cython.Compiler.Parsing.p_binop_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:3569)
  File "Parsing.py", line 252, in Cython.Compiler.Parsing.p_and_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:5830)
  File "Parsing.py", line 78, in Cython.Compiler.Parsing.p_binop_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:3569)
  File "Parsing.py", line 257, in Cython.Compiler.Parsing.p_shift_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:5875)
  File "Parsing.py", line 78, in Cython.Compiler.Parsing.p_binop_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:3569)
  File "Parsing.py", line 262, in Cython.Compiler.Parsing.p_arith_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:5920)
  File "Parsing.py", line 78, in Cython.Compiler.Parsing.p_binop_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:3569)
  File "Parsing.py", line 267, in Cython.Compiler.Parsing.p_term (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:5965)
  File "Parsing.py", line 78, in Cython.Compiler.Parsing.p_binop_expr (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:3569)
  File "Parsing.py", line 273, in Cython.Compiler.Parsing.p_factor (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:6010)
  File "Parsing.py", line 292, in Cython.Compiler.Parsing._p_factor (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:6305)
  File "Parsing.py", line 354, in Cython.Compiler.Parsing.p_power (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:7124)
  File "Parsing.py", line 571, in Cython.Compiler.Parsing.p_atom (/home/hoytak/sysroot/src/cython/Cython/Compiler/Parsing.c:10381)
  File "Scanning.py", line 360, in Cython.Compiler.Scanning.PyrexScanner.next (Cython/Compiler/Scanning.c:6583)
  File "Scanners.py", line 117, in Cython.Plex.Scanners.Scanner.read (Cython/Plex/Scanners.c:1395)
  File "Scanners.py", line 152, in Cython.Plex.Scanners.Scanner.scan_a_token (Cython/Plex/Scanners.c:1786)
  File "/home/hoytak/sysroot/lib/python2.6/site-packages/Cython/Plex/Errors.py", line 42, in __init__
    self.position = scanner.position()
AttributeError: 'Cython.Compiler.Scanning.PyrexScanner' object has no attribute 'position'

This after commit cad5ced6ec9c2108d4cd31599a76134a98440760 on March 4.

Change History

Changed 22 months ago by scoder

  • status changed from new to closed
  • resolution set to fixed
  • component changed from Parsing to Error Reporting
  • milestone changed from wishlist to 0.15

Closing this as the code that crashes here is gone now.

Note: See TracTickets for help on using tickets.