Loading from cache lib fails if sym-lib-table does not have old reference to original lib

Bug #1740609 reported by Nick Østergaard
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Wayne Stambaugh

Bug Description

Loading from cache lib fails if sym-lib-table does not have old reference to original lib.

I have attached an minimal project to illustrate and test the issues easily. You need to do the following to see the issuse:

1. If you delete the my_switch.lib it will still show up from the cache lib.
2. If you also delete [not deactivate] the my_switch entry from the sym-lib-table SW_Push will not be loaded from the cache library.

I reopened kicad after each step.

This is unexpected. How is the user supposed to recover?

I set the importance to high, because as I see it, this can make users loose their symbols.

Application: kicad
Version: (2017-12-29 revision 93683d002)-master, release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.57.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.28.0
Platform: Linux 4.14.8-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.65.1
    Curl: 7.57.0
    Compiler: GCC 7.2.1 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=OFF
    KICAD_SCRIPTING_MODULES=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

Tags: eeschema
Revision history for this message
Nick Østergaard (nickoe) wrote :
description: updated
Revision history for this message
Oivind Toien (otoien) wrote :

Yes, I can reproduce this in the latest windows nightly.

Interestingly, if I remove/rename the my_switch libraries, copy and rename the cache library to my_switch and add my_switch back in, SW_PUSH will now show up, but clicking it reveals that is is not listed as belonging to my_switch, but to the cache-library! The Edit symbol library associations reveals that my_switch is still listed as the library for SW_PUSH (Of course the cache library should never be referenced directly). Has the format of the cache library files changed in a way that can explain this?

(During the past conversion process there were no problems referencing libraries that were copied and renamed from old cache libraries written with pre sym-lib-table versions of KiCad. I think this possibility still could be useful if it worked).

Changed in kicad:
status: New → Triaged
assignee: nobody → Wayne Stambaugh (stambaughw)
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 03e9f0c94a5423707d46da90e2bdbd385ab96d57
https://git.launchpad.net/kicad/patch/?id=03e9f0c94a5423707d46da90e2bdbd385ab96d57

Changed in kicad:
status: Triaged → Fix Committed
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Nick, I just pushed a fix for this. Please let me know if this doesn't resolve the issue. Excellent bug report! It made it easy for me to figure out what was causing the problem.

Revision history for this message
Nick Østergaard (nickoe) wrote :

I can confirm that this seems to be fixed no. Thank you!

Revision history for this message
Oivind Toien (otoien) wrote :

I can also can confirm that it now points to the cache-lib as it should when library is missing and also the sym-lib-table entry (Windows nightly 2017-12-31 revision 11d1188fd) .

While I am not personally a fan of the rescue functionality, following Nick's bug testing procedure on the example and then activating Tools - Rescue Symbols, should not this trigger the rescue since the originally specified library is missing? Instead I get message "Project has nothing to rescue".

Changed in kicad:
status: Fix Committed → Fix Released
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.