PCBnew Crashes and corrupts save file

Bug #1843092 reported by Victor W
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Critical
Seth Hillbrand

Bug Description

We're working on a fairly complex board, and using a recent nightly build:

kicad-git-r14152.5e353e896-1-x86_64.pkg.tar.xz

Running pcbnew, it takes around 3min to open the design.

We noticed that it started taking a really long time to save the design. In one instance, it completely crashed (program exited) while saving a file. When we subsequently tried to open the file, it was corrupted.

We reverted back to an older kicad version;

kicad-git-r14041.a0ed40876-1-x86_64.pkg.tar.xz

And checked out the file to a previous version. However, despite reverting backwards, we're still seeing saves take a long time, relative to how long they took prior to updating kicad.

Tags: pcbnew
Revision history for this message
Ian McInerney (imcinerney) wrote :

Victor, can you please include the version information from the About dialog (there is a copy version information button you can use) for the versions you are using.

Also, what do you mean by complex? It would help if you could provide a sample that demonstrates this problem.

Changed in kicad:
status: New → Incomplete
tags: added: pcbnew
Revision history for this message
Victor W (vicw) wrote :

Dear Ian,

Application: KiCad
Version: (5.1.0-1541-ga0ed40876), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.1 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.1.1) libssh2/1.8.1 nghttp2/1.36.0
Platform: Linux 5.0.9-arch1-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.1
    Compiler: GCC 8.3.0 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Victor W (vicw) wrote :

Unfortunately, I'm not able to post an example of the design, but I have privately submitted a copy of the design to a dev.

Seth Hillbrand (sethh)
Changed in kicad:
status: Incomplete → In Progress
importance: Undecided → Critical
assignee: nobody → Seth Hillbrand (sethh)
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Your build seems quite old (a0ed40876 was committed 15th Aug). Can you update to the latest nightly and retest? It may have already been fixed.

Revision history for this message
Victor W (vicw) wrote :

Sure, I'm updating now, and I should have test results for you in the morning.

Revision history for this message
Victor W (vicw) wrote :

Using the latest build (see below), we no longer observe the crashes. However, we continue to observe a slow down approximately ever 20min.

Previously, pcbnew would crash when this happened, but now it eventually recovers, after around a minute. In addition, we notice that saving files also takes considerably longer.

Application: Pcbnew
Version: (5.99.0-104-g2b387f4b4), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.1 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.1.1) libssh2/1.8.1 nghttp2/1.36.0
Platform: Linux 5.0.9-arch1-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.1
    Compiler: GCC 8.3.0 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Seth Hillbrand (sethh) wrote :

@Victor- Can you tell me what your autosave time is set to?

Revision history for this message
Victor W (vicw) wrote :

Autosave time is set for 10min. It looks like the slow downs happen every 15-20min. We're trying to track this down now, by adjusting the autosave time and seeing if that makes it happen more often.

Revision history for this message
Madeliene Kattman (katm) wrote :

@Seth- The autosave time is set to 10 minutes, however I don't see the backup file notification on the bottom bar after the freeze. I have set the auto save to five minutes to see if it occurs more frequently, as well as time the intervals of the freezing.

Revision history for this message
Victor W (vicw) wrote :

We've just confirmed that the slowdown is correlated to the auto-save time: Adjusting the autosave time down to 5min means we see these slowdowns every 5min.

Interestingly, as Madeliene noted, we don't see the back file notification dialog that would normally be present. She also notes that there wasn't previously such a severe delay when saving - it looks like the file saving process somehow got slower.

Revision history for this message
Seth Hillbrand (sethh) wrote :

Thanks for the additional data points.

I can confirm that the save process is noticeably longer on complex boards, so I can address that.

The crash issue may be correlated with the slowdown but I cannot recreate the crash, so I am not 100% certain on that. Once I track down the save slowdown, we have a better sense of whether it is, in fact the same.

Revision history for this message
Madeliene Kattman (katm) wrote :

We found an additional data point:

Here's how we reproduce it:

1. Save the design in Pcbnew by clicking the save button.

2. Wait for the save to complete.

3. Close the PCBnew window

4. Try and close the main kicad screen.

We expect it to close, but instead, it freezes.

This ONLY happens on large designs; when we do this using smaller designs, it does not happen.

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Madeliene, is the project located on a network share? There have been some reports in the past about intermittent crashes/hangs when saving to network shares (see here: https://bugs.launchpad.net/kicad/+bug/1838209).

Revision history for this message
Victor W (vicw) wrote :

@Ian,

All our designs saved on a local SSD, and we use git for version control.

Best Regards,

vvv

Seth Hillbrand (sethh)
Changed in kicad:
milestone: none → 6.0.0-rc1
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 7f54617dab046f7b9b89cf2d000f4f04ae798eab
https://git.launchpad.net/kicad/patch/?id=7f54617dab046f7b9b89cf2d000f4f04ae798eab

Changed in kicad:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.