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

Calculate DC bias with Sweep is broken #272

Closed
in3otd opened this issue Jun 8, 2015 · 12 comments
Closed

Calculate DC bias with Sweep is broken #272

in3otd opened this issue Jun 8, 2015 · 12 comments

Comments

@in3otd
Copy link
Contributor

in3otd commented Jun 8, 2015

This schematic using a Sweep with a DC simulation crashes the Qucs GUI when running Calculate DC bias (F8) . Simpler schematics often run, but the small dialog allowing to select the sweep run to use for showing the DC bias is not shown. Was apparently broken also in 0.0.18 (??).

@nvdl
Copy link
Contributor

nvdl commented Jun 9, 2015

In "qucs.cpp":

SweepDialog Dia = new SweepDialog((Schematic)sim->DocWidget);

is causing the fault.

I checked and "sim->DocWidget" is not NULL.

"SweepDialog::SweepDialog(Schematic *Doc_)" seems to cause this.

@in3otd
Copy link
Contributor Author

in3otd commented Jun 9, 2015

yes, I saw the gdbbacktrace... I was a bit puzzled since the only recent changes are 0a2f1a7 and a09e00c ; moreover it seems to crash already on 0.0.18...

@nvdl
Copy link
Contributor

nvdl commented Jun 9, 2015

Will give it a try later.

What about:
"delete pGraph;" line?

moreover it seems to crash already on 0.0.18...
Same here.

In my fork, it works sometimes as there is a visible dock showing a warning.
Looks like it has something to do with the schematic (viewport) in focus.

@nvdl
Copy link
Contributor

nvdl commented Jun 13, 2015

Another crash example:

No idea if something is wrong in the schematic or if there is a lurking bug.

https://gist.github.com/nvdl/5ebe56ddebba5986ba95

@smile5
Copy link

smile5 commented Jun 16, 2015

With qucs 0.0.18, it crash with the two schematics.

If that can help:
But if in the first "dc_bias_crash.sch" i f you rename the parameter, from "Vin" to another name, it doesn't crash...
For the second, if you add a label, and if you modify the sweep param from "R4" to "R_var" modifying also the R4 value, don't forget to save, all goes well, but if you retry, to launch calculate dc bias it crash.

For me gdb on my fork, report SIGSEV in sweepdialog.cpp at line 140 or 49, it depend some time the small dialog open sometime not.

@nvdl
Copy link
Contributor

nvdl commented Jun 16, 2015

But if in the first "dc_bias_crash.sch" i f you rename the parameter, from "Vin" to another name, it doesn't crash...

I renamed it to "abc" and it still crashes.
I realized that I was sweeping a name and not a variable.

@smile5
Copy link

smile5 commented Jun 17, 2015

I retry, redownloaded example, modify the parameter value to "abc", save the file, and press F8, and don't crash with version 0.0.18, but the small window to choose the DC point not appear all the time, only the first time...

@nvdl
Copy link
Contributor

nvdl commented Jun 18, 2015

OK, I might have again missed something.
Can you check the pull request above? It fixes stuff on my side.

@guitorri
Copy link
Member

This is the relevant part of the crash report I get with the first schematic:

0   qucs                            0x000000010ca7c097 mySpinBox::textFromValue(int) const + 71 (sweepdialog.cpp:49)
1   QtGui                           0x000000010d1d5bfa QSpinBoxPrivate::textFromValue(QVariant const&) const + 58
2   QtGui                           0x000000010d13bb81 QAbstractSpinBoxPrivate::updateEdit() + 273
3   QtGui                           0x000000010d1d6194 QSpinBox::setSingleStep(int) + 68
4   qucs                            0x000000010ca7bfca mySpinBox::mySpinBox(int, int, int, double*, QWidget*) + 122 (sweepdialog.cpp:37)
5   qucs                            0x000000010ca7c047 mySpinBox::mySpinBox(int, int, int, double*, QWidget*) + 55 (sweepdialog.cpp:42)
6   qucs                            0x000000010ca7c624 SweepDialog::SweepDialog(Schematic*) + 1108 (sweepdialog.cpp:101)
7   qucs                            0x000000010ca7d5ad SweepDialog::SweepDialog(Schematic*) + 29 (sweepdialog.cpp:114)
8   qucs                            0x000000010c63c69e QucsApp::slotAfterSimulation(int, SimMessage*) + 254 (qucs.cpp:2058)

@guitorri
Copy link
Member

@nvdl your pull request seems to fix the crash. I left some comments on the PR.

@guitorri
Copy link
Member

This passing around of pointers is hurting my brain... has anyone looked at it?

@guitorri
Copy link
Member

Another fix attempt and more discussion in PR #282.

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

No branches or pull requests

4 participants