{"thread":{"id":"8199","subject":"git-rebase (1.5.0.6) errors","startedAt":"2007-05-18T08:47:18Z","lastAt":"2007-05-20T19:02:29Z","messageCount":9,"participants":["Ilpo Järvinen","Paolo Teti","David Kastrup","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"42455","messageId":"Pine.LNX.4.64.0705181130570.28356@kivilampi-30.cs.helsinki.fi","threadId":"8199","inReplyTo":null,"subject":"git-rebase (1.5.0.6) errors","fromName":"Ilpo Järvinen","fromEmail":"ilpo.jarvinen@helsinki.fi","sentAt":"2007-05-18T08:47:18Z","receivedAt":"2007-05-18T08:47:18Z","isPatch":false,"sender":{"key":"ilpo.jarvinen@helsinki.fi","avatar":null},"body":"Hi,\n\n\nijjarvin@kivilampi-30:~/work/src/submit$ git-rebase net-2.6.22-origin\nFirst, rewinding head to replay your work on top of it...\nHEAD is now at d739437... [IPV4]: Correct rp_filter help text.\nfatal: cannot convert from utf-8 to utf-8\n\nijjarvin@kivilampi-30:~/work/src/submit$ git-log -n 1 | cat\ncommit d739437207064cdcea8f9c81442284106cbcb67f\nAuthor: Dave Jones <davej@redhat.com>\nDate:   Thu May 17 15:02:21 2007 -0700\n\n    [IPV4]: Correct rp_filter help text.\n    \n    As mentioned in http://bugzilla.kernel.org/show_bug.cgi?id=5015\n    The helptext implies that this is on by default.\n    This may be true on some distros (Fedora/RHEL have it enabled\n    in /etc/sysctl.conf), but the kernel defaults to it off.\n    \n    Signed-off-by: Dave Jones <davej@redhat.com>\n    Signed-off-by: David S. Miller <davem@davemloft.net>\nijjarvin@kivilampi-30:~/work/src/submit$ git-rebase --abort\nHEAD is now at e413863... [TCP] FRTO: Add missing ECN CWR sending to one of the responses\nijjarvin@kivilampi-30:~/work/src/submit$ git --version\ngit version 1.5.0.6\n\n\nI find at least two problems in it...\n  - Non-sense error message: \"convert from utf-8 to utf-8\" ?!?\n  - It fails to rebase the e413863 changeset\n\n\n\n-- \n i.\n"},{"id":"42464","messageId":"34a7ae040705180331x1a86782fh3b2c6a87db32030e@mail.gmail.com","threadId":"8199","inReplyTo":"Pine.LNX.4.64.0705181130570.28356@kivilampi-30.cs.helsinki.fi","subject":"Re: git-rebase (1.5.0.6) errors","fromName":"Paolo Teti","fromEmail":"paolo.teti@gmail.com","sentAt":"2007-05-18T10:31:51Z","receivedAt":"2007-05-18T10:31:51Z","isPatch":false,"sender":{"key":"paolo.teti@gmail.com","avatar":null},"body":"2007/5/18, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>:\n> Hi,\n>\n>\n> ijjarvin@kivilampi-30:~/work/src/submit$ git-rebase net-2.6.22-origin\n> First, rewinding head to replay your work on top of it...\n> HEAD is now at d739437... [IPV4]: Correct rp_filter help text.\n> fatal: cannot convert from utf-8 to utf-8\n\n\nNow I can't test or try to reproduce your error,\nbut looking at the source code (only with gitweb)\nI have found another bad use of size_t instead of ssize_t\nin the reencode_string(..) that take part at the conversion process.\n\nUsing size_t in the next portion of code the check \"count == -1\" is never true.\n\nwhile (1) {\n\t\tsize_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz);\n\n\t\tif (cnt == -1) {\n\t\t\tsize_t sofar;\n\t\t\tif (errno != E2BIG) {\n\t\t\t\tfree(out);\n\t\t\t\ticonv_close(conv);\n\t\t\t\treturn NULL;\n\t\t\t}\n\n\nPlease someone could fixes this bad use of size_t?..\n\nSorry, but now I can't install/use git because I'm on a customer workstation..\n"},{"id":"42466","messageId":"86y7jmmmnq.fsf@lola.quinscape.zz","threadId":"8199","inReplyTo":"34a7ae040705180331x1a86782fh3b2c6a87db32030e@mail.gmail.com","subject":"Re: git-rebase (1.5.0.6) errors","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-05-18T10:49:45Z","receivedAt":"2007-05-18T10:49:45Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"\"Paolo Teti\" <paolo.teti@gmail.com> writes:\n\n> 2007/5/18, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>:\n>> Hi,\n>>\n>>\n>> ijjarvin@kivilampi-30:~/work/src/submit$ git-rebase net-2.6.22-origin\n>> First, rewinding head to replay your work on top of it...\n>> HEAD is now at d739437... [IPV4]: Correct rp_filter help text.\n>> fatal: cannot convert from utf-8 to utf-8\n>\n>\n> Now I can't test or try to reproduce your error,\n> but looking at the source code (only with gitweb)\n> I have found another bad use of size_t instead of ssize_t\n> in the reencode_string(..) that take part at the conversion process.\n>\n> Using size_t in the next portion of code the check \"count == -1\" is\n> never true.\n\nOnly if size_t is a larger type than int (could be on x86-64 and alpha\narchitectures).  Other than that, this comparison would work.  Which\ndoes not mean that this does not warrant fixing, but it is not\nnecessarily the cause of this problem.\n\n>\n> while (1) {\n> \t\tsize_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz);\n>\n> \t\tif (cnt == -1) {\n> \t\t\tsize_t sofar;\n> \t\t\tif (errno != E2BIG) {\n> \t\t\t\tfree(out);\n> \t\t\t\ticonv_close(conv);\n> \t\t\t\treturn NULL;\n> \t\t\t}\n>\n>\n> Please someone could fixes this bad use of size_t?..\n\n-- \nDavid Kastrup\n"},{"id":"42469","messageId":"34a7ae040705180429w454e900cp12426e7164725d45@mail.gmail.com","threadId":"8199","inReplyTo":"86y7jmmmnq.fsf@lola.quinscape.zz","subject":"Re: git-rebase (1.5.0.6) errors","fromName":"Paolo Teti","fromEmail":"paolo.teti@gmail.com","sentAt":"2007-05-18T11:29:44Z","receivedAt":"2007-05-18T11:29:44Z","isPatch":false,"sender":{"key":"paolo.teti@gmail.com","avatar":null},"body":"2007/5/18, David Kastrup <dak@gnu.org>:\n> \"Paolo Teti\" <paolo.teti@gmail.com> writes:\n>\n> > 2007/5/18, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>:\n> >> Hi,\n> >>\n> >>\n> >> ijjarvin@kivilampi-30:~/work/src/submit$ git-rebase net-2.6.22-origin\n> >> First, rewinding head to replay your work on top of it...\n> >> HEAD is now at d739437... [IPV4]: Correct rp_filter help text.\n> >> fatal: cannot convert from utf-8 to utf-8\n> >\n> >\n> > Now I can't test or try to reproduce your error,\n> > but looking at the source code (only with gitweb)\n> > I have found another bad use of size_t instead of ssize_t\n> > in the reencode_string(..) that take part at the conversion process.\n> >\n> > Using size_t in the next portion of code the check \"count == -1\" is\n> > never true.\n>\n> Only if size_t is a larger type than int (could be on x86-64 and alpha\n> architectures).  Other than that, this comparison would work.  Which\n> does not mean that this does not warrant fixing, but it is not\n> necessarily the cause of this problem.\n\n1. Yes this is not necessarily the cause.. I agree.\n\n2. size_t as I know is unsigned and ssize_t is the signed version of\nsize_t.. so to\n    compare with -1 we want ssize_t.\n"},{"id":"42485","messageId":"Pine.LNX.4.64.0705181640270.14736@kivilampi-30.cs.helsinki.fi","threadId":"8199","inReplyTo":"34a7ae040705180331x1a86782fh3b2c6a87db32030e@mail.gmail.com","subject":"Re: git-rebase (1.5.0.6) errors","fromName":"Ilpo Järvinen","fromEmail":"ilpo.jarvinen@helsinki.fi","sentAt":"2007-05-18T14:02:56Z","receivedAt":"2007-05-18T14:02:56Z","isPatch":false,"sender":{"key":"ilpo.jarvinen@helsinki.fi","avatar":null},"body":"David Kastrup <dak@gnu.org> wrote:\n\n> Only if size_t is a larger type than int (could be on x86-64 and alpha\n> architectures).  Other than that, this comparison would work.  Which\n> does not mean that this does not warrant fixing, but it is not\n> necessarily the cause of this problem.\n\n...sizeof(size_t) == sizeof(int) should hold...\n\nAnyway, if this has any relevance: I'm using non-utf system, and (as you \nsee) my surname has ä... The system was recently upgraded to git 1.5+ \nwhich started to complain also about a missing i18n.commitencoding, \nfigured out that when I set it to utf8 (empty => defaults to it) and have \nsigned-off line (with native non-utf ä), I get that error...\n\n...and please, do not drop me from cc since I'm not subscribed...\n\n-- \n i."},{"id":"42487","messageId":"34a7ae040705180739i38d4853ci95717407e81add7b@mail.gmail.com","threadId":"8199","inReplyTo":"Pine.LNX.4.64.0705181640270.14736@kivilampi-30.cs.helsinki.fi","subject":"Re: git-rebase (1.5.0.6) errors","fromName":"Paolo Teti","fromEmail":"paolo.teti@gmail.com","sentAt":"2007-05-18T14:39:46Z","receivedAt":"2007-05-18T14:39:46Z","isPatch":false,"sender":{"key":"paolo.teti@gmail.com","avatar":null},"body":"2007/5/18, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>:\n\n> ...sizeof(size_t) == sizeof(int) should hold...\n\nwhat I have reported is not necessarily the cause of your error. Yes\n\nBUT size_t is UNSIGNED and ssize_t is SIGNED.\n\nThe problem is that We store a signed return value into a unsigned variable.\nSo the check against -1 has no sense.\n\nand please note that also sizeof(int) == sizeof(unsigned int), but -1\nis a signed int !!\n\nI repeat: this is not necessarily the cause of your error.\n"},{"id":"42488","messageId":"34a7ae040705180808t1eebd9f0p5a4046d7b281c56e@mail.gmail.com","threadId":"8199","inReplyTo":"864pmamb6b.fsf@lola.quinscape.zz","subject":"Re: git-rebase (1.5.0.6) errors","fromName":"Paolo Teti","fromEmail":"paolo.teti@gmail.com","sentAt":"2007-05-18T15:08:02Z","receivedAt":"2007-05-18T15:08:02Z","isPatch":false,"sender":{"key":"paolo.teti@gmail.com","avatar":null},"body":"2007/5/18, David Kastrup <dak@gnu.org>:\n> \"Paolo Teti\" <paolo.teti@gmail.com> writes:\n>\n> > 2007/5/18, Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>:\n> >\n> >> ...sizeof(size_t) == sizeof(int) should hold...\n> >\n> > what I have reported is not necessarily the cause of your error. Yes\n> >\n> > BUT size_t is UNSIGNED and ssize_t is SIGNED.\n> >\n> > The problem is that We store a signed return value into a unsigned variable.\n> > So the check against -1 has no sense.\n>\n> When comparing signed with unsigned types, the signed values are first\n> converted to unsigned, then possibly zero-extended.\n>\n> So\n>\n> (unsigned)-1 == (int)-1\n>\n> but\n>\n> (unsigned long)-1 == (long)-1\n>\n> only when sizeof(long)==size(int)\n>\n> > and please note that also sizeof(int) == sizeof(unsigned int), but\n> > -1 is a signed int !!\n>\n> So?\n>\n\nStupid me.. OK is == -1 and not < 0..\n\nProbably today  I'm drunk without drink ..\n\nEnjoy\n"},{"id":"42706","messageId":"20070520124345.GB27087@efreet.light.src","threadId":"8199","inReplyTo":"Pine.LNX.4.64.0705181640270.14736@kivilampi-30.cs.helsinki.fi","subject":"Re: git-rebase (1.5.0.6) errors","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-05-20T12:43:45Z","receivedAt":"2007-05-20T12:43:45Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Fri, May 18, 2007 at 17:02:56 +0300, Ilpo Järvinen wrote:\n> David Kastrup <dak@gnu.org> wrote:\n> \n> > Only if size_t is a larger type than int (could be on x86-64 and alpha\n> > architectures).  Other than that, this comparison would work.  Which\n> > does not mean that this does not warrant fixing, but it is not\n> > necessarily the cause of this problem.\n> \n> ...sizeof(size_t) == sizeof(int) should hold...\n\nReally?\n\n$ cat test.c\n#include <stdio.h>\nint main(void)\n{\n    printf(\"sizeof(int) = %i\\n\", sizeof(int));\n    printf(\"sizeof(long) = %i\\n\", sizeof(long));\n    printf(\"sizeof(size_t) = %i\\n\", sizeof(size_t));\n    return 0;\n}\n$ gcc -otest test.c\n$ ./test\nsizeof(int) = 4\nsizeof(long) = 8\nsizeof(size_t) = 8\n\nHm, it does not seem that sizeof(size_t) == sizeof(int).\n\n$ uname -m\nx86_64\n\nYes, this is a 64-bit system.\n\nAnyway, comparing it with -1 is ALWAYS OK in spite of this!\n\n$ cat test2.c\n#include <stdio.h>\nint main(void)\n{\n    size_t x = 0;\n    --x;\n    printf(\"x = 0x%lx\\n\", x);\n    printf(\"(x == -1) = %i\\n\", (x == -1));\n    return 0;\n}\n$ gcc -otest2 test2.c\n$ ./test2\nx = 0xffffffffffffffff\n(x == -1) = 1\n\nSo at least with gcc that comparison is OK anyway. There has to be something\nelse that causes that problem.\n\n> Anyway, if this has any relevance: I'm using non-utf system, and (as you \n> see) my surname has ä... The system was recently upgraded to git 1.5+ \n> which started to complain also about a missing i18n.commitencoding, \n> figured out that when I set it to utf8 (empty => defaults to it) and have \n> signed-off line (with native non-utf ä), I get that error...\n> \n> ...and please, do not drop me from cc since I'm not subscribed...\n> \n> -- \n>  i.\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"42764","messageId":"Pine.LNX.4.64.0705202158580.3133@kivilampi-30.cs.helsinki.fi","threadId":"8199","inReplyTo":"20070520124345.GB27087@efreet.light.src","subject":"Re: git-rebase (1.5.0.6) errors","fromName":"Ilpo Järvinen","fromEmail":"ilpo.jarvinen@helsinki.fi","sentAt":"2007-05-20T19:02:29Z","receivedAt":"2007-05-20T19:02:29Z","isPatch":false,"sender":{"key":"ilpo.jarvinen@helsinki.fi","avatar":null},"body":"On Sun, 20 May 2007, Jan Hudec wrote:\n\n> On Fri, May 18, 2007 at 17:02:56 +0300, Ilpo Järvinen wrote:\n> > David Kastrup <dak@gnu.org> wrote:\n> > \n> > > Only if size_t is a larger type than int (could be on x86-64 and alpha\n> > > architectures).  Other than that, this comparison would work.  Which\n> > > does not mean that this does not warrant fixing, but it is not\n> > > necessarily the cause of this problem.\n> > \n> > ...sizeof(size_t) == sizeof(int) should hold...\n> \n> Really?\n> \n> $ cat test.c\n> #include <stdio.h>\n> int main(void)\n> {\n>     printf(\"sizeof(int) = %i\\n\", sizeof(int));\n>     printf(\"sizeof(long) = %i\\n\", sizeof(long));\n>     printf(\"sizeof(size_t) = %i\\n\", sizeof(size_t));\n>     return 0;\n> }\n> $ gcc -otest test.c\n> $ ./test\n> sizeof(int) = 4\n> sizeof(long) = 8\n> sizeof(size_t) = 8\n> \n> Hm, it does not seem that sizeof(size_t) == sizeof(int).\n\n...On 64-bit perhaps but mine isn't one of them... I'm sorry if my \nwording was misleading, I meant to say that on my system the equality \nof sizeof()s should hold... :-)\n\n> $ uname -m\n> x86_64\n> \n> Yes, this is a 64-bit system.\n\nijjarvin@kivilampi-30:~/src/testsize$ ./main\nsizeof(int) = 4\nsizeof(long) = 4\nsizeof(size_t) = 4\n\n$ uname -m\ni686\n\n\n-- \n i."}]}