'Place component' freezes Eeschema in Unity

Bug #1385816 reported by deme on 2014-10-26
42
This bug affects 6 people
Affects Status Importance Assigned to Milestone
KiCad
Undecided
Unassigned
unity (Ubuntu)
Undecided
Unassigned

Bug Description

Fresh install Ubuntu 14.10 (amd64)
Install KiCad through PPA (5221)

To reproduce:
- Start new Project in KiCad
- Click 'Place Component'
- Click on schematic to place a new component

No dialog opens for choosing the component and the program freezes.

This seems to only happen in Unity.

deme (demestav) on 2014-10-26
description: updated
description: updated
Felix Vollmer (felixvollmer) wrote :

I also have this bug, but for some reason it only happens with unity (so a workaround is to use openbox, metacity etc.). It also won't happen in my test VM and another PC (all ubuntu 14.10 64 bit). There is at least one more dialog that sometimes won't show (can't remember it right now).

So it looks like some weird WM problem. (I tried to debug it and the backtrace looks identical)

deme (demestav) wrote :

I also tried building from source (bzr 5231) using the provided installation script, on a VirtualBox Ubuntu 14.10 (amd64) and I am able to replicate the problem there as well.

Felix Vollmer (felixvollmer) wrote :

That VM could be useful for debugging (some KiCad developer might tell). Today I had problems with some dialogs in the footprint editor.

Nick Østergaard (nickoe) wrote :

deme, can you please try to use another window manager like Felix suggested?

deme (demestav) wrote :

I installed GNOME and it works.

Nick Østergaard (nickoe) wrote :

And at the same time not in unity?

deme (demestav) wrote :

Yes.
KiCad works if I use GNOME but if I log out and switch to Unity then problem occurs.

Nick Østergaard (nickoe) wrote :

Seems to me like it is more like a problem with unity or something. Can we get a backtrace attached?

Nick Østergaard (nickoe) wrote :

Could it be some window focus issue?

deme (demestav) wrote :

How do I get a backtrace?

With window focus, what do you mean exactly? That the window opens but is not focused? I don't think any window opens, in or out of focus.

Felix Vollmer (felixvollmer) wrote :
Download full text (4.6 KiB)

Here is my backtrace (but I think it won't help):

#0 0x00007ffff5c0139d in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff4887ee4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff4888272 in g_main_loop_run ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff55f3747 in gtk_main ()
   from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#4 0x00007ffff6e2b9a5 in wxGUIEventLoop::DoRun() ()
   from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#5 0x00007ffff67aa380 in wxEventLoopBase::Run() ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#6 0x00007ffff6eaabe0 in wxDialog::ShowModal() ()
   from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#7 0x00007fffce9ef535 in SCH_BASE_FRAME::SelectComponentFromLibrary(wxString const&, wxArrayString&, int&, bool, int*, int*) ()
   from /usr/local/bin/_eeschema.kiface
#8 0x00007fffce9effed in SCH_EDIT_FRAME::Load_Component(wxDC*, wxString const&, wxArrayString&, int&, bool) () from /usr/local/bin/_eeschema.kiface
#9 0x00007fffcea67cc8 in SCH_EDIT_FRAME::OnLeftClick(wxDC*, wxPoint const&) ()
   from /usr/local/bin/_eeschema.kiface
#10 0x00007fffceb7e661 in EDA_DRAW_PANEL::OnMouseEvent(wxMouseEvent&) ()
   from /usr/local/bin/_eeschema.kiface
#11 0x00007ffff67668be in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#12 0x00007ffff68f8368 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#13 0x00007ffff68f846b in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#14 0x00007ffff68f8818 in wxEvtHandler::TryHereOnly(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#15 0x00007ffff68f88a3 in wxEvtHandler::ProcessEventLocally(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#16 0x00007ffff68f8905 in wxEvtHandler::ProcessEvent(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#17 0x00007ffff70b2a8b in wxScrollHelperEvtHandler::ProcessEvent(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#18 0x00007ffff68f8677 in wxEvtHandler::SafelyProcessEvent(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#19 0x00007ffff6e56f4d in ?? ()
   from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#20 0x00007ffff55f5c0f in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#21 0x00007ffff4fcc245 in g_closure_invoke ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x00007ffff4fddf3c in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x00007ffff4fe6255 in g_signal_emit_valist ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff4fe69af in g_signal_emit ()
   from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff570d2fc in ?? ()
   from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#26 0x00007ffff55f4354 in gtk_propagate_event ()
   from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#27 0x00007ffff55f47eb in gtk_main_do_event ()
   from /usr/lib/...

Read more...

Felix Vollmer (felixvollmer) wrote :

@deme for the backtrace

type in the console:
gdb kicad↵
run↵

open the add component dialog (which doesn't show up)

back in the console pause the process with ctrl+c
to get the backtrace run:
bt↵

deme (demestav) wrote :

I think I got it. Attached is the result.

Nick Østergaard (nickoe) wrote :

Could you please state what version of Unity you are using?

summary: - 'Place component' freezes Eeschema
+ 'Place component' freezes Eeschema in Unity
description: updated
deme (demestav) wrote :

Sure. Typing in console:
unity --version

returns:
unity 7.3.1

Felix Vollmer (felixvollmer) wrote :

For me also:
unity 7.3.1

Stephen M. Webb (bregma) wrote :

Hey guys, the version of KiCad that ships in Ubuntu "Vivid" seems to work OK, even on Unity. Could one of you possibly bisect between the current version (0.20141025+bzr4029-1) and the one you're testing that shows a problem to find out what has changed?

deme (demestav) wrote :

Yes the version in the Ubuntu repositories works, I confirm that.
How can I help further? Unfortunately I don't know what you mean by "Could one of you possibly bisect between the current version (0.20141025+bzr4029-1) and the one you're testing..."

If possible can you explain further?

Nick Østergaard (nickoe) wrote :

Hello Stephen, there is a huge difference in code base between the "stable" version shipped in upstream Ubuntu and the current product branch which is the development branch. I don't use Ubuntu myself. But maybe Deme or Felix can try to install the one in the Ubuntu repo and see if they get the same error. What is the unity version used in Vivid (if it has one assigned yet).

Nick Østergaard (nickoe) wrote :

Deme, I guess what Stephen mean, is that you try to build different versions between the old stable and the latest product.

Nick Østergaard (nickoe) wrote :

As a first try, I would suggest to build the pre-kiway tag, which is revision 4756.

deme (demestav) wrote :

Nick thank you for the clarifications.
I have built and installed 4756 using the script.

It works fine on Unity.

Which version do you suggest to try next?

Nick Østergaard (nickoe) wrote :

I would suggest 4757, the rev just after. Because here a hell lot of changes has been made.

deme (demestav) wrote :

4757 works as well. If possible, you could make a list and I will report back where it stop working.

Nick Østergaard (nickoe) wrote :

Deme, I have tried to make some gueses where a lot of eeschema changes has been made. Try 4757, if that freezes, then try 4756. Try 4980 and then 4979. Maybe 5095.

Else you should try to build from latest in some big jumps, maybe 200, untill it works again and try to track down the commit where the error was introduced. When you find it please report here. Thank you.

I'm using this http://kicad.nosoftware.cz/linux/kicad_5147-kubuntu_amd64.deb
and it works fine. So its version 5147.
On Nov 11, 2014 10:20 PM, "Nick Østergaard" <email address hidden>
wrote:

> Deme, I have tried to make some gueses where a lot of eeschema changes
> has been made. Try 4757, if that freezes, then try 4756. Try 4980 and
> then 4979. Maybe 5095.
>
> Else you should try to build from latest in some big jumps, maybe 200,
> untill it works again and try to track down the commit where the error
> was introduced. When you find it please report here. Thank you.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1389337).
> https://bugs.launchpad.net/bugs/1385816
>
> Title:
> 'Place component' freezes Eeschema in Unity
>
> Status in KiCad EDA Software Suite:
> New
> Status in Unity:
> New
>
> Bug description:
> Fresh install Ubuntu 14.10 (amd64)
> Install KiCad through PPA (5221)
>
> To reproduce:
> - Start new Project in KiCad
> - Click 'Place Component'
> - Click on schematic to place a new component
>
> No dialog opens for choosing the component and the program freezes.
>
> This seems to only happen in Unity.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1385816/+subscriptions
>

Nick Østergaard (nickoe) wrote :

So you say it was introduced in 5148, Aurelijus?

No, I only say, that 5147 still works fine. I haven't tested any later
version (apart the 5250 wich gave my the same error/bug). So the answer
should be somewhere between 5147 and 5221.

deme (demestav) wrote :

I have just built and tried 5147 and the problem occurs on my system.

Try to install from the link I posted couple post above. It gives some
errors while trying to instal, but just ignore them.
On Nov 12, 2014 12:40 AM, "deme" <email address hidden> wrote:

> I have just built and tried 5147 and the problem occurs on my system.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1389337).
> https://bugs.launchpad.net/bugs/1385816
>
> Title:
> 'Place component' freezes Eeschema in Unity
>
> Status in KiCad EDA Software Suite:
> New
> Status in Unity:
> New
>
> Bug description:
> Fresh install Ubuntu 14.10 (amd64)
> Install KiCad through PPA (5221)
>
> To reproduce:
> - Start new Project in KiCad
> - Click 'Place Component'
> - Click on schematic to place a new component
>
> No dialog opens for choosing the component and the program freezes.
>
> This seems to only happen in Unity.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1385816/+subscriptions
>

deme (demestav) wrote :

Found it. Here is my list of tests:
4920 - error
5147 - error
5095 - error
4820 - error
4760 - works
4790 - works (here I suspected it was 4807, based on what Nick suggested)
4807 - error
4806 - works

According to this 4807 is where the problem was introduced.

Is this dialog the only one which freezes ?
Can you try to open the pad dialog editor in Pcbnew ?

Can you try this patch:

=== modifié fichier eeschema/dialogs/dialog_choose_component.cpp
--- eeschema/dialogs/dialog_choose_component.cpp 2014-10-09 00:49:29 +0000
+++ eeschema/dialogs/dialog_choose_component.cpp 2014-11-12 09:42:58 +0000
@@ -283,7 +283,10 @@
     // Don't draw anything (not even the background) if we don't have
     // a part to show
     if( !part )
+ {
+ aRepaintEvent.Skip();
         return;
+ }

     if( selection->IsRoot() )
     {

deme (demestav) wrote :

The dialog in Pcbnew that edits the pad of the module works (select pad, then right-click, then Edit). However, when I try to click the "Add module", a dialog appears and if I select "select from Browser" then I get the freeze again.

About the patch. Unfortunately I can't find the code you provide. I looked into $HOME/kicad_sources/kicad.bzr/eeschema/dialog_choose_component.cpp but I can't find the code you provide. My file is the same as this http://bazaar.launchpad.net/~kicad-product-committers/kicad/product/view/4807/eeschema/dialogs/dialog_choose_component.cpp

Or do you mean to test it on the latest bzr?

Let me know if you want any further tests.

Nick Østergaard (nickoe) wrote :

deme, I am pretty sure Jean-Pierre ment you to apply the patch to that file. You could manually add the lines with the single + char to the file or use the command called 'patch' to patch it.

This is realy weird. So how come I get the same freeze with newer bzr
builds, but this one
http://kicad.nosoftware.cz/linux/kicad_5147-kubuntu_amd64.deb just works
fine for me? How could that be? Is this the compiling thing or what?
On Nov 12, 2014 7:50 PM, "deme" <email address hidden> wrote:

> The dialog in Pcbnew that edits the pad of the module works (select pad,
> then right-click, then Edit). However, when I try to click the "Add
> module", a dialog appears and if I select "select from Browser" then I
> get the freeze again.
>
> About the patch. Unfortunately I can't find the code you provide. I
> looked into
> $HOME/kicad_sources/kicad.bzr/eeschema/dialog_choose_component.cpp but I
> can't find the code you provide. My file is the same as this
> http://bazaar.launchpad.net/~kicad-product-
>
> committers/kicad/product/view/4807/eeschema/dialogs/dialog_choose_component.cpp
>
> Or do you mean to test it on the latest bzr?
>
> Let me know if you want any further tests.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1389337).
> https://bugs.launchpad.net/bugs/1385816
>
> Title:
> 'Place component' freezes Eeschema in Unity
>
> Status in KiCad EDA Software Suite:
> New
> Status in Unity:
> New
>
> Bug description:
> Fresh install Ubuntu 14.10 (amd64)
> Install KiCad through PPA (5221)
>
> To reproduce:
> - Start new Project in KiCad
> - Click 'Place Component'
> - Click on schematic to place a new component
>
> No dialog opens for choosing the component and the program freezes.
>
> This seems to only happen in Unity.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1385816/+subscriptions
>

deme,
Your Kicad sources are certainly fully outdated.
Your *need* to use latest sources, currently bzr rev 5263.

deme (demestav) wrote :

I though you wanted me to test the first version that the error occurs i.e. rev 4807.

Anyway, I used the script to install the 5263. Then I modified the file as described and rebuild it using the script. I removed steps (1) through (6) and it built without errors.

However, the problem is still there. No dialog appears after clicking the button.

Guillermo Lo Coco (glococo) wrote :

Same problem happend to me.

Ubuntu 14.10 (3.18.0-031800rc4-generic x86_64)
Unity 7.3.1
rev 5274

Guillermo Lo Coco (glococo) wrote :

Errata: Rev 5267 (5274 mistake)

After installed Lubuntu-desktop and log with Lubuntu, kicad works flawless.

Ionut Negru (blackjohnny) wrote :

For me it happens on both my Ubuntu machines, a desktop and a laptop. :(

3.16.0-24-generic #32-Ubuntu SMP Tue Oct 28 13:07:32 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
unity 7.3.1

Ionut Negru (blackjohnny) wrote :

For the buggy version I used this ppa: http://ppa.launchpad.net/js-reynaud/ppa-kicad/ubuntu

Building it on my machine with the latest sources from launchpad will solve the bug. Either it has been fixed since the last ppa update (13 nov) or the build is buggy.

Regards

Guillermo Lo Coco (glococo) wrote :

After watching your last post, I build the last version (5277). Still hangs on Unity. Have to log off and continue using in Lubuntu.

Ionut Negru (blackjohnny) wrote :

I am not sure it matters but I did not "make install". I just started eeschema directly from the build folder. I will have access to my desktop within an hour, or so, and I will check this and what revision I have used for the build.

Regards

Ionut Negru (blackjohnny) wrote :

OK. So the bug is related to starting eeschema from kicad. The build that I said it "works" isn't if you start eeschema from a kicad project. If you start eeschema standalone the bug is not there.

I hope this information is useful for a Kicad experienced dev to solve the problem ;)

Thanks

deme (demestav) wrote :

I confirm what BlackJohnny reported. That in bzr 5275 if I start eeschema from the command line directly, it works! However, if I close is, and start it again through the kicad main application, the the bug occurs.

Nick Østergaard (nickoe) wrote :

So can you try to reconfrim wearther it works or not in 4760, 4790, and 4806, now remebering to start eeschema from the kicad app?

deme (demestav) wrote :

Are referring to the tests I did in comment #32 (https://bugs.launchpad.net/kicad/+bug/1385816/comments/32)?
In all of my tests, I started eeschema through Kicad except from my test in comment #46 where I started it directly from command line.

So to sum up, if you try to start eeschema from Kicad then 4760, 4790, and 4806 work fine, but in 4807 the bug occurs.

Nick Østergaard (nickoe) wrote :

Deme, yes, I am reffering to those. I just think it is strange that it, wroks, then errors, the works again, and then errors.

deme (demestav) wrote :

Nick, maybe I confused you with the way I wrote comment #32 (unless I am missing something). I wrote it like this to show the sequence of my tests. If I rearrange:

4760 - works
4790 - works
4806 - works
4807 - error
4820 - error
4920 - error
5095 - error
5147 - error

So it seems that the problem is introduced in 4807.

Nick Østergaard (nickoe) wrote :

Deme, aha, yes indeed you confused me a bit there. Good, so it is not clear that something happened in 4807. So it seems that is has something to do with the KIFACE/KIWAY stuff probably. Also the bug lists:

"This might fix the problem on the Mac where child process windows were not coming to the front. See ->Raise() in kicad/mainframe.cpp."

Maybe that is the cause of this bug. I hope Jean-Pierre or someone else will have time to look into this again.

Can you test rev 5293.
Try to test all dialogs in Eeschema and Pcbnew (and the lib editors). Some can freeze Kicad.

Changed in kicad:
status: New → Incomplete

I forgot: I added workarounds for Unity in Kicad code, but this issue looks like an Unity issue.

Felix Vollmer (felixvollmer) wrote :

I most likely didn't test all dialogs, but all dialogs I tested opened up. thx!

deme (demestav) wrote :

I also tested a some dialogs and they work fine! Thank you!

Changed in kicad:
status: Incomplete → Fix Committed
Andrea Azzarone (azzar1) on 2015-01-01
no longer affects: unity
Changed in unity (Ubuntu):
status: New → Invalid
Jon Neal (reportingsjr) on 2015-09-25
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments