← Back to team overview

kicad-developers team mailing list archive

Eeschema crash on library component name mismatch

 

Currently eeschema crashes when a library has a component where
the name under "DEF" does not agree with the name under "F1".
I believe rev f35cb6cd6af3900b1967f8ef73396b9d9b8bc24c caused this
issue -- previously we would add the "DEF" name to m_aliases and the
component's alias list and then change the component name to F1.  Now,
we put the DEF name in the alias list, have F1 change the name and
then try to find the new name in the alias list (after ENDDEF). This
puts a NULL into SCH_LEGACY_PLUGIN_CACHE::m_aliases, leading to a crash later on in SCH_LEGACY_PLUGIN_CACHE::~SCH_LEGACY_PLUGIN_CACHE (when it evaluates the arguments to wxLogTrace).

I have no idea what the intended behaviour in this case is. The patch
below simply prevents F1 from changing the name (which prevents the
crash at least), though I obviously don't expect it to be committed.

diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp
index 9a29bad..bbb917a 100644
--- a/eeschema/sch_legacy_plugin.cpp
+++ b/eeschema/sch_legacy_plugin.cpp
@@ -2647,8 +2647,8 @@ void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr< LIB_PART >& aPart,

         *fixedField = *field;

-        if( field->GetId() == VALUE )
-            aPart->m_name = field->GetText();
+//        if( field->GetId() == VALUE )
+//            aPart->m_name = field->GetText();
     }
     else
     {



Follow ups