eeschema hangs on loading some libs

Bug #1666024 reported by nextime
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Wayne Stambaugh

Bug Description

Kicad compiled from the latest sources ( using the source package from nightly build in .deb ) on debian sid hangs on open trying to load some libraries.

using strace it seems that it hangs after the first read() call.

The library was loading correctly until some months ago ( don't know exactly from when it has this issue, i re-build it from sources every few months, last time before today was in october 2016 ).

Attached a strace log and one of the library affected

Tags: eeschema
Revision history for this message
nextime (nextime) wrote :
Revision history for this message
nextime (nextime) wrote :
tags: added: eeschema
Revision history for this message
nextime (nextime) wrote :

it seems to hang there:

(gdb) bt
#0 SCH_LEGACY_PLUGIN_CACHE::loadPart (this=this@entry=0x555558e9e1e0, aReader=...) at ./kicad/eeschema/sch_legacy_plugin.cpp:2448
#1 0x00007fffe30f04bb in SCH_LEGACY_PLUGIN_CACHE::Load (this=0x555558e9e1e0) at ./kicad/eeschema/sch_legacy_plugin.cpp:2202
#2 0x00007fffe30f0fc4 in SCH_LEGACY_PLUGIN::cacheLib (this=this@entry=0x555558cb3700, aLibraryFileName=...) at ./kicad/eeschema/sch_legacy_plugin.cpp:3365
#3 0x00007fffe30f1152 in SCH_LEGACY_PLUGIN::EnumerateSymbolLib (this=this@entry=0x555558cb3700, aAliasNameList=..., aLibraryPath=..., aProperties=aProperties@entry=0x0)
    at ./kicad/eeschema/sch_legacy_plugin.cpp:3423
#4 0x00007fffe2f3db5b in PART_LIB::GetAliasNames (this=this@entry=0x555558e9dd20, aNames=...) at ./kicad/eeschema/class_library.cpp:135
#5 0x00007fffe2f40ea1 in PART_LIB::LoadLibrary (aFileName=...) at ./kicad/eeschema/class_library.cpp:319
#6 0x00007fffe2f42ab8 in PART_LIBS::AddLibrary (this=this@entry=0x5555570b1dd0, aFileName=...) at ./kicad/eeschema/class_library.cpp:348
#7 0x00007fffe2f43b7c in PART_LIBS::LoadAllLibraries (this=this@entry=0x5555570b1dd0, aProject=aProject@entry=0x5555557d7dd0 <Kiway+144>, aShowProgress=aShowProgress@entry=true)
    at ./kicad/eeschema/class_library.cpp:650
#8 0x00007fffe312aa8b in PROJECT::SchLibs (this=0x5555557d7dd0 <Kiway+144>) at ./kicad/eeschema/schframe.cpp:165
#9 0x00007fffe302b4c9 in SCH_EDIT_FRAME::OpenProjectFiles (this=0x555556f27a90, aFileSet=..., aCtl=<optimized out>) at ./kicad/eeschema/files-io.cpp:300
#10 0x000055555557f807 in PGM_SINGLE_TOP::OnPgmInit (this=0x5555557d8100 <program>) at ./kicad/common/single_top.cpp:287
#11 0x0000555555581ac0 in APP_SINGLE_TOP::OnInit (this=<optimized out>) at ./kicad/common/single_top.cpp:128
#12 0x00007ffff63d4332 in wxEntry(int&, wchar_t**) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#13 0x000055555557b908 in main (argc=<optimized out>, argv=<optimized out>) at ./kicad/common/single_top.cpp:201

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

Fixed in revision 1672d3778228e6cbd1f9184fce87c316bcd86364
https://git.launchpad.net/kicad/patch/?id=1672d3778228e6cbd1f9184fce87c316bcd86364

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

I just committed a fix for this in 1672d37782. Please let me know if this does not resolve your issues.

Revision history for this message
nextime (nextime) wrote :

already building the new package, i'll let you know in a couple of hours. Thanks ftm

Revision history for this message
nextime (nextime) wrote :

It works like a charm, thanks for the fast fix, i can confirm the issue is now gone away and the libs are fully loaded with no issues.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1666024] Re: eeschema hangs on loading some libs

Thanks for the quick update. I apologize for the breakage. I new that
there would be issues with the conversion over to the new schematic I/O
plugin but it is scheduled for the next stable release and it needed
testing.

On 2/19/2017 8:27 PM, nextime wrote:
> It works like a charm, thanks for the fast fix, i can confirm the issue
> is now gone away and the libs are fully loaded with no issues.
>

Revision history for this message
nextime (nextime) wrote :

Being a developer too and using a nightly release and/or compiling from latest git source, i'm aware that those things happens, so, don't worry and thanks for your work!

Revision history for this message
Xavi Torres (xtm) wrote :

Hi there,

I'm not sure if it is the same issue or it could be related.
The libraries are correctly loaded whe the eechema is opened. The problem comes when trying to place a component.
Clicking on the icon and then on the sheet opens de component selection window. A progress bar pops up. If I quickly select a component, it is selected and can be placed without problem.
But, if I let the progress bar reach to the end, the whole Kicad application hangs (The point is more or less when the progress bar reaches 90 or 95%). The only way is to kill the job and restart application.
I've also detected that, even in the first case (Click quickly on a component) if I try to place another component, the application hangs just when the selection window is opened (The progress bar didn't pop up at this time.

Thanks a lot

I'm running:

