Project

Profile

Help

Bug #6564

open

Debug with breakpoint crashes

Added by Yannick Einsweiler 2 months ago. Updated 6 days ago.

Status:
In Progress
Priority:
Normal
Category:
Saxon-C Internals
Start date:
2024-10-19
Due date:
% Done:

70%

Estimated time:
Applies to branch:
12, trunk
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
12.5
Fixed in version:
SaxonC Languages:
Python
SaxonC Platforms:
Linux
SaxonC Architecture:

Description

On Win11 WSL, with Py 3.12.7, using Pycharm 2024.2.3, I was trying to debug and set breakpoints to step over code. I like to do that to watch variables and try/fix stuff as I go.

Start with a breakpoint on the xml variable line (#9). It breaks. Then step over (F8 in PyCharm Win) the parse_xml() line (#10), and Py (or pydevd) crashes with the infamous: Fatal error: StackOverflowError: Enabling the yellow zone of the stack did not make any stack space available . The same happens if breakpoint is on any line after e.g. return xml

The code runs without issue if not in debug mode.

Interestingly, debugging works just fine in Windows (11) ! So not sure if WSL-specific or a broader Linux issue.

Below a code snippet to help reproduce:


from fastapi import FastAPI
from saxonche import PySaxonProcessor

saxon_proc = PySaxonProcessor(license=False)
app = FastAPI()


@app.get("/")
def get():
    xml = '<root><child>Test</child></root>'
    node = saxon_proc.parse_xml(xml_text=xml)
    xml = node.to_string()
    return xml


if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app)

Please register to edit this issue

Also available in: Atom PDF