All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Bill Lear <rael@zopyra.com>
Cc: git@vger.kernel.org
Subject: Re: Meaning of "fatal: protocol error: bad line length character"?
Date: Sat, 20 Jan 2007 11:24:54 -0800	[thread overview]
Message-ID: <7vk5zh7b7d.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <17842.1385.366750.915767@lisa.zopyra.com> (Bill Lear's message of "Sat, 20 Jan 2007 06:04:57 -0600")

Bill Lear <rael@zopyra.com> writes:

> % git push
> updating 'refs/heads/master'
>   from 6b421066e842203e383e1dc466c1cdef10de56b1
>   to   2a8e554ae0c99d44988690c9fce693b3f5f128fa
> Generating pack...
> Done counting 61 objects.
> Result has 32 objects.
> Deltifying 32 objects.
>  100% (32/32) done
> Writing 32 objects.
>  100% (32/32) done
> Total 32, written 32 (delta 18), reused 0 (delta 0)
> Unpacking 32 objects
> fatal: protocol error: bad line length character
>
> The notion of fatality led him to think, quite plausibly, that
> something very bad had happened with his push.  However, we can find
> no evidence that anything bad really did happen.

I've seen this "bad line length character" mentioned in #git and
on this list but nobody seems to have hunted down what this is.

	http://www.gelato.unsw.edu.au/archives/git/0603/17807.html

is another (Google finds some others for the error message on
xcb list but that is about fetch-pack which is totally different
codepath).

Your report and the above one both mention there was no harm,
which is somewhat of consolation but it definitely is not a good
sign.

I've tried to reproduce it, suspecting it could be some
interaction with hook scripts output, without success.

I've committed the following to 'master' so that when it
reproduces we could have a slightly better clue on what we are
getting instead of what we are expecting.

diff --git a/pkt-line.c b/pkt-line.c
index b4cb7e2..369eec9 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -81,13 +81,13 @@ int packet_read_line(int fd, char *buffer, unsigned size)
 {
 	int n;
 	unsigned len;
-	char linelen[4];
+	unsigned char linelen[4];
 
-	safe_read(fd, linelen, 4);
+	safe_read(fd, (char *)linelen, 4);
 
 	len = 0;
 	for (n = 0; n < 4; n++) {
-		unsigned char c = linelen[n];
+		char c = linelen[n];
 		len <<= 4;
 		if (c >= '0' && c <= '9') {
 			len += c - '0';
@@ -101,7 +101,9 @@ int packet_read_line(int fd, char *buffer, unsigned size)
 			len += c - 'A' + 10;
 			continue;
 		}
-		die("protocol error: bad line length character");
+		die("protocol error: bad line length character: "
+		    "%02x %02x %02x %02x",
+		    linelen[0], linelen[1], linelen[2], linelen[3]);
 	}
 	if (!len)
 		return 0;

  reply	other threads:[~2007-01-20 19:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-20 12:04 Meaning of "fatal: protocol error: bad line length character"? Bill Lear
2007-01-20 19:24 ` Junio C Hamano [this message]
2007-01-20 19:33   ` Junio C Hamano
2007-01-20 19:54     ` Bill Lear
2007-01-20 20:07       ` Jakub Narebski
2007-01-20 20:20       ` Junio C Hamano
2007-01-20 20:42         ` Junio C Hamano
2007-01-20 21:37           ` Shawn O. Pearce
2007-01-22 20:15             ` Junio C Hamano
2007-01-22 18:58           ` Bill Lear
2007-01-22 19:45             ` Junio C Hamano
2007-01-22 19:55               ` Bill Lear
2007-01-22 22:16                 ` Bill Lear
2007-01-22 22:33                   ` Junio C Hamano
2007-01-23  0:14   ` Han-Wen Nienhuys
2007-01-23  0:44     ` Junio C Hamano
2007-01-23  0:53       ` Han-Wen Nienhuys

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vk5zh7b7d.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=rael@zopyra.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.