PCBNew doesn't close

Bug #1852082 reported by Robert on 2019-11-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Often when I close PCBNew the window and taskbar icon disappear, but PCBNew continues to run. It then becomes impossible to open the layout again, because KiCad thinks the layout is already open. Well yes, it may well be open, but it's not visible. The only workaround I know of is to kill pcbnew.exe with the task manager. However, it can then prove difficult or impossible to restart PCBNew, sometimes necessitating restarting Windows to restore normal operation (there may be a less drastic workaround, such as killing a stuck executable, but I haven't found it as yet).

Running on Windows 10, despite what it says below.

Application: Pcbnew
Version: (5.1.4)-1, release build
    wxWidgets 3.0.4
    libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:

Rene Poeschl (poeschlr) wrote :

Disclaimer: not a dev had a similar experience while running KiCad in a virtual machine.

It might be that you require a bit of patience here. I think the footprint cache is written when closing pcbnew which depending on your setup might take a while. Try to close pcbnew and wait for a while (a few minutes). If the same problem persists then try to delete the footprint cache (in the project directory). please report back if any of these things allow pcb new to open normally.

Ian McInerney (imcinerney) wrote :

Do you see this slowdown for all boards you work with or just a few? Are your files being stored on a network storage device or locally on your machine?

The footprint cache file can cause long closing time for Pcbnew, especially if it is being stored on a drive that has a very long access time (such as over the network). Another cause can be exiting Pcbnew after working on a complex board. Clearing all the board objects from memory can take a while, which can slow down the Pcbnew close times. There has been some work in the v6 development version to try to overcome the slowdown due to complex boards though, so v6 should hopefully perform better.

tags: added: pcbnew
Robert (birmingham-spider) wrote :

The file store is an internal SATA disk drive on a fast PC. If it is a delay rather than a complete halt, it is lengthy (minutes). I can copy my entire footprint library in a tiny fraction of that time using copy and paste in file manager. The "loading footprints" dialog (on opening the footprint editor) displays for about two seconds. Next time I see this behaviour, I'll go away and make a cup of tea to give it more time to close, and report back.

If I open the task manager so it displays pcbnew.exe, and then switch to PCBNew and close it, ordinarily pcbnew.exe disappears out of the task manager almost instantly.

This is my first board with KiCad 5. I've not seen the same behaviour with KiCad 4 on this PC. It is not a complex board. That said, I notice zone "checking" (whatever that is) is painfully slow (45 seconds!), but zone filling is instant. This may be due to my using small priority 1 zones on top of a priority 0 ground plane, but I haven't had the time to check that, and I can't imagine this being a related issue.

Rene Poeschl (poeschlr) wrote :

please keep this report for one issue only. The zone recalculation speed should go into a separate report.


Also the fact that you write to a sata disc does not guarantee the fp cache to be generated fast. If kicad thinks the footprints have diverted significantly then the whole cache is rebuild which can take some time depending on how many libs and footprints you have (even with fast hardware) It is just more noticeable with slow hardware. Maybe check if the fp cache is changing while pcb new is behaving this strangely (not sure if your operating system has a way for a user to check directly if a process touches a file right now. Otherwise you are limited to seeing changes to its file size or updates to its modified date)


If the fp cache is not to blame then there is some other issue at hand. (fp cache is just the first thing that comes to mind as it is something that can lock up closing of pcbnew)

Robert (birmingham-spider) wrote :

I'm not attempting to raise a second problem in this report, but Ian said that a "complex board" could cause the problem with closing PCBNew. What constitutes a "complex board"? Lots of footprints? Lots of vias? Lots of layers? Or maybe a less than straightforward arrangement of zones that is apparently resulting in PCBNew getting bogged down in computation. Otherwise the board is quite simple, with just four layers and not many components.

You may be on the right track with the footprint cache, as I have been editing footprints a lot (to update them with STEP models). I'll check that out. Even so, if this is the issue and PCBNew just needs more time to close, the effect seems pretty extreme. What if I was doing the same with a board with a lot of components? And wouldn't my killing the process corrupt something? I've not seen any corruption.

Robert (birmingham-spider) wrote :

OK, I've had a copy of pcbnew.exe running in task manager for a good hour now with no window and no task-bar icon. It's using 92MB of memory, suggesting it has not gone very far down the path of closing.

Jeff Young (jeyjey) wrote :

It certainly sounds like it's hanging, rather than just being slow....

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers