Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer overflow for print and plot commands #26

Open
AdroitErudite opened this issue Nov 8, 2024 · 0 comments
Open

Buffer overflow for print and plot commands #26

AdroitErudite opened this issue Nov 8, 2024 · 0 comments

Comments

@AdroitErudite
Copy link

Description

Using the print more than one line causes a buffer overflow error. And attempting to plot more than one vector at a time causes a buffer overflow error. Unsure if this is two separate issues or one issue.

Version

WRspice Version 4.3.21, (tested in GTK2, QT5)
System Ubuntu 24.04

Steps to replicate print buffer overflow.

In case of print command, open WRspice command line interface and either print something twice or simply enter some math expressions. Using print pi produces identical results.

WRspice 1 -> pi

pi = 3.141593

WRspice 2 -> pi

*** buffer overflow detected ***: terminated

Received signal 6, exiting.

Printing something that is a single digit, 0-9, gives buffer overflow after three times instead of two. Additionally, printing any statement that is two lines or more like printing a whole vector also causes the crash. If you have vector v(1) from a transient analysis.

WRspice 4 -> print v(1)

CKT2
Transient analysis                                  Fri Nov  8 15:24:26 2024
------------------------------------------------------------------------------
Index   time            v(1)            
------------------------------------------------------------------------------
*** buffer overflow detected ***: terminated

Received signal 6, exiting.

Steps to replicate plot buffer overflow.

For the plot command, run any example circuit file that plots multiple vectors with a single line.
The modified example sfq.cir will run without issue:

V0 1 0 gpulse(0 0 20p 2p 0 40p)
L0 1 2 10p
B0 2 0 100 jj3 ics=0.2mA
R0 2 0 2

.model jj3 jj(level=1)

.control
tran .1p 100p uic
plot v(1)
plot v(2)
.endc

The following will crash with buffer overflow:

V0 1 0 gpulse(0 0 20p 2p 0 40p)
L0 1 2 10p
B0 2 0 100 jj3 ics=0.2mA
R0 2 0 2

.model jj3 jj(level=1)

.control
tran .1p 100p uic
plot v(1) v(2)
.endc

This was tested in GTK2 and QT5 builds with identical results to ensure the plot command was not failing due to GUI issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant