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 677696 - Segfault when staging individual hunks
Segfault when staging individual hunks
Status: RESOLVED FIXED
Product: gitg
Classification: Applications
Component: gui
0.2.x
Other Linux
: Normal critical
: ---
Assigned To: gitg-maint
gitg-maint
Depends on:
Blocks:
 
 
Reported: 2012-06-08 11:37 UTC by Kjo Hansi Glaz
Modified: 2013-06-06 11:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that fixes the issue for Adrian Knoth (526 bytes, patch)
2012-06-08 11:37 UTC, Kjo Hansi Glaz
none Details | Review

Description Kjo Hansi Glaz 2012-06-08 11:37:32 UTC
Created attachment 215934 [details] [review]
patch that fixes the issue for Adrian Knoth

On Debian bug #674001 Adrian Knoth <adi@drcomp.erfurt.thur.de> reported:

Recently (maybe after the introduction of GTK3 in Debian), gitg has
started to crash when staging individual hunks.

Here's the backtrace. Obviously, the iter variable is not set.
Without carefully reading the source code, I came up with the attached
patch that fixes the issue for me, but maybe the upstream author wants
to have a look and propose a better solution, if any.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff76ed660 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
(gdb) bt
  • #0 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #1 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #2 gtk_text_iter_get_line
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #3 gitg_diff_view_get_header_at_iter
    at gitg-diff-view.c line 1404
  • #4 get_patch_header
    at gitg-commit-view.c line 675
  • #5 get_hunk_patch
    at gitg-commit-view.c line 711
  • #6 handle_stage_unstage
    at gitg-commit-view.c line 922
  • #7 on_stage_changes
    at gitg-commit-view.c line 2257
  • #8 g_closure_invoke
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #9 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #10 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #11 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #12 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #13 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #14 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #15 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #16 gtk_widget_activate
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #17 gtk_menu_shell_activate_item
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #18 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #19 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #20 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #21 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #22 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #23 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #24 ??
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #25 gtk_main_do_event
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #26 ??
    from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
  • #27 g_main_context_dispatch
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #28 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #29 g_main_loop_run
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #30 gtk_main
    from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
  • #31 main
    at gitg.c line 206
  • #3 gitg_diff_view_get_header_at_iter
    at gitg-diff-view.c line 1404
1399            if (!view->priv->diff_enabled)
1400            {
1401                    return FALSE;
1402            }
1403
1404            ensure_scan (view, gtk_text_iter_get_line (iter));
1405
1406            Region *region = find_current_region (view, gtk_text_iter_get_line (iter));
1407
1408            while (region && region->type == GITG_DIFF_ITER_TYPE_HUNK)
(gdb) p iter
$1 = (const GtkTextIter *) 0x8021f8
(gdb) p view
$2 = (GitgDiffView *) 0x818110
(gdb) p *iter
$3 = {dummy1 = 0x0, dummy2 = 0x0, dummy3 = 0, dummy4 = 0, dummy5 = 0, 
  dummy6 = 0, dummy7 = 0, dummy8 = 0, dummy9 = 0x0, dummy10 = 0x0, 
  dummy11 = 0, dummy12 = 0, dummy13 = 0, dummy14 = 0x0}



-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.2 (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gitg depends on:
ii  dbus-x11                                     1.5.12-1
ii  dconf-gsettings-backend [gsettings-backend]  0.12.1-1
ii  git                                          1:1.7.10-1
ii  gsettings-desktop-schemas                    3.4.2-1
ii  libatk1.0-0                                  2.4.0-2
ii  libc6                                        2.13-32
ii  libcairo-gobject2                            1.12.2-2
ii  libcairo2                                    1.12.2-2
ii  libdconf0                                    0.12.1-1
ii  libgdk-pixbuf2.0-0                           2.26.1-1
ii  libglib2.0-0                                 2.32.3-1
ii  libgtk-3-0                                   3.4.2-1
ii  libgtksourceview-3.0-0                       3.4.2-1
ii  libpango1.0-0                                1.30.0-1

gitg recommends no packages.

gitg suggests no packages.

-- no debconf information
Comment 1 Dmitry Smirnov 2013-06-06 11:14:17 UTC
Please close this bug report. It turned out that the problem was introduced by defective patch to replace deprecated "gdk_window_get_pointer". No action is required as newer versions of `gitg` are not affected. Thanks.
Comment 2 Ignacio Casal Quinteiro (nacho) 2013-06-06 11:16:15 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.