{"thread":{"id":"6449","subject":"SEGV in git-apply","startedAt":"2007-01-20T01:48:52Z","lastAt":"2007-01-21T18:03:46Z","messageCount":7,"participants":["Martin Waitz","Johannes Schindelin","Rogan Dawes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32130","messageId":"20070120014851.GF5231@admingilde.org","threadId":"6449","inReplyTo":null,"subject":"SEGV in git-apply","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-01-20T01:48:52Z","receivedAt":"2007-01-20T01:48:52Z","isPatch":false,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nI just hit this bug in git-apply, while executing it in a subdirectory.\nAt the moment I am using some mixture of next and some own changes\n(mostly submodule support, should not affect this bug).\n\nI am afraid that I don't have the time to fix it myself atm, so I am simply\nattaching the backtrace here:\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x080500fa in apply_patch (fd=5, filename=0xbf821b4d \"/tmp/404241.patch\",\n    inaccurate_eof=<value optimized out>) at builtin-apply.c:2504\n2504                    if (pathlen <= prefix_length ||\n(gdb) bt\n#0  0x080500fa in apply_patch (fd=5, filename=0xbf821b4d \"/tmp/404241.patch\",\n    inaccurate_eof=<value optimized out>) at builtin-apply.c:2504\n#1  0x0805147a in cmd_apply (argc=3, argv=0xbf8201e4, prefix=0x80e75c6 \"src/\")\n    at builtin-apply.c:2719\n#2  0x0804ab55 in handle_internal_command (argc=3, argv=0xbf8201e4,\n    envp=<value optimized out>) at git.c:304\n#3  0x0804b1f8 in main (argc=3, argv=Cannot access memory at address 0x8\n) at git.c:341\n\n\n-- \nMartin Waitz\n"},{"id":"32132","messageId":"Pine.LNX.4.63.0701200312000.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6449","inReplyTo":"20070120014851.GF5231@admingilde.org","subject":"Re: SEGV in git-apply","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-20T02:14:46Z","receivedAt":"2007-01-20T02:14:46Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 20 Jan 2007, Martin Waitz wrote:\n\n> Program received signal SIGSEGV, Segmentation fault.\n> 0x080500fa in apply_patch (fd=5, filename=0xbf821b4d \"/tmp/404241.patch\",\n>     inaccurate_eof=<value optimized out>) at builtin-apply.c:2504\n> 2504                    if (pathlen <= prefix_length ||\n\nIt seems that the culprit is not this line (you have an optimized binary, \nso that is expected).\n\nMy guess is that your patch does not contain a new name, neither an old \nname.\n\nIt could also be that the filename has length 0.\n\nBut without that patch I cannot tell.\n\nCiao,\nDscho\n"},{"id":"32162","messageId":"20070120183615.GA6459@admingilde.org","threadId":"6449","inReplyTo":"Pine.LNX.4.63.0701200312000.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: SEGV in git-apply","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-01-20T18:36:15Z","receivedAt":"2007-01-20T18:36:15Z","isPatch":false,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Sat, Jan 20, 2007 at 03:14:46AM +0100, Johannes Schindelin wrote:\n> But without that patch I cannot tell.\n\npatch was this one:\n\n------------------ 8< -------------------------------\n--- src/callbacks.cc\t2006-11-02 10:16:50.000000000 +0100\n+++ src/callbacks.cc\t2007-01-17 20:47:00.000000000 +0100\n@@ -12890,12 +12890,11 @@ void on_unknown_edit_optionmenu_sign_cha\n \t}\n }\n \n-gboolean on_key_press_event(GtkWidget*, GdkEventKey *event, gpointer) {\n+gboolean on_key_press_event(GtkWidget *o, GdkEventKey *event, gpointer) {\n \tif(!GTK_WIDGET_HAS_FOCUS(expression) && (event->keyval > GDK_Hyper_R || event->keyval < GDK_Shift_L)) {\n-\t\tbool return_val = FALSE;\n \t\tGtkWidget *w = gtk_window_get_focus(GTK_WINDOW(glade_xml_get_widget (main_glade, \"main_window\")));\n-\t\tif(w) g_signal_emit_by_name((gpointer) w, \"key_press_event\", event, &return_val);\n-\t\tif(return_val) return TRUE;\n+\t\tif(gtk_bindings_activate_event(GTK_OBJECT(o), event)) return TRUE;\n+\t\tif(w && gtk_bindings_activate_event(GTK_OBJECT(w), event)) return TRUE;\n \t\tfocus_keeping_selection();\n \t}\n \treturn FALSE;\n------------------ 8< -------------------------------\n\ngit-apply inside the \"src\" directory segfaulted.\n\n-- \nMartin Waitz\n"},{"id":"32182","messageId":"Pine.LNX.4.63.0701210212410.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6449","inReplyTo":"20070120183615.GA6459@admingilde.org","subject":"[PATCH] apply --cached: fix crash in subdirectory","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-21T01:17:19Z","receivedAt":"2007-01-21T01:17:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe static variable \"prefix\" was shadowed by an unused parameter\nof the same name. In case of execution in a subdirectory, the\nstatic variable was accessed, leading to a crash.\n\nSigned-off-by: Knoppix User <knoppix@zweitrechner.(none)>\n---\n\n\tOn Sat, 20 Jan 2007, Martin Waitz wrote:\n\t\n\t> git-apply inside the \"src\" directory segfaulted.\n\n\tWell, that was not the complete truth now, was it? Cannily, you \n\tavoided mentioning the use of the \"--cached\" argument...\n\n\tBut as you see, your evil plan failed ;-)\n\n builtin-apply.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-apply.c b/builtin-apply.c\nindex 54fd2cb..ef927f8 100644\n--- a/builtin-apply.c\n+++ b/builtin-apply.c\n@@ -2589,7 +2589,7 @@ static int git_apply_config(const char *var, const char *value)\n }\n \n \n-int cmd_apply(int argc, const char **argv, const char *prefix)\n+int cmd_apply(int argc, const char **argv, const char *prefix2)\n {\n \tint i;\n \tint read_stdin = 1;\n-- \n1.5.0.rc1.gd85c\n"},{"id":"32209","messageId":"20070121144050.GB6459@admingilde.org","threadId":"6449","inReplyTo":"Pine.LNX.4.63.0701210212410.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] apply --cached: fix crash in subdirectory","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2007-01-21T14:40:50Z","receivedAt":"2007-01-21T14:40:50Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Sun, Jan 21, 2007 at 02:17:19AM +0100, Johannes Schindelin wrote:\n> \tOn Sat, 20 Jan 2007, Martin Waitz wrote:\n> \t\n> \t> git-apply inside the \"src\" directory segfaulted.\n> \n> \tWell, that was not the complete truth now, was it? Cannily, you \n> \tavoided mentioning the use of the \"--cached\" argument...\n\nYou are right.  I forgot to mention that in the bug report.\nWell, I was in a hurry...\n\nThanks for being faster in fixing the bug than I am in getting some\nspare time!\n\n> \tBut as you see, your evil plan failed ;-)\n\nDamn!\nI'll need a better plan next time...\n\n;-)\n\n-- \nMartin Waitz\n"},{"id":"32213","messageId":"45B39928.20709@dawes.za.net","threadId":"6449","inReplyTo":"Pine.LNX.4.63.0701210212410.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] apply --cached: fix crash in subdirectory","fromName":"Rogan Dawes","fromEmail":"discard@dawes.za.net","sentAt":"2007-01-21T16:47:36Z","receivedAt":"2007-01-21T16:47:36Z","isPatch":true,"sender":{"key":"discard@dawes.za.net","avatar":null},"body":"Johannes Schindelin wrote:\n\n> \n> Signed-off-by: Knoppix User <knoppix@zweitrechner.(none)>\n\nReally?\n"},{"id":"32214","messageId":"Pine.LNX.4.63.0701211902590.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6449","inReplyTo":"45B39928.20709@dawes.za.net","subject":"Re: [PATCH] apply --cached: fix crash in subdirectory","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-21T18:03:46Z","receivedAt":"2007-01-21T18:03:46Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 21 Jan 2007, Rogan Dawes wrote:\n\n> Johannes Schindelin wrote:\n> \n> > \n> > Signed-off-by: Knoppix User <knoppix@zweitrechner.(none)>\n> \n> Really?\n\nNo :-)\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nYou got me there; I use this machine rarely for development.\n\nCiao,\nDscho\n"}]}