* SEGV in git-apply
@ 2007-01-20 1:48 Martin Waitz
2007-01-20 2:14 ` Johannes Schindelin
0 siblings, 1 reply; 7+ messages in thread
From: Martin Waitz @ 2007-01-20 1:48 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]
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
--
Martin Waitz
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: SEGV in git-apply
2007-01-20 1:48 SEGV in git-apply Martin Waitz
@ 2007-01-20 2:14 ` Johannes Schindelin
2007-01-20 18:36 ` Martin Waitz
0 siblings, 1 reply; 7+ messages in thread
From: Johannes Schindelin @ 2007-01-20 2:14 UTC (permalink / raw)
To: Martin Waitz; +Cc: git
Hi,
On Sat, 20 Jan 2007, Martin Waitz wrote:
> 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 ||
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: SEGV in git-apply
2007-01-20 2:14 ` Johannes Schindelin
@ 2007-01-20 18:36 ` Martin Waitz
2007-01-21 1:17 ` [PATCH] apply --cached: fix crash in subdirectory Johannes Schindelin
0 siblings, 1 reply; 7+ messages in thread
From: Martin Waitz @ 2007-01-20 18:36 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]
hoi :)
On Sat, Jan 20, 2007 at 03:14:46AM +0100, Johannes Schindelin wrote:
> But without that patch I cannot tell.
patch was this one:
------------------ 8< -------------------------------
--- src/callbacks.cc 2006-11-02 10:16:50.000000000 +0100
+++ src/callbacks.cc 2007-01-17 20:47:00.000000000 +0100
@@ -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.
--
Martin Waitz
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] apply --cached: fix crash in subdirectory
2007-01-20 18:36 ` Martin Waitz
@ 2007-01-21 1:17 ` Johannes Schindelin
2007-01-21 14:40 ` Martin Waitz
2007-01-21 16:47 ` Rogan Dawes
0 siblings, 2 replies; 7+ messages in thread
From: Johannes Schindelin @ 2007-01-21 1:17 UTC (permalink / raw)
To: Martin Waitz; +Cc: git, junkio
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.
Signed-off-by: Knoppix User <knoppix@zweitrechner.(none)>
---
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(-)
diff --git a/builtin-apply.c b/builtin-apply.c
index 54fd2cb..ef927f8 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -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;
--
1.5.0.rc1.gd85c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] apply --cached: fix crash in subdirectory
2007-01-21 1:17 ` [PATCH] apply --cached: fix crash in subdirectory Johannes Schindelin
@ 2007-01-21 14:40 ` Martin Waitz
2007-01-21 16:47 ` Rogan Dawes
1 sibling, 0 replies; 7+ messages in thread
From: Martin Waitz @ 2007-01-21 14:40 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 616 bytes --]
hoi :)
On Sun, Jan 21, 2007 at 02:17:19AM +0100, Johannes Schindelin wrote:
> 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!
> But as you see, your evil plan failed ;-)
Damn!
I'll need a better plan next time...
;-)
--
Martin Waitz
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] apply --cached: fix crash in subdirectory
2007-01-21 1:17 ` [PATCH] apply --cached: fix crash in subdirectory Johannes Schindelin
2007-01-21 14:40 ` Martin Waitz
@ 2007-01-21 16:47 ` Rogan Dawes
2007-01-21 18:03 ` Johannes Schindelin
1 sibling, 1 reply; 7+ messages in thread
From: Rogan Dawes @ 2007-01-21 16:47 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, junkio
Johannes Schindelin wrote:
>
> Signed-off-by: Knoppix User <knoppix@zweitrechner.(none)>
Really?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] apply --cached: fix crash in subdirectory
2007-01-21 16:47 ` Rogan Dawes
@ 2007-01-21 18:03 ` Johannes Schindelin
0 siblings, 0 replies; 7+ messages in thread
From: Johannes Schindelin @ 2007-01-21 18:03 UTC (permalink / raw)
To: Rogan Dawes; +Cc: git, junkio
Hi,
On Sun, 21 Jan 2007, Rogan Dawes wrote:
> Johannes Schindelin wrote:
>
> >
> > Signed-off-by: Knoppix User <knoppix@zweitrechner.(none)>
>
> Really?
No :-)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
You got me there; I use this machine rarely for development.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-01-21 18:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-20 1:48 SEGV in git-apply Martin Waitz
2007-01-20 2:14 ` Johannes Schindelin
2007-01-20 18:36 ` Martin Waitz
2007-01-21 1:17 ` [PATCH] apply --cached: fix crash in subdirectory Johannes Schindelin
2007-01-21 14:40 ` Martin Waitz
2007-01-21 16:47 ` Rogan Dawes
2007-01-21 18:03 ` Johannes Schindelin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.