kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #39032
Re: SIGTRAP crash with ngspice
-
To:
Wayne Stambaugh <stambaughw@xxxxxxxxx>, Andrew Lutsenko <anlutsenko@xxxxxxxxx>, Nick Østergaard <oe.nick@xxxxxxxxx>
-
From:
"Steven A. Falco" <stevenfalco@xxxxxxxxx>
-
Date:
Tue, 15 Jan 2019 14:58:00 -0500
-
Autocrypt:
addr=stevenfalco@xxxxxxxxx; keydata= xsBNBFsz14EBCACybmOt8ADXje8UJJ4hPBTZo3Sm3XS5hhMUDb1/6rQSbT7dpFf3CGp4qwIB DMfS4sV1JMyr3Sl67HzvTMqqHCOTj/QSWiRtFEiasYy82ujfN0/82esM5uKK7Ev2QTs+PZ+Z oqZCwuD7FIRgKtKogJrYmM0aNkKYf1cw4WsND8eGcN1EmmVAQ0PIptpXhiSkJbQLFm06lyTp OBA9MctcPXCRE3DRgByx0YJAjeSckHnU8grJY6niIJgYv5pfrOYSEI+aHgEyePgPzuVz5Y1G 1lb35JG6kdH7GJ406Gggrwe/ia15+HDUMMIy+7EHUSeVWhuXjyW8h4IbbdJ9/YJJa5R9ABEB AAHNJ1N0ZXZlbiBBLiBGYWxjbyA8c3RldmVuZmFsY29AZ21haWwuY29tPsLAlAQTAQgAPgIb AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBFyBX3Re/Ohwg2zkVLdBZWVuLJciBQJcFVxD BQkKR4ZCAAoJELdBZWVuLJcixMYH/3DAFR8XdBzXzaBRVHuo5PeEvSbLPgHw9ZbNi+ZlhFKh 99nsHksDx9H0n2htw7B029L7bI0+5rfAR5/CMw1iqeZMRll0NjVPVrdC+8qQAS3Zz0yaQVw0 ReeDEabA5oMuLE4JuWjqULUCyZt3U9feTNeNJeoD29XTt2E2FP6/KXiysbM/+/tez/2VBoYZ wGqxaRkEuo2I9ZTRx0o8wqBFvRgPOPZJC8vwsy72dkwp5z6LIaIHvr4AgdcTbHixRAyx2sUY 7fBc8UROoPJujLIVQeYaHClUev6gJs3XWs7EArFlIvWcda9YcHijAi69KjM1DSkUKQBgkd06 ES/Wgry4E9nOwE0EWzPXgQEIAN5WNTBUyL/eZ6wr4le5J6zoUZTm2pwxaqsyOje+iyoa/Cpa imhAaFnYe3N3z3gvlIPOLUAmyzUmy2ph9yMsi+GXFP3ZxaPk5uP4fmvivF6OuOlrNSpbEdn1 2AU0msRZccTbWIU6wunkvi7cUYJLe+ZZEn43ALaIMwFegRZqe57Re8pc8k0wlYOsVrZ8UTTp NEXGJ+c/aC1K5xhPUt6nCZNfvkAOdQ74mVrg4ogXuGl1vbZS0J8mv+OOe9RYUqFSUPo3MIGT M68SOfE6NmsVXI/Glb7m6kMKQt+Tm22hKVxyptIgNqA4qrYBc/PMCvGObnCKEy4GSLii1bcz D9a+2ZcAEQEAAcLAfAQYAQgAJgIbDBYhBFyBX3Re/Ohwg2zkVLdBZWVuLJciBQJcFV6FBQkK R4iEAAoJELdBZWVuLJciNQcH/2RIXU/dbXIP+QwdTaqmYpuzdXImvy+7l62MpqteQJ+NYwob 3vbZb40ie3xu/WFr+nqbsUzzrw43/s6as923AExZbgsZ6Zx5nN6xf4E5NdvaBZ0vVMezCuvl QvDAOeJ0RFhldzSVPizQ/o9kOxCgtU1eK93NKCBUOfr5/OpoGKnXYV2e8s+DzUkUjih0cN4x qy3/r0Fe+K7QUaNIqjcmjPgI8SX/9axqpEBhmygEQ8Tuy79UwQjemKzkY8/6rIEoM8L2nQsv u7PqvK53liTljqMK7ojVUTsEon0aeHs/4sP1YER7ExDXPC7ogr0JrBuuqZ3gA2M+T2lWq2kM 8CrrKSY=
-
Cc:
KiCad developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
In-reply-to:
<5eebd98f-ef30-a52b-cd6c-2b4a69300c55@gmail.com>
-
Openpgp:
preference=signencrypt
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0
On 1/15/19 9:21 AM, Wayne Stambaugh wrote:
> Hi Steve,
>
> On 1/15/2019 8:51 AM, Steven A. Falco wrote:
>> I'll look at that. The worst burst of backspaces is about 7 characters long, so I could accumulate 14 chars or so before making a decision. In other words, run a circular buffer, and when I see the first non-backspace after a string of backspaces, then process the buffer.
>>
>> But I'm starting to think that the better approach is to drop this patch from the official tree, and just put my original patch into Fedora-only, as a temporary patch, to be removed when the library issue is corrected.
>
> This may be the way to go as this is only temporary until the ng-spice
> library is fixed. I'm assuming this issue is specific to Fedora. If
> not, we can re-evaluate it at the time that it is broken on another
> platform.
I committed my original patch into the Fedora build system. A new build will appear in rawhide in a day or two, and it will appear in Fedora 29 after a week or two, once the karma process runs its course. Thus Fedora users can start enjoying ngspice soon. I'll keep track of the ngspice library, and if a fix appears there, then I'll remove my patch.
I did take a stab at a new, efficient patch which addresses Seth's concern - but after studying the dynamics of the message passing, I don't think it really matters. Messages always seem to break on carriage-return boundaries, so either patch will work without any loss of data.
I attached the new patch here so it won't get lost. It behaves about the same as the earlier one, but it does print some extra '%' characters that are left over after the backspaces are processed. Thus, I actually prefer the original patch, because it produces slightly cleaner output.
Nick - Do you want to put either version into the Copr builds?
Steve
P.S. - This time, I tried to follow the coding style, as per Wayne's email. :-)
From d8888c9ccf62a0f38ef9b1f3a8be50bb1ac87dcf Mon Sep 17 00:00:00 2001
From: "Steven A. Falco" <stevenfalco@xxxxxxxxx>
Date: Tue, 15 Jan 2019 14:00:20 -0500
Subject: [PATCH] Filter out backspaces from ngspice status lines.
The ngspice library can output "percent complete" status lines, and the
amount of status produced can exceed 1 megabyte. Those lines contain
embedded backspaces, and don't print correctly. Therefore, we filter
them to remove the backspaces and preceding characters.
---
eeschema/sim/sim_plot_frame.cpp | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp
index 3812d0c3b..74d0d1d6e 100644
--- a/eeschema/sim/sim_plot_frame.cpp
+++ b/eeschema/sim/sim_plot_frame.cpp
@@ -1282,7 +1282,25 @@ void SIM_PLOT_FRAME::onSimUpdate( wxCommandEvent& aEvent )
void SIM_PLOT_FRAME::onSimReport( wxCommandEvent& aEvent )
{
- m_simConsole->AppendText( aEvent.GetString() + "\n" );
+ wxString t = aEvent.GetString();
+ wxString buffer = "";
+
+ for( wxString::iterator it = t.begin(); it != t.end(); ++it )
+ {
+ if( *it != '\b' )
+ {
+ // Not a backspace; store it in the buffer.
+ buffer += *it;
+ }
+ else
+ {
+ // Backspace; toss the last character in the buffer (if any), and
+ // toss the backspace.
+ buffer.RemoveLast();
+ }
+ }
+
+ m_simConsole->AppendText( buffer + "\n" );
m_simConsole->SetInsertionPointEnd();
}
--
2.20.1
Follow ups
References
-
SIGTRAP crash with ngspice
From: Steven A. Falco, 2019-01-11
-
Re: SIGTRAP crash with ngspice
From: Seth Hillbrand, 2019-01-11
-
Re: SIGTRAP crash with ngspice
From: Steven A. Falco, 2019-01-11
-
Re: SIGTRAP crash with ngspice
From: Steven A. Falco, 2019-01-11
-
Re: SIGTRAP crash with ngspice
From: Steven A. Falco, 2019-01-14
-
Re: SIGTRAP crash with ngspice
From: Wayne Stambaugh, 2019-01-14
-
Re: SIGTRAP crash with ngspice
From: Steven A. Falco, 2019-01-14
-
Re: SIGTRAP crash with ngspice
From: Wayne Stambaugh, 2019-01-14
-
Re: SIGTRAP crash with ngspice
From: Steven A. Falco, 2019-01-14
-
Re: SIGTRAP crash with ngspice
From: Andrew Lutsenko, 2019-01-15
-
Re: SIGTRAP crash with ngspice
From: Steven A. Falco, 2019-01-15
-
Re: SIGTRAP crash with ngspice
From: Wayne Stambaugh, 2019-01-15