Application: kicad
Version: no-vcs-found-e6baaa6~58~ubuntu16.04.1, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-79-generic x86_64, 64 bit, Little endian, wxGTK
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.58.0
Curl: 7.47.0
KiCad - Compiler: GCC 5.4.0 with C++ ABI 1009
        Settings: USE_WX_GRAPHICS_CONTEXT=OFF
                  USE_WX_OVERLAY=OFF
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  KICAD_SCRIPTING_ACTION_MENU=ON
                  BUILD_GITHUB_PLUGIN=ON
                  KICAD_USE_OCE=ON

Revision history for this message
Xavi Torres (xtm) wrote :

UPDATE: Application does not hang actually, it just take ages (Around 10 minutes) to react. Once you recover the control, everything works fine.

Best regards

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Have you the same issue when running CvPcb from eeschema?

I suspect you are using footprint libraries from Github, and having a problem with a internet connection.

Revision history for this message
Xavi Torres (xtm) wrote :

UPDATE: Application does not hang actually, it just take ages (Around 10 minutes) to react. Once you recover the control, everything works fine.

Best regards

Revision history for this message
Xavi Torres (xtm) wrote :

Hi Jean Pierre,

Thanks for your help.

Yes. With CvPcb it happens the same. But in this case I've got the following error:

Errors were encountered loading footprints:
Cannot download library 'https://github.com/KiCad/Labels.pretty'.
The library does not exist on the server
Cannot download library 'https://github.com/KiCad/Discret.pretty'.
The library does not exist on the server
Cannot download library 'https://github.com/KiCad/Divers.pretty'.
The library does not exist on the server

The Internet connection is working properly.

Kind regards,

Xavi

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I believe these footprint libraries no longer exist. You will have to
remove them from your footprint library table to prevent the errors.

On 6/26/2017 4:38 AM, Xavi Torres wrote:
> Hi Jean Pierre,
>
> Thanks for your help.
>
> Yes. With CvPcb it happens the same. But in this case I've got the
> following error:
>
> Errors were encountered loading footprints:
> Cannot download library 'https://github.com/KiCad/Labels.pretty'.
> The library does not exist on the server
> Cannot download library 'https://github.com/KiCad/Discret.pretty'.
> The library does not exist on the server
> Cannot download library 'https://github.com/KiCad/Divers.pretty'.
> The library does not exist on the server
>
> The Internet connection is working properly.
>
> Kind regards,
>
> Xavi
>

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Your Internet connection is working properly, but is not necessary fast.
I encourage you to remove fp libraries you not not use, and better: copy them on your disk and use them in local.
Use github libs for the every day job is not a good idea, from my point of view.

Revision history for this message
Xavi Torres (xtm) wrote :

Many thanks to both for your help.

I'll do some testing and let you know. I agree with you it's better to have the libraries in the local machine or network. I'll also change this, but is is how is was configured during the installation process.

Best regards

Xavi

Revision history for this message
Xavi Torres (xtm) wrote :

Well,

First, I removed the missing libraries. Executing CvPcb took also a long time, but the error messages were gone.
Then I changed the libraries path to /usr/share/kicad/modules/xxxx.pretty. When executing CvPcb it keeps taking a long time to react and this time I got the error messages (One for each library):
 The URL cannot be analysed syntactically: "/usr/share/kicad/modules/xxxx.pretty

I supose this is because for each library the Github plugin was selected. I've tried to change it to Kicad but I didn't succeed. After selecting Kicad in the plug-in type column, I pressed Ok and the library manager window closes. But if I opened again, the plug-in is back to Github.

Am I doing something wrong? Have I to remove all libraries and then install the local ones?

Kind regards

Xavi

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

You are correct. Changing the plugin type by selecting the entry in the
drop down control does not update the plugin type. I tried several
different ways to change the plugin type using various key combinations
and still no luck. Please file a separate bug report for this when you
get a chance since it is a separate bug. The easiest solution until
this gets fixed is to manually edit your fp-lib-table with a text editor
and replace (type Github) with (type KiCad). One windows, fp-lib-table
will be in the c:/Users/UserName/AppData/roaming/kicad folder.

On 6/29/2017 5:37 AM, Xavi Torres wrote:
> Well,
>
> First, I removed the missing libraries. Executing CvPcb took also a long time, but the error messages were gone.
> Then I changed the libraries path to /usr/share/kicad/modules/xxxx.pretty. When executing CvPcb it keeps taking a long time to react and this time I got the error messages (One for each library):
> The URL cannot be analysed syntactically: "/usr/share/kicad/modules/xxxx.pretty
>
> I supose this is because for each library the Github plugin was
> selected. I've tried to change it to Kicad but I didn't succeed. After
> selecting Kicad in the plug-in type column, I pressed Ok and the library
> manager window closes. But if I opened again, the plug-in is back to
> Github.
>
> Am I doing something wrong? Have I to remove all libraries and then
> install the local ones?
>
> Kind regards
>
> Xavi
>

Revision history for this message
jean-pierre charras (jp-charras) wrote :

About plugin not updated:
the fp lib table was not updated when the changes are only plugin types.

It is fixed in rev e3d69b619fe1b82026d0410a3b7a9be6a4b81112

Revision history for this message
Xavi Torres (xtm) wrote :

Many thanks both for your help.

This is the current situation.

After editing the fp lib table, now all libraries are local.

Trying with CvPcb still takes a long time. After that the following message pop up:
 "Some of the assigned footprints are legacy entries (are missing lib nicknames). Would youlike CvPcb to attempt to convert them to the new required LIB_ID format? (If you answer no, then these assignments will be cleared out and you will have to re-assign these footprints yourself.)"

I pressed Yes and again after some time I got a pop up window (Contents in the attached log file)

I guess now the problem comes from imported Eagle libraries.

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.