git cherry(pick) dumps core

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andreas Krey
Date: Thursday, April 29, 2010 - 12:11 pm

Hi,

I just have a case of git cherry-pick dieing with a core dump.
The directly offending lines are get_message() in buildin/revert.c:

	if ((out->reencoded_message = reencode_string(raw_message,
					git_commit_encoding, encoding)))
		out->message = out->reencoded_message;

	abbrev = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
	abbrev_len = strlen(abbrev);

	/* Find beginning and end of commit subject. */
	p = out->message;
	while (*p && (*p != '\n' || p[1] != '\n'))

and out->message is null at that point.

It looks like reencode_string is returning NULL,
and get_message can't quite cope with that.

This is in v1.7.1 (plus a few mods in git-daemon.c).

I suppose it is a failing of iconv_open, as this is
on sparc SunOS 5.9, but the reaction is a bit harsh.

Unfortunately the debugger is giving me strange
results, like:

434             if (!in_encoding)
(gdb) next
436             conv = iconv_open(out_encoding, in_encoding);
(gdb) print conv
$3 = 0x1003f8
(gdb) next
437             if (conv == (iconv_t) -1)
(gdb) print conv
$4 = 0x1003f8
(gdb) step
474     }

and the disasembly is just as counter-intuitive (with the branch targets).

Andreas
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Proper way to abort incorrect cherry-picking?, Eugene Sajine, (Wed Apr 28, 12:38 pm)
Re: Proper way to abort incorrect cherry-picking?, David Borowitz, (Wed Apr 28, 12:49 pm)
Re: Proper way to abort incorrect cherry-picking?, Jonathan Nieder, (Wed Apr 28, 12:50 pm)
Re: Proper way to abort incorrect cherry-picking?, Eugene Sajine, (Wed Apr 28, 12:59 pm)
Re: Proper way to abort incorrect cherry-picking?, Eugene Sajine, (Wed Apr 28, 1:05 pm)
Re: Proper way to abort incorrect cherry-picking?, Jon Seymour, (Wed Apr 28, 3:39 pm)
Re: Proper way to abort incorrect cherry-picking?, Jonathan Nieder, (Wed Apr 28, 4:37 pm)
Re: Proper way to abort incorrect cherry-picking?, Jon Seymour, (Wed Apr 28, 5:07 pm)
git cherry(pick) dumps core, Andreas Krey, (Thu Apr 29, 12:11 pm)
Re: git cherry(pick) dumps core, Jonathan Nieder, (Thu Apr 29, 12:49 pm)
Re: git cherry(pick) dumps core, Andreas Krey, (Thu Apr 29, 1:21 pm)
Re: git cherry(pick) dumps core, Jonathan Nieder, (Fri Apr 30, 6:32 am)
[PATCH] cherry-pick: do not dump core when iconv fails, Jonathan Nieder, (Sat May 8, 4:17 pm)