-
Notifications
You must be signed in to change notification settings - Fork 26
Segmentation fault with Frame Array since EGT 1.7 #24
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
Comments
Hello, Thanks for the feedback, I'll try to reproduce your issue as soon as possible. Yes child handling changes are probably the culprit in this issue... Regards, |
From my understanding, the issue seems to be when adding a Frame with a child to another Frame. I tried the code below, but I didn't get any error:
Could you share a minimal piece of code that is not working? Regards, |
Sorry for the late reply, took me a while to reconstruct the original. Be aware the example probably doesn't display anything because I didn't take care of the show/hide functions for it. For me its not even getting through the main but aborting. Code worked in exactly that way with EGT 1.6 (at least I didn't change anything knowingly). The issue occurs when adding a first frame (holding several widgets as children) to second frame as child, where the second frame is an array element and itself child of a third frame which is child of a topwindow. I have three files involved:
Main.cpp (not sure if all includes are necessary for this example):
MSGhandler.h
MSGhandler.cpp
The console output result is the following:
then the program aborts with segmentation fault (core dump) So I think the line with Thanks for you help already! |
Hello, Thanks for sharing code to reproduce the issue, but I'm not able to build this code. I did quick fixes, but I get a segfault earlier than you. How MSG_Test1, MSG_Test2 and MSG_GeneralFrameTest are declared? Regards, |
Sorry, my fault. The Frames are declared in the MSGhandler.cpp right after the namespace: MSGhandler.cpp
|
Hi, I did a copy/paste of your code and did this changes to make it compile:
I hit check point 11. I have a segfault when closing the app but that's another story, I have not checked if it's due to the app or the library.
|
Hi, thanks for your help. I will have to further investigate what is different on my system. Will report if I find it. |
I found a way of making it work. Seems like the culprit was in the function In the first for loop I assign Frames to each element of the MSG_FrameArr[] even though those elements are technically seen already Frames by declaration This is what I changed in the
I had a deeper look into it and the widget ID (read out with the function widgetid()) of each element of MSG_FrameArr would have change in the old implementation. In the new implementation where I only resize and move the elements they keep their initial ID of course. If you have any idea about this issue I would be highly interested in learning about it. If not, its also okay, the program seems to run stable again :-) Thanks again for your help ! Regards |
Hello, IDs changed because you constructed the Frames when you created your array, then you assigned new Frames to your array. I can't tell you why it worked with 1.6 and no longer with 1.7. Regarding the change you did to make it work, I suspect an issue when moving Frames, maybe the default move is no longer appropriate and some members are not in the expected state after a move is done. If you are able to compile EGT with debug symbols, could you share the backtrace when the segfault happened? Regards, |
Hi, I wont be able to do this for the next 4 weeks. So It's okay for me to put this issue on hold and I will get back to it in August. Regards |
Hi Ludovic, sorry I never got back to this (and forgot about it). But the problem was solved sufficiently and didn't create any issues anymore. Regards |
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
for some display message handling I use an array of type Frame. Each element contains a Frame, specifying the position and Size.
Each message I pre-defined consists again out of a Frame and several child widgets.
Whenever I want to display one of those pre-defined messages I add() it to a Frame element in the array that has not yet any other children.
This worked flawlessly up to EGT 1.6 and throws a segmentation fault now as soon as the I add() a message Frame to one of the Frames in the array.
The Frame array is defined as:
egt::Frame MSG_FrameArray[numOfFrames];
initialized with:
a typical message Frame is defeined as:
egt::Frame MSG_example(egt::Rect(...));
and initialized with:
However, as soon as I attach (add()) a message Frame now to the Frame array, my program crashes:
MSG_FrameArray[0].add(MSG_example);
I assume something must have changed a tiny little bit with the moving of the child handling from Frame to Widget with 1.7 which throws off my current code.
Regards
Sascha
The text was updated successfully, but these errors were encountered: