Open ashkanr65 opened 5 months ago
I need more information. Like what kind of libraries you use and what exactly you're doing. Plus I need a test case to debug the issue. This crash dump does not tell at lot.
In case you develop PCell code, I recommend not using the IDE. IDE + PCell execution + Layout work are not a stable combination. There are too many interactions between UI events, IDE breakpoints, Python or Ruby object management and layout editor operation. To fix this, I'd need to separate the IDE into a different process among other things, which is a too big project to start now.
Matthias
I created a folder named ‘tech’ in the Klayout directory. I placed my Pcells there. While I use VScode to edit my Pcells, I rely on the Klayout IDE to rerun the code. The process involves running the Pcell code first and then executing the library generator code. This error doesn’t occur every time; it’s relatively rare, happening perhaps 1 in 10 instances. Unfortunately, I’m unsure how to reproduce it, as it seems to occur randomly. However, it’s more likely to happen when I place 3 or 4 generated cells into a layout, refresh one cell, and then run the library generator.
I think I understand.
The problem with re-running a script inside KLayout is basically the following: a script will usually redefine classes that are potentially connected to life layout objects. This is like cutting off the branch of a tree you sit on. As we are crossing the script/C++ boundary with their fundamentally different object lifetime management concepts, this interaction gets very difficult to manage.
The situation is much different between Python and Ruby because Ruby uses a different memory management model, and the problem may show up differently in different Python versions.
I am trying to prevent these problems when I come across one during debugging, but there is an inherent instability in the whole scheme and such debugging sessions are very time consuming. The trace of events can usually only be tracked inside a debugger and a stack trace alone is of little help. I have not had serious issues myself recently, but I am not doing frequent PCell development.
You can try mitigating the issue somewhat by turning off the debugger in the IDE.
I'm afraid, the only safe option as of now is to restart KLayout every time you try out a new PCell implementation.
Matthias
I am trying to improve the situation continuously (right now, in fact), but I am afraid, this ticket will never really be solved.
Can I close this ticket?
Thanks,
Matthias
Yes you can. BTW, thank you for your all hardworks
Hi, I receive this error on Klayout 0.29.0: Exception code: 0xc0000005 Program Version: KLayout 0.29.0 (2024-03-31 red486a687) AMD64
It appears after I refresh my libraries several times.