Eagle import: Cannot create project

Bug #1732759 reported by Michael Geselbracht
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Wayne Stambaugh

Bug Description

As of commit 8d995f48d it is no longer possible to create a Kicad project from an Eagle .sch/.brd.

Kicad crashes during the import process. There is an assert message (commit 610ff7485):

"/data/src/kicad-source-mirror/eeschema/class_libentry.cpp(1819): assert "!aName.IsEmpty()" failed in GetAlias(): Cannot get alias with an empty name. Bad programmer!"

Since commit 652b96919 there is another issue:
After selecting the target path for the new project a dialog appears saying:

"Error loading schematic file '/home/let/Dropbox/Dokumente/Eagle/HeadphoneAmp-V2/headphoneamp-v2.sch'.
cannot open or save file '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2-eagle-import.lib'"

After dismissing the dialog another one appears:

"cannot open or save file '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2.net'"

then another:

"Cannot create footprint library path '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2.pretty'"

The .brd file is imported but no files are generated since the project generator seems to expect a folder named 'headphoneamp-v2.pro'.

The previous commit (61578f9da) does not have this issue but kicad crashes during the import process.

Application: kicad
Version: (2017-11-16 revision 25f9c6e4f)-master, 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-98-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build 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=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

Tags: eagle
Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1732759] [NEW] Eagle import: Cannot create project

Is this an eagle XML 6 or greater file? It looks like you do not have
write permissions to the folder you are trying to import the new project
to. Please attache the eagle schematic and board files so someone can
figure out why you are having issues.

On 11/16/2017 1:24 PM, Michael Geselbracht wrote:
> Public bug reported:
>
> As of commit 8d995f48d it is no longer possible to create a Kicad
> project from an Eagle .sch/.brd.
>
> Kicad crashes during the import process. There is an assert message
> (commit 610ff7485):
>
> "/data/src/kicad-source-mirror/eeschema/class_libentry.cpp(1819): assert
> "!aName.IsEmpty()" failed in GetAlias(): Cannot get alias with an empty
> name. Bad programmer!"
>
>
> Since commit 652b96919 there is another issue:
> After selecting the target path for the new project a dialog appears saying:
>
> "Error loading schematic file '/home/let/Dropbox/Dokumente/Eagle/HeadphoneAmp-V2/headphoneamp-v2.sch'.
> cannot open or save file '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2-eagle-import.lib'"
>
> After dismissing the dialog another one appears:
>
> "cannot open or save file
> '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2.net'"
>
> then another:
>
> "Cannot create footprint library path
> '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2.pretty'"
>
> The .brd file is imported but no files are generated since the project
> generator seems to expect a folder named 'headphoneamp-v2.pro'.
>
> The previous commit (61578f9da) does not have this issue but kicad
> crashes during the import process.
>
>
> Application: kicad
> Version: (2017-11-16 revision 25f9c6e4f)-master, 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-98-generic x86_64, 64 bit, Little endian, wxGTK
> Build Info:
> wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
> Boost: 1.58.0
> Curl: 7.47.0
> Compiler: GCC 5.4.0 with C++ ABI 1009
>
> Build 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=OFF
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_SPICE=ON
>
> ** Affects: kicad
> Importance: Undecided
> Status: New
>
>
> ** Tags: eagle
>

Revision history for this message
Michael Geselbracht (mgeselbracht) wrote :

Hi,
yes I have used Eagle v6.6 XML files and I do have write permission in
both source (eagle) and target (kicad) directories.
I tried about ten different kicad versions while I was bi-secting this
issue. Always with the same project and the same directories. "Older"
Kicad versions can import the files while newer versions can't.

I have just tried to import another Eagle project on two other machines
(linux + windows) and I get the same error messages with the lastest
development version.

  - Michael

On 16.11.2017 20:30, Wayne Stambaugh wrote:
> Is this an eagle XML 6 or greater file? It looks like you do not have
> write permissions to the folder you are trying to import the new project
> to. Please attache the eagle schematic and board files so someone can
> figure out why you are having issues.
>
> On 11/16/2017 1:24 PM, Michael Geselbracht wrote:
>> Public bug reported:
>>
>> As of commit 8d995f48d it is no longer possible to create a Kicad
>> project from an Eagle .sch/.brd.
>>
>> Kicad crashes during the import process. There is an assert message
>> (commit 610ff7485):
>>
>> "/data/src/kicad-source-mirror/eeschema/class_libentry.cpp(1819): assert
>> "!aName.IsEmpty()" failed in GetAlias(): Cannot get alias with an empty
>> name. Bad programmer!"
>>
>>
>> Since commit 652b96919 there is another issue:
>> After selecting the target path for the new project a dialog appears saying:
>>
>> "Error loading schematic file '/home/let/Dropbox/Dokumente/Eagle/HeadphoneAmp-V2/headphoneamp-v2.sch'.
>> cannot open or save file '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2-eagle-import.lib'"
>>
>> After dismissing the dialog another one appears:
>>
>> "cannot open or save file
>> '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2.net'"
>>
>> then another:
>>
>> "Cannot create footprint library path
>> '/home/let/kicad/Test/HeadphoneAmp/headphoneamp-v2.pro/headphoneamp-v2.pretty'"
>>
>> The .brd file is imported but no files are generated since the project
>> generator seems to expect a folder named 'headphoneamp-v2.pro'.
>>
>> The previous commit (61578f9da) does not have this issue but kicad
>> crashes during the import process.
>>
>>
>> Application: kicad
>> Version: (2017-11-16 revision 25f9c6e4f)-master, 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-98-generic x86_64, 64 bit, Little endian, wxGTK
>> Build Info:
>> wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
>> Boost: 1.58.0
>> Curl: 7.47.0
>> Compiler: GCC 5.4.0 with C++ ABI 1009
>>
>> Build 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=OFF
>> BUILD_GITHUB_PLUGIN=ON
>> KICAD_USE_OCE=ON
>> KICAD_SPICE=ON
>>
>> ** Affects: kicad
>> Importance: Undecided
>> Status: New
>>
>>
>> ** Tags: eagle
>>

