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

Core dump on print #480

Closed
noqsi opened this issue Oct 15, 2019 · 17 comments
Closed

Core dump on print #480

noqsi opened this issue Oct 15, 2019 · 17 comments

Comments

@noqsi
Copy link
Contributor

@noqsi noqsi commented Oct 15, 2019

In 1.9.9, File->Print causes the following:

(lepton-schematic:23671): Gtk-WARNING **: Unknown paper size

** (process:23671): WARNING (recursed) **: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Avahi was not provided by any .service filesAborted (core dumped)

@graahnul-grom
Copy link
Member

@graahnul-grom graahnul-grom commented Oct 15, 2019

Could be solved by installing and running avahi-daemon.
Though it's strange: other apps print the same error message, but do not crash.
Paper size can be set in configuration: [gschem.printing]::paper key (e.g. "iso_a4"), but it's not related to crash.

@vzh
Copy link
Member

@vzh vzh commented Oct 17, 2019

@noqsi, I can confirm the crash on Debian (mix of stable/oldstable/testing).
If i comment out those two lines in schematic/src/gschem_log_widget.c:348, it works without crash:

  while (gtk_events_pending())
    gtk_main_iteration();

Could you try this?

@graahnul-grom, it looks like there are some racing conditions when using gtk_main_iteration in such a way and many lines are added to the log (by g_log). Probably it affects only some systems, though we have to fix this. Please look into it.

@noqsi
Copy link
Contributor Author

@noqsi noqsi commented Oct 17, 2019

@vzh
Copy link
Member

@vzh vzh commented Oct 18, 2019

Thanks, John.
I'll close the issue.

@vzh vzh closed this in #482 Oct 18, 2019
@graahnul-grom
Copy link
Member

@graahnul-grom graahnul-grom commented Oct 18, 2019

Cannot reproduce it, on FreeBSD File->Print works fine.

@vzh
Copy link
Member

@vzh vzh commented Oct 18, 2019

@graahnul-grom, it could be an issue on Debian and its derivations. It crashed on my PC, too, as I already said, and John has confirmed that my fix worked. I decided it's better to not deprive our users of the printing functionality until we fix it otherwise, so I committed my work-around patch, sorry.

@graahnul-grom
Copy link
Member

@graahnul-grom graahnul-grom commented Oct 18, 2019

You were right committing this, there's nothing to be sorry about.
Debugging shows that there is indeed a race condition when GTK tries to log
a message.

@graahnul-grom
Copy link
Member

@graahnul-grom graahnul-grom commented Oct 18, 2019

Though it breaks scrolling in the log window (reported in #238, fixed in #239).
@vzh @noqsi Could you please try the attached patch? It should fix the
scrolling issue (using a different trick). Will it crash on Debian?

log_scroll.diff.txt

@noqsi
Copy link
Contributor Author

@noqsi noqsi commented Oct 18, 2019

@graahnul-grom
Copy link
Member

@graahnul-grom graahnul-grom commented Oct 18, 2019

@noqsi This patch should be applied to the latest git source tree.

@graahnul-grom
Copy link
Member

@graahnul-grom graahnul-grom commented Oct 18, 2019

@noqsi Here's the patch against 1.9.9 release.

log_scroll_199.diff.txt

@noqsi
Copy link
Contributor Author

@noqsi noqsi commented Oct 18, 2019

@graahnul-grom
Copy link
Member

@graahnul-grom graahnul-grom commented Oct 18, 2019

@noqsi Thank you, John. And what about scrolling? Does the window scroll to the bottom when something is written to the log?

@noqsi
Copy link
Contributor Author

@noqsi noqsi commented Oct 18, 2019

@graahnul-grom
Copy link
Member

@graahnul-grom graahnul-grom commented Oct 18, 2019

Отлично, сейчас запилим PR. Ваше здоровье, камрад Джон!

@noqsi
Copy link
Contributor Author

@noqsi noqsi commented Oct 18, 2019

@vzh
Copy link
Member

@vzh vzh commented Oct 19, 2019

@noqsi, he jokes :-) Literally, it's something like "Greate, we'll make a PR just now. (A cup of wine, vodka, or some) to you health, comrade John!"

@graahnul-grom, your patch works great, anything is scrolled correctly. Waiting for the promised PR.

graahnul-grom added a commit to graahnul-grom/lepton-eda that referenced this issue Oct 24, 2019
Make the log window scroll to the bottom whenever
a message is written to the log.
Log window's inability to automatically scroll
was reported in lepton-eda#238 and then fixed in lepton-eda#239
(git: fc72ce3).
However, as it was discovered recently (lepton-eda#480),
current implementation of that fix may lead to
crash on some systems (Debian, in particular)
when File->Print is invoked. The crash itself
was fixed in git ad4ada5, and this commit fixes
scrolling again.
vzh added a commit that referenced this issue Oct 24, 2019
Make the log window scroll to the bottom whenever
a message is written to the log.
Log window's inability to automatically scroll
was reported in #238 and then fixed in #239
(git: fc72ce3).
However, as it was discovered recently (#480),
current implementation of that fix may lead to
crash on some systems (Debian, in particular)
when File->Print is invoked. The crash itself
was fixed in git ad4ada5, and this commit fixes
scrolling again.
@vzh vzh added this to the 1.9.10 milestone Feb 21, 2020
vzh added a commit to vzh/lepton-eda that referenced this issue Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants