After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769161 - notebook: avoid crash on tab DND
notebook: avoid crash on tab DND
Status: RESOLVED OBSOLETE
Product: gnome-terminal
Classification: Core
Component: general
3.20.x
Other All
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 764960 771588 775029 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-07-25 17:45 UTC by Andreas Henriksson
Modified: 2021-06-10 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notebook: avoid crash on tab DND (1.20 KB, patch)
2016-07-25 17:46 UTC, Andreas Henriksson
none Details | Review
notebook: avoid crash on tab DND (1.24 KB, patch)
2016-07-25 18:12 UTC, Andreas Henriksson
accepted-commit_now Details | Review

Description Andreas Henriksson 2016-07-25 17:45:58 UTC
See "gtk_notebook_detach_tab" API documentation. Using it instead
of gtk_container_remove avoids an assertion crash in gtk+ when
dragging and dropping a tab between terminal windows.

See also original bug report at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825818
Comment 1 Andreas Henriksson 2016-07-25 17:46:02 UTC
Created attachment 332114 [details] [review]
notebook: avoid crash on tab DND
Comment 2 Christian Persch 2016-07-25 18:00:32 UTC
This function is only available in gtk 3.16, so this needs some #if GTK_CHECK_VERSION() checks. The API docs only say that this makes this not abort the DND operation (assuming the removal was from a DND operation), so this is the right thing to do on >= 3.16, but it has nothing to do with fixing a crash; afaik the crash in gtk+ is actually fixed in the latest 3.20.x release.
Comment 3 Andreas Henriksson 2016-07-25 18:05:33 UTC
(In reply to Christian Persch from comment #2)
> This function is only available in gtk 3.16, so this needs some #if
> GTK_CHECK_VERSION() checks. The API docs only say that this makes this not
> abort the DND operation (assuming the removal was from a DND operation), so
> this is the right thing to do on >= 3.16, but it has nothing to do with
> fixing a crash; afaik the crash in gtk+ is actually fixed in the latest
> 3.20.x release.

Thanks for your quick review, will post a new patch with the ifdefs.

Please note that I've tested this on 3.20.2 (lastest 3.20.x release) with all debian patches disabled where this is needed to fix the crash for me.
Comment 4 Christian Persch 2016-07-25 18:11:18 UTC
Latest is actually 3.20.6. I think the crash is bug 767588 which I thought was FIXED but now see has been reopened.
Comment 5 Andreas Henriksson 2016-07-25 18:12:15 UTC
Created attachment 332117 [details] [review]
notebook: avoid crash on tab DND

See "gtk_notebook_detach_tab" API documentation. Using it instead
of gtk_container_remove avoids an assertion crash in gtk+ when
dragging and dropping a tab between terminal windows.

See also original bug report at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825818
Comment 6 Christian Persch 2016-07-25 18:15:21 UTC
Comment on attachment 332117 [details] [review]
notebook: avoid crash on tab DND

Thanks! master and gnome-3-20 branch (cherry-pick -x).
Comment 7 Andreas Henriksson 2016-07-25 18:18:20 UTC
oh, I meant gnome-terminal 3.20.2 but you're apparently talking about gtk+ 3.20.6?

I have gtk+ 3.20.6 already though, so not fixed for me there either.

Thanks again for quickly reviewing and applying!
Comment 8 Andreas Henriksson 2016-07-25 18:37:25 UTC
pushed to master (and cherry-picked -x to gnome-3-20).
Comment 9 Christian Persch 2016-08-01 18:28:30 UTC
*** Bug 764960 has been marked as a duplicate of this bug. ***
Comment 10 Hussam Al-Tayeb 2016-08-09 18:00:41 UTC
Hello. This fix is crash in gnome 3.20 branch. reverting it fixes the crash.

(gdb) bt full
  • #0 gtk_notebook_detach_tab
    at gtknotebook.c line 3938
  • #1 _g_closure_invoke_va
    at gclosure.c line 867
  • #2 g_signal_emit_valist
    at gsignal.c line 3294
  • #3 g_signal_emit
    at gsignal.c line 3441
  • #4 g_closure_invoke
    at gclosure.c line 804
  • #5 signal_emit_unlocked_R
  • #6 g_signal_emit_valist
    at gsignal.c line 3385
  • #7 g_signal_emit
    at gsignal.c line 3441
  • #8 VteTerminalPrivate::child_watch_done
    at vte.cc line 3390
  • #9 VteTerminalPrivate::child_watch_done
    at vte.cc line 3352
  • #10 child_watch_cb
  • #11 g_child_watch_dispatch
    at gmain.c line 5321
  • #12 g_main_dispatch
    at gmain.c line 3201
  • #13 g_main_context_dispatch
    at gmain.c line 3854
  • #14 g_main_context_iterate
    at gmain.c line 3927
  • #15 g_main_context_iteration
    at gmain.c line 3988
  • #16 g_application_run
    at gapplication.c line 2381
  • #17 main
    at server.c line 120

Comment 11 Hussam Al-Tayeb 2016-08-09 18:01:36 UTC
To reproduce, open gnome-terminal, then File -> new terminal.
In first gnome-terminal window, type exit.
Comment 12 Christian Persch 2016-08-09 19:33:15 UTC
Reverted.
Comment 13 Christian Persch 2016-08-09 19:38:09 UTC
I've disabled detaching a tab by DND for now until the gtk bug is fixed.
Comment 14 Andreas Henriksson 2016-08-10 07:12:33 UTC
(In reply to Hussam Al-Tayeb from comment #11)
> To reproduce, open gnome-terminal, then File -> new terminal.
> In first gnome-terminal window, type exit.

Fwiw, I'm not able to reproduce here on Debian testing/unstable (gnome-terminal 3.20.2-2) which includes the notebook_detach_tab patch. That's with gtk+ 3.20.7-1.
Comment 15 Christian Persch 2016-09-17 11:43:32 UTC
*** Bug 771588 has been marked as a duplicate of this bug. ***
Comment 16 Ben Gamari 2016-10-05 13:22:19 UTC
Has this supposed gtk bug been reported upstream?
Comment 17 Vlad Orlov 2016-10-07 10:49:05 UTC
Is https://bugzilla.gnome.org/show_bug.cgi?id=767588 the correct upstream bug?
A few months ago it had been reopened and, err, un-duplicated :)
Comment 18 Christian Persch 2016-11-24 17:00:57 UTC
*** Bug 775029 has been marked as a duplicate of this bug. ***
Comment 19 GNOME Infrastructure Team 2021-06-10 21:08:33 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/7683.