Revision history for this message
Michael Geselbracht (mgeselbracht) wrote :

Hi,
another test with Kicad nightly (16-Nov-2017) for Windows with the 'hexapod' demo of Eagle v7.3 showed the same issue (Error 3, path not found - the windows version appends the error code reported by system).

I think there are actually two issues. The crash since commit 8d995f48d (56d73f837*) and the "Project file as directory" since commit 652b96919.
The first one might affect Linux only and is project specific: The hexapod example can be imported but the appended wordclock project crashes kicad.
The second issue affects Windows and Linux and is independent of the (Eagle) project.

*) I don't know how I have determined the commit 8d995f48d since I cannot compile that version. Two commits later there was a fix for that build issue.

Revision history for this message
Michael Geselbracht (mgeselbracht) wrote :

I found out why no projects can be created from eagle files. After a wxFileDialog for the target directory and project name is closed the resulting string is assigned to a wxFileName object.

The previous

wxFileName pro( dlg.GetPath() )

got replaced by

pro.SetPath( dlg.GetPath() )

which is not the same. The dialog object returns a string with the full path and filename. The constructor of wxFileName sets the path and the filename accordingly.
wxFileName::SetPath() on the other hand only sets the path. With the filename already set this leads to /path/name.pro/name.pro

I have created a patch for this issue. It does not fix the crash with my Eagle files though.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1732759] Re: Eagle import: Cannot create project

@Michael,

Your patch has a bug in it. If the destination path has a dot '.' in
it, wxFileName with assume that this it the file name extension rather
than the part of the path and parse it accordingly. That is why I used
wxFileName.SetPath(). I will see if I can figure out why you are
having an issue and fix it. I'm guessing it's some quirk with the GTK+
file dialog. I testing over a dozen projects on windows without any issues.

Thanks,

Wayne

On 11/17/2017 11:28 AM, Michael Geselbracht wrote:
> I found out why no projects can be created from eagle files. After a
> wxFileDialog for the target directory and project name is closed the
> resulting string is assigned to a wxFileName object.
>
> The previous
>
> wxFileName pro( dlg.GetPath() )
>
> got replaced by
>
> pro.SetPath( dlg.GetPath() )
>
> which is not the same. The dialog object returns a string with the full path and filename. The constructor of wxFileName sets the path and the filename accordingly.
> wxFileName::SetPath() on the other hand only sets the path. With the filename already set this leads to /path/name.pro/name.pro
>
> I have created a patch for this issue. It does not fix the crash with my
> Eagle files though.
>
>
>
> ** Patch added: "import_eagle_project.patch"
> https://bugs.launchpad.net/kicad/+bug/1732759/+attachment/5010560/+files/import_eagle_project.patch
>

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

Fixed in revision 753f24aaaa80d9928b780149e98d2f2ed1788abc
https://git.launchpad.net/kicad/patch/?id=753f24aaaa80d9928b780149e98d2f2ed1788abc

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

I pushed a fix for this. I fixes the issue on linux. Hopefully, it doesn't break windows builds. Please let me know if you are still having issues.

Revision history for this message
Michael Geselbracht (mgeselbracht) wrote :
Download full text (4.4 KiB)

Ok, this fixes the path issue. But there are still two other issues:

1. Crash with most of "my" Eagle projects
2. The project window (Kicad starter) does not always show created files or Kicad crashes after the import

1.)
I have symbols with a trailing '°' character at the end of their names (_90°).
In sch_eagle_plugin.cpp:1225 the symbol name is stripped of '*' characters:

1225: symbolName.Replace( "*", "" );

If the name contains a '°' character this will lead to an empty string. So
"hel°lo" will become "".

That is the reason for the first crash.

2.)
The other crash seems random. Maybe 1 out 4 times with the same project.
In about 1 of 2 cases the import succeeds but the project window is not updated with the resulting .sch and .kicad_pcb files. The reload button will show the files but the tool buttons for eeschema and pcbnew remain disabled. After a restart of kicad everything seem to be fine.

Crash after Eagle file import. No .sch, .pcb or .pro files are written. Only libs (.net, .dcm, .pretty)

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x000000000045b732 in TREEPROJECT_ITEM::GetType (this=0x0) at /data/src/kicad-source-mirror/kicad/class_treeproject_item.h:56
56 TreeFileType GetType() const { return m_Type; }
(gdb) bt
#0 0x000000000045b732 in TREEPROJECT_ITEM::GetType (this=0x0) at /data/src/kicad-source-mirror/kicad/class_treeproject_item.h:56
#1 0x0000000000459a29 in TREEPROJECTFILES::OnCompareItems (this=0x8ecbe0, item1=..., item2=...)
    at /data/src/kicad-source-mirror/kicad/class_treeprojectfiles.cpp:95
#2 0x00007ffff70fec6d in ?? () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#3 0x00007ffff526f232 in msort_with_tmp (p=0x7fffffffc210, b=0x578ca40, n=2) at msort.c:83
#4 0x00007ffff526f69f in msort_with_tmp (n=2, b=0x578ca40, p=0x7fffffffc210) at msort.c:45
#5 __GI___qsort_r (b=0x578ca40, n=2, s=8, cmp=0x7ffff70feb20, arg=<optimized out>) at msort.c:297
#6 0x00007ffff70fdbfd in wxGenericTreeCtrl::SortChildren(wxTreeItemId const&) () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#7 0x00000000004853f4 in TREE_PROJECT_FRAME::OnFileSystemEvent (this=0x89f940, event=...) at /data/src/kicad-source-mirror/kicad/tree_project_frame.cpp:995
#8 0x00007ffff67d11fe in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#9 0x00007ffff69576e7 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#10 0x00007ffff6957ace in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#11 0x00007ffff6957b5f in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#12 0x00007ffff6957c13 in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#13 0x00007ffff6957c75 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#14 0x00007ffff6950cd0 in ?? () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#15 0x00007ffff6955c...

Read more...

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :
Download full text (4.8 KiB)

This is a different bug than the original submission. Please file a new
bug report for bad characters causing a crash bug and attach the
offending Eagle schematic and board files so I can verify any bug fixes.

On 11/19/2017 05:30 AM, Michael Geselbracht wrote:
> Ok, this fixes the path issue. But there are still two other issues:
>
> 1. Crash with most of "my" Eagle projects
> 2. The project window (Kicad starter) does not always show created files or Kicad crashes after the import
>
> 1.)
> I have symbols with a trailing '°' character at the end of their names (_90°).
> In sch_eagle_plugin.cpp:1225 the symbol name is stripped of '*' characters:
>
> 1225: symbolName.Replace( "*", "" );
>
> If the name contains a '°' character this will lead to an empty string. So
> "hel°lo" will become "".
>
> That is the reason for the first crash.
>
> 2.)
> The other crash seems random. Maybe 1 out 4 times with the same project.
> In about 1 of 2 cases the import succeeds but the project window is not updated with the resulting .sch and .kicad_pcb files. The reload button will show the files but the tool buttons for eeschema and pcbnew remain disabled. After a restart of kicad everything seem to be fine.
>
> Crash after Eagle file import. No .sch, .pcb or .pro files are written.
> Only libs (.net, .dcm, .pretty)
>
> Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
> 0x000000000045b732 in TREEPROJECT_ITEM::GetType (this=0x0) at /data/src/kicad-source-mirror/kicad/class_treeproject_item.h:56
> 56 TreeFileType GetType() const { return m_Type; }
> (gdb) bt
> #0 0x000000000045b732 in TREEPROJECT_ITEM::GetType (this=0x0) at /data/src/kicad-source-mirror/kicad/class_treeproject_item.h:56
> #1 0x0000000000459a29 in TREEPROJECTFILES::OnCompareItems (this=0x8ecbe0, item1=..., item2=...)
> at /data/src/kicad-source-mirror/kicad/class_treeprojectfiles.cpp:95
> #2 0x00007ffff70fec6d in ?? () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
> #3 0x00007ffff526f232 in msort_with_tmp (p=0x7fffffffc210, b=0x578ca40, n=2) at msort.c:83
> #4 0x00007ffff526f69f in msort_with_tmp (n=2, b=0x578ca40, p=0x7fffffffc210) at msort.c:45
> #5 __GI___qsort_r (b=0x578ca40, n=2, s=8, cmp=0x7ffff70feb20, arg=<optimized out>) at msort.c:297
> #6 0x00007ffff70fdbfd in wxGenericTreeCtrl::SortChildren(wxTreeItemId const&) () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
> #7 0x00000000004853f4 in TREE_PROJECT_FRAME::OnFileSystemEvent (this=0x89f940, event=...) at /data/src/kicad-source-mirror/kicad/tree_project_frame.cpp:995
> #8 0x00007ffff67d11fe in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const ()
> from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
> #9 0x00007ffff69576e7 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
> from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
> #10 0x00007ffff6957ace in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
> #11 0x00007ffff6957b5f in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
...

Read more...

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.