← Back to team overview

kicad-developers team mailing list archive

Re: Eeschema crash on library component name mismatch

 

Le 28/02/2017 à 01:09, Julius Schmidt a écrit :
> 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
>      {
> 

I just fixed this issue (no crash).

However, mismatch should not happen: .lib files have in DEF and F1 the same name (F1 can be modified
later in schematics).
Is this lib built with Kicad?
Or Is it a converted or edited by hand (and broken) lib

if DEF and F1 names mismatch, what is the actual symbol name in lib?
-- 
Jean-Pierre CHARRAS


References