-
Notifications
You must be signed in to change notification settings - Fork 161
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
Fixes for #678 and #1739 #1743
base: master
Are you sure you want to change the base?
Fixes for #678 and #1739 #1743
Conversation
Fix for #678This is the 1st commit in this branch. Reproducing the crash:
The cause of the crash is described here:
How it's fixed: in Why fixed this way:
Using |
Fix for #1739This is the 2nd and 3rd commits in this branch. The 2nd commit adds native method The 3rd commit is the fix for image display for All the snippets are similar, here is what At the top there are 4 rows of buttons with images. Buttons This how
I used the following tests with
The same manual tests I performed with snippet |
There is one test failing:
I haven't checked if this is related to this PR or not, could you please check? |
Sure, I'll check this test. |
The problem was in The fix removes recursive visiting of the nested cells for the current item - this should work because during rendering I checked this case in |
Hi @deepika-u You've checked that the fix for #1739 works. Could you please also check if the fix for #678 works on your machine? BTW it's possible that you will see no errors even on SWT without this PR (for example @iloveeclipse wasn't able to reproduce the jvm crash) - that's fine, this is how such bugs work. |
Hi, Sorry for a delayed response. I thought i couldnt make it work so tried multiple times so took abit time on it.
|
I'm sorry for the delayed response too. Thank you for checking this PR. The errors in the console output is another way how the bug can show itself. Basically the error is a so called use-after-free, i.e. an object's memory in native code was at first freed, then later that freed memory was accessed again via a dangling pointer. Basically, assertion messages in the console output indicate that the code is trying to do something with some GTK3 objects, but the provided pointers to GTK3 objects point to malformed GTK3 objects (GTK3 performs some basic checks almost in every method). |
@zkxvh : this branch has merge conflicts with master. Could you please rebase the changes on latest master state? |
Also note, you are not supposed to check-in so files! |
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
Outdated
Show resolved
Hide resolved
OK. |
OK. I'll remove *.so from the changes when I'll make the rebase. BTW I saw in the history that *.so files are usually updated as separate commits, but I couldn't find anything describing how exactly changes to *.so should be included in the PR. |
Thanks for the detailed explanation. |
Fixes image display problems (cropping, not showing) for Tree and Table (both normal and virtual variants). Also fixes eclipse-platform#678 Fixes eclipse-platform#678 Fixes eclipse-platform#1739
62b1a13
to
064e80f
Compare
Hi, @iloveeclipse I rebased the changes to the latest master + removed *.so from the PR. I also checked that everything works again - just like I did here. BTW, I removed the commit (it was 1st commit before the rebase) that wrapped execution of
To illustrate, here is the same problem in void sendMeasureEvent (long cell, long width, long height) {
...
// here inside Tree.checkData()->sendEvent(SWT.SetData)->callback->TreeItem.setImage()->Tree.createRenderers() is called, which frees memory for GtkCellRendererText pointed to by cell.
Image image = item.getImage (columnIndex);
...
// here's the access to already freed memory of GtkCellRendererText, which can cause SIGSEGV and app crash
GTK.gtk_cell_renderer_set_fixed_size (cell, -1, contentHeight [0]);
} #678 got fixed anyway, because Also just FYI there is an alternative PR that fixes #678 : it's #1612 by @basilevs Have a nice day. |
Is there any hope to remove other asyncExecs from this PR? They were done for tangentially same reason, are not they? |
The reasons are different:
BTW gtk3 itself very actively uses asynchronous execution (similar to what |
Fixes for #678 and #1739.
Initially I wanted to fix #678, but after the fix the problems described in #1739 got worse, so I fixed them too.
Fixes #678
Fixes #1739