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
unix: segmentation fault #165
Comments
Digging in the source: static gboolean onConfigure(GtkWidget *win, GdkEvent *e, gpointer data)
{
uiWindow *w = uiWindow(data);
// there doesn't seem to be a way to determine if only moving or only resizing is happening :/
if (w->changingPosition)
w->changingPosition = FALSE;
else
(*(w->onPositionChanged))(w, w->onPositionChangedData);
// always continue handling
return FALSE;
} I think there should be a check to verify if there is an |
I tried to replace the |
Note to myself: do the same thing with |
Yes, you should check it before dereferencing the pointer: if (w->onPositionChanged != NULL) |
That what I've been trying in the first time. Just retried it, but the segfault still occurs. :( |
|
The current code: if (w->changingPosition)
w->changingPosition = FALSE;
else if (w->onPositionChanged != NULL)
(*(w->onPositionChanged))(w, w->onPositionChangedData); Stack trace:
|
I just added a blank line before the
|
@emersion: this doesn't make sense to me: sorry for the silly question ,but are you sure you have recompiled? |
Okay, just ran |
This is why I want to make libui ABI-stable. |
So finally |
This might be related to the memory corruption issue; when stack traces act like that that's usually the case. I'd still like to see the uiWindow internal structure. Can you run a backtrace and then keep the gdb session open? |
Sure, ready :)
|
What do you get with
|
Sorry, I really don't know how to use gdb. |
Ah, it's |
|
Ugh why is that complaining :| |
(thinking of you @parro-it getting plenty of email notifications) |
What does |
|
Ah! That would be why the print is failing then. Try the print again after |
Ah! You were right:
|
uiWindowOnPositionChanged(w, defaultOnPositionContentSizeChanged, NULL); Are you missing a |
No. Something else is corrupting _all of_ Just to be safe, |
This doesn't happen all the time. I would say 60% segfault, 30% the other issue, 10% runs properly. |
Yes, that makes it even stranger. Try this: in window.c, after the |
Where is Signature coming from? |
|
The value is modified twice: I open a first window, then another one, and after that I close the first one.
|
At each watchpoint, can you print the value of the signature? |
Actually scratch that; I see the watchpoint is never firing :S |
Er wait no, I took a closer look — it's your Loading... window that's causing the problem. I wonder if it's firing a Add the same line of code from earlier to |
Seems that's what happening. I added some
Any idea how to fix it? |
Maybe call
Maybe the window is still in the list of toplevels? (ref: https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-destroy) |
I can confirm replacing |
Refcounting on the Unix side is a mess right now. :| Thanks for spotting all this! |
The text was updated successfully, but these errors were encountered: