EEschema BOM Generate hangs on Windows BATCH file

Bug #1470323 reported by Marco Hess
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Invalid
Undecided
Unassigned

Bug Description

In Windows when the command line in the EEschema BOM generator is a batch file, KiCad hangs completely.

It appears to hang in a busy state. It can only be killed through the Windows Tasks Manager where you need to kill KiCad, the Bill Of Material window and also in the process list ensure that kicad.exe is killed too.

The problem seems related to the recently introduced feature that reports the result of the executed command in the 'Plugin Info:' window in the Bill of Material dialog.

When used with a direct executable (e.g. python.exe) it executes and reports correctly.

When the option wxEXEC_SHOW_CONSOLE is added to the wxExecute (line 107 in eeschema/netform.cpp) and executing a batch file, you see a Windows CMD window show up but nothing displays in that window. However, you are able to close that CMD window and then KiCad recovers and reports a result with some random error code.

Also, when I change eechema/dialogs/dialog_bom.cpp line 396 to execute the m_parent->CreateNetlist with NULL as the reporter, the batch file also executes correctly with the CMD window popping up and showing the batch file executing.

So this is something with wxExecute and its I/O redirect as the simpler ProcessExecute which also uses wxExecute works correctly.

Revision history for this message
Marco Hess (marco-hess) wrote :

Further to this. With the wxEXEC_SHOW_CONSOLE in there and the ability to kill the CMD window, the dialog info windows displays some output like. Note what seems like a recursion occuring. Richt after the first 'Command Error' there is a new 'Run Command' and a further one in the text of the 'Info messages'

Run command:
C:\Tools\Python27\python_pause.bat "W:\DevelopmentTools\KiCad\scripts\Bom\bom\bom_csv_element14.py" "W:\Projects\AT-GNSS\electronics\AT-GNSS-01.xml" "W:\Projects\AT-GNSS\electronics\AT-GNSS-01-BOM-Element14.csv"

Command error. Return code -1073741510
Run command:
C:\Tools\Python27\python_pause.bat "W:\DevelopmentTools\KiCad\scripts\Bom\bom\bom_csv_element14.py" "W:\Projects\AT-GNSS\electronics\AT-GNSS-01.xml" "W:\Projects\AT-GNSS\electronics\AT-GNSS-01-BOM-Element14.csv"

Info messages:
Python returned 1 !Press any key to continue . . . Run command:
C:\Tools\Python27\python_pause.bat "W:\DevelopmentTools\KiCad\scripts\Bom\bom\bom_csv_element14.py" "W:\Projects\AT-GNSS\electronics\AT-GNSS-01.xml" "W:\Projects\AT-GNSS\electronics\AT-GNSS-01-BOM-Element14.csv"

Info messages:

Error messages:
ImportError: No module named site

Revision history for this message
Marco Hess (marco-hess) wrote :

Having looking at this closely again, it is probably not a bug. I had a pause in my batch files that caused this hang :-)

There is however a problem in the formatting of the command output in that intermediate strings are not cleared and are appended to and output multiple times. As such output seems to duplicate.

I have a patch for this available.

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

Because this is not a bug in kicad I mark in invalid.
Formatting issues are an other story, and they are now fixed.

Changed in kicad:
status: New → Invalid
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.