Ticket #216 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Exceptions in __Pyx_InitGlobals() lead to a crash

Reported by: scoder Owned by: robertwb
Priority: major Milestone: 0.11.3
Component: Code Generation Keywords:
Cc:

Description

When an exception is raised in __Pyx_InitGlobals(), __pyx_m is not yet initialised, so this line in __Pyx_AddTraceback() crashes:

    py_globals = PyModule_GetDict(__pyx_m);

The same applies to the creation of __pyx_empty_tuple.

A fix might be to move __Pyx_InitGlobals() and friends after the module object creation, or to provide a separate error label for early errors.

BTW, I wonder if __pyx_m leaks in case of an error.

Change History

Changed 4 years ago by scoder

  • priority changed from major to critical

Changed 4 years ago by scoder

The leaking of pyx_m should be fixed now. However, it needs to be rethought for tickets #173 and #218 anyway (PEP 3121).

Changed 4 years ago by scoder

  • priority changed from critical to major
  • milestone changed from 0.11.1 to 0.11.2

Changed 4 years ago by dagss

  • milestone changed from 0.11.2 to 0.11.3

Changed 4 years ago by robertwb

  • owner changed from somebody to robertwb

Changed 4 years ago by robertwb

I'm not too worried about memory leaks--it's not something that's going to happen again and again, and we'd be leaking all the globals that got initialized up to that point anyways.

I both moved __Pyx_InitGlobals() later and provided different error handling code when __pyx_m is not yet initialized.

Changed 4 years ago by robertwb

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.