SEGV in git-apply
hoi :)
I just hit this bug in git-apply, while executing it in a subdirectory. At the moment I am using some mixture of next and some own changes (mostly submodule support, should not affect this bug).
I am afraid that I don't have the time to fix it myself atm, so I am simply attaching the backtrace here:
Program received signal SIGSEGV, Segmentation fault.0x080500fa in apply_patch (fd=5, filename=0xbf821b4d "/tmp/404241.patch",
inaccurate_eof=<value optimized out>) at builtin-apply.c:2504
2504 if (pathlen <= prefix_length ||
(gdb) bt
#0 0x080500fa in apply_patch (fd=5, filename=0xbf821b4d "/tmp/404241.patch",
inaccurate_eof=<value optimized out>) at builtin-apply.c:2504
#1 0x0805147a in cmd_apply (argc=3, argv=0xbf8201e4, prefix=0x80e75c6 "src/")
at builtin-apply.c:2719
#2 0x0804ab55 in handle_internal_command (argc=3, argv=0xbf8201e4,
envp=<value optimized out>) at git.c:304
#3 0x0804b1f8 in main (argc=3, argv=Cannot access memory at address 0x8 ) at git.c:341
Signature · 1 line
Martin Waitz
Hi,
Quoted 4 lines · Martin Waitz
Program received signal SIGSEGV, Segmentation fault.
0x080500fainapply_patch(fd=5, filename=0xbf821b4d "/tmp/404241.patch",
inaccurate_eof=<value optimized out>) at builtin-apply.c:2504
2504 if (pathlen <=prefix_length||
It seems that the culprit is not this line (you have an optimized binary, so that is expected).
My guess is that your patch does not contain a new name, neither an old name.
It could also be that the filename has length 0.
But without that patch I cannot tell.
Ciao,
Dscho
hoi :)
Quoted 1 line · Johannes Schindelin
But without that patch I cannot tell.
patch was this one:
------------------ 8< -------------------------------
callbacks.cc +3 -4
@@ -12890,12 +12890,11 @@ void on_unknown_edit_optionmenu_sign_cha } } -gboolean on_key_press_event(GtkWidget*, GdkEventKey *event, gpointer) { +gboolean on_key_press_event(GtkWidget *o, GdkEventKey *event, gpointer) { if(!GTK_WIDGET_HAS_FOCUS(expression) && (event->keyval > GDK_Hyper_R || event->keyval < GDK_Shift_L)) { - bool return_val = FALSE; GtkWidget *w = gtk_window_get_focus(GTK_WINDOW(glade_xml_get_widget (main_glade, "main_window"))); - if(w) g_signal_emit_by_name((gpointer) w, "key_press_event", event, &return_val); - if(return_val) return TRUE; + if(gtk_bindings_activate_event(GTK_OBJECT(o), event)) return TRUE; + if(w && gtk_bindings_activate_event(GTK_OBJECT(w), event)) return TRUE; focus_keeping_selection(); } return FALSE;
------------------ 8< -------------------------------
git-apply inside the "src" directory segfaulted.
Signature · 1 line
Martin Waitz
PATCH 1/1 apply --cached: fix crash in subdirectory
The static variable "prefix" was shadowed by an unused parameter of the same name. In case of execution in a subdirectory, the static variable was accessed, leading to a crash.
---
On Sat, 20 Jan 2007, Martin Waitz wrote:
> git-apply inside the "src" directory segfaulted.
Well, that was not the complete truth now, was it? Cannily, you avoided mentioning the use of the "--cached" argument...
But as you see, your evil plan failed ;-)
builtin-apply.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
builtin-apply.c +1 -1
@@ -2589,7 +2589,7 @@ static int git_apply_config(const char *var, const char *value) } -int cmd_apply (int argc,const char **argv,const char *prefix) +int cmd_apply (int argc,const char **argv,const char *prefix2) {int i;int read_stdin =1 ;
Signature · 1 line
1.5.0.rc1.gd85c
Re: [PATCH] apply --cached: fix crash in subdirectory
hoi :)
Quoted 6 lines · Johannes Schindelin
On Sat, 20 Jan 2007, Martin Waitz wrote:
> git-apply inside the "src" directory segfaulted.
Well, that was not the complete truth now, was it? Cannily, you avoided mentioning the use of the "--cached" argument...
You are right. I forgot to mention that in the bug report. Well, I was in a hurry...
Thanks for being faster in fixing the bug than I am in getting some spare time!
Quoted 1 line
But as you see, your evil plan failed ;-)
Damn!
I'll need a better plan next time...
;-)
Signature · 1 line
Martin Waitz
Re: [PATCH] apply --cached: fix crash in subdirectory
In reply to Johannes SchindelinQuoted 2 lines · Johannes Schindelin
Signed-off-by Knoppix User <knoppix@zweitrechner.(none)>
Really?
Re: [PATCH] apply --cached: fix crash in subdirectory
Hi,
Quoted 6 lines · Rogan Dawes
Quoted 2 lines · Johannes Schindelin
Signed-off-by Knoppix User <knoppix@zweitrechner.(none)>Really?
No :-)
You got me there; I use this machine rarely for development.
Ciao,
Dscho