How to debug crash after library work? (Win 10, v6.99)

After doing some library work, I have managed to make my KiCad crash. I am about to reinstall KiCad to see if that fixes it, but I thought I would hold off on that in case there might be some useful information for the devs.

The main application opens, I can create new / open existing projects, I can open schematics, but as soon as I want to add a symbol to the schematic (and the libraries are being attempted to load) - depending on some ‘things’ I did, see below - the application crashed with either a ‘attempt to write at memory address error’ (didn’t get a screenshot of that one), no error at all, or an ‘invalid project file’ error.
prj

Note the cut-off path. The full path for this project is:
D:\Sync\Sync - Projects\PRJ-ZZZ - KiCad Simulation\PRJ-ZZZ - KiCad Simulation.kicad_pro

I currently have no symbol libraries in my symbol library table for debugging purposes, but it still crashes. As I managed to break my KiCad after doing some library work, I thought I would start looking for clues there as everything worked normally before.

All I can describe with respect to what I’ve done to end up in this mess is the following.

[ Stable situation ]
Add the ‘pspice.lib’ and ‘Simulation_SPICE.lib’ symbol libraries to my library table.

[ Oh wait, I have to note this down - These libraries are from the official symbol libraries, but they are an older format: .lib vs .kicad_sym ], might be a clue…

Create a new symbol library for personal use, copy required symbols from the aforementioned libraries to my own library.

Create a new project so I can do some simulation work with my new symbols in my new library.

[ Arrived at unstable situation ]

Now I came to the point where KiCad would either crash without any error windows, or the ‘attempted to write at memory address error’, or the ‘invalid project file error’.

I can’t remember the exact combination, but it was combinations of toggling the ‘active’ checkbox for the pspice.lib / Simulation_SPICE.lib / mylibrary.kicad_sym, and deleting the library entries which caused me to ‘toggle’ between the different errors/crashes.

Any other info I can provide? Any ideas how I can further pinpoint where this problem is coming from? I will hold off on reinstalling KiCad. If anything, I feel like the cut-off path from the error message is useful to fix, at least.

Thanks for any input :slight_smile:

Version info: Application: KiCad (64-bit)

Version: (6.99.0-2202-g8f1b2acdc6), release build

Libraries:
wxWidgets 3.1.7
FreeType 2.11.1
HarfBuzz 4.2.0
FontConfig 2.14.0
libcurl/7.83.1-DEV Schannel zlib/1.2.12

Platform: Windows 10 (build 19044), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Jun 21 2022 09:41:36
wxWidgets: 3.1.7 (wchar_t,wx containers)
Boost: 1.79.0
OCC: 7.6.0
Curl: 7.83.1-DEV
ngspice: 37
Compiler: Visual C++ 1929 without C++ ABI

Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON

I’ve re-added all the symbol libraries (this includes my ‘stable situation libraries’ and the newly created ‘simulation’ library, but none of the official libraries) and now I get the memory error.

crash

Note sure how useful the addresses are, I guess I need to use a debugger for that but it’s been almost 20 years since I’ve last used OllyDbg :slight_smile:

There’s an instruction on how to use WinDBG.

Can be debugged in Visual Studio similarly.

Thanks for the link, I managed to get it running (though the .zip of the PDB files could not get extracted with winrar or windows’ built in tool :thinking: but 7zip did the trick).

I am aware of the risks of the nightly builds. I just felt like it was worth reporting here as I just stumbled upon multiple ‘esoteric’ things simultaneously at play here, which might be worth having fixed to improve the stability.

I appreciate the comment and help nonetheless - I’ll do my best to file a proper report, or do you suggest I file separate bug reports (one for the cut-off path and one for the memory crash?)

I think the error with a space in path is due to kicad not saving/restoring the session, or not passing command line arguments properly somewhere after a crash.

They should be filed separately.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.