{"thread":{"id":"11294","subject":"testsuite failures in mainline...","startedAt":"2007-12-14T18:43:12Z","lastAt":"2007-12-15T01:18:59Z","messageCount":9,"participants":["David Miller","Junio C Hamano","Alex Riesen","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"63185","messageId":"20071214.104312.103638776.davem@davemloft.net","threadId":"11294","inReplyTo":null,"subject":"testsuite failures in mainline...","fromName":"David Miller","fromEmail":"davem@davemloft.net","sentAt":"2007-12-14T18:43:12Z","receivedAt":"2007-12-14T18:43:12Z","isPatch":false,"sender":{"key":"davem@davemloft.net","avatar":null},"body":"\nI've been seeing this for I think a week or two, and I can't figure\nout if it's some local problem of mine.  I even reran the testsuite\nwith \"PATH=$(pwd):$PATH\" just in case it was picking up my existing\n1.5.3.7 installation for some reason, but it still fails even in that\ncase.\n\nIs the following a known issue?\n\n*** t3200-branch.sh ***\n*   ok 1: prepare a trivial repository\n*   ok 2: git branch --help should not have created a bogus branch\n*   ok 3: git branch abc should create a branch\n*   ok 4: git branch a/b/c should create a branch\n*   ok 5: git branch -l d/e/f should create a branch and a log\n*   ok 6: git branch -d d/e/f should delete a branch and a log\n*   ok 7: git branch j/k should work after branch j has been deleted\n*   ok 8: git branch l should work after branch l/m has been deleted\n*   ok 9: git branch -m m m/m should work\n*   ok 10: git branch -m n/n n should work\n*   ok 11: git branch -m o/o o should fail when o/p exists\n*   ok 12: git branch -m q r/q should fail when r exists\n*   ok 13: git branch -m q q2 without config should succeed\n*   ok 14: git branch -m s/s s should work when s/t is deleted\n*   ok 15: config information was renamed, too\n*   ok 16: git branch -m u v should fail when the reflog for u is a symlink\n*   ok 17: test tracking setup via --track\n*   ok 18: test tracking setup (non-wildcard, matching)\n*   ok 19: test tracking setup (non-wildcard, not matching)\n* FAIL 20: test tracking setup via config\n        git config branch.autosetupmerge true &&\n             git config remote.local.url . &&\n             git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n             (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n             git branch my3 local/master &&\n             test $(git config branch.my3.remote) = local &&\n             test $(git config branch.my3.merge) = refs/heads/master\n* FAIL 21: avoid ambiguous track\n        \n                git config branch.autosetupmerge true &&\n                git config remote.ambi1.url = lalala &&\n                git config remote.ambi1.fetch = refs/heads/lalala:refs/heads/master &&\n                git config remote.ambi2.url = lilili &&\n                git config remote.ambi2.fetch = refs/heads/lilili:refs/heads/master &&\n                git branch all1 master &&\n                test -z \"$(git config branch.all1.merge)\"\n        \n*   ok 22: test overriding tracking setup via --no-track\n* FAIL 23: no tracking without .fetch entries\n        git branch --track my6 s &&\n             test -z \"$(git config branch.my6.remote)\" &&\n             test -z \"$(git config branch.my6.merge)\"\n* FAIL 24: test tracking setup via --track but deeper\n        git config remote.local.url . &&\n             git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n             (git show-ref -q refs/remotes/local/o/o || git-fetch local) &&\n             git branch --track my7 local/o/o &&\n             test \"$(git config branch.my7.remote)\" = local &&\n             test \"$(git config branch.my7.merge)\" = refs/heads/o/o\n* FAIL 25: test deleting branch deletes branch config\n        git branch -d my7 &&\n             test -z \"$(git config branch.my7.remote)\" &&\n             test -z \"$(git config branch.my7.merge)\"\n*   ok 26: test deleting branch without config\n*   ok 27: git checkout -b g/h/i -l should create a branch and a log\n* failed 5 among 27 test(s)\n"},{"id":"63188","messageId":"7vfxy5rsui.fsf@gitster.siamese.dyndns.org","threadId":"11294","inReplyTo":"20071214.104312.103638776.davem@davemloft.net","subject":"Re: testsuite failures in mainline...","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-14T19:15:01Z","receivedAt":"2007-12-14T19:15:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Miller <davem@davemloft.net> writes:\n\n> I've been seeing this for I think a week or two, and I can't figure\n> out if it's some local problem of mine.  I even reran the testsuite\n> with \"PATH=$(pwd):$PATH\" just in case it was picking up my existing\n> 1.5.3.7 installation for some reason, but it still fails even in that\n> case.\n>\n> Is the following a known issue?\n\nNo, you are the first to report it here.  I do not push out the tip of\n'master' and 'next' unless all tests pass in my primary repository on my\nprivate machine and in a repository under my k.org account, so you can\nat least assume all tests has passed for _some_ people.  It of course\ndoes not guarantee there isn't timing related bugs I am not catching. \n\n> *** t3200-branch.sh ***\n> ...\n> * FAIL 20: test tracking setup via config\n>         git config branch.autosetupmerge true &&\n>              git config remote.local.url . &&\n>              git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n>              (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n>              git branch my3 local/master &&\n>              test $(git config branch.my3.remote) = local &&\n>              test $(git config branch.my3.merge) = refs/heads/master\n\nWhen I can reproduce a breakage, in our tests, I'd run\n\n\tcd t && sh -x t3200-branch.sh -i -v\n\n(replace \"t3200-*\" with the failing test) and see which one of the steps\nchained with && is breaking first.\n"},{"id":"63190","messageId":"20071214.111736.258936000.davem@davemloft.net","threadId":"11294","inReplyTo":"7vfxy5rsui.fsf@gitster.siamese.dyndns.org","subject":"Re: testsuite failures in mainline...","fromName":"David Miller","fromEmail":"davem@davemloft.net","sentAt":"2007-12-14T19:17:36Z","receivedAt":"2007-12-14T19:17:36Z","isPatch":false,"sender":{"key":"davem@davemloft.net","avatar":null},"body":"From: Junio C Hamano <gitster@pobox.com>\nDate: Fri, 14 Dec 2007 11:15:01 -0800\n\n> When I can reproduce a breakage, in our tests, I'd run\n> \n> \tcd t && sh -x t3200-branch.sh -i -v\n> \n> (replace \"t3200-*\" with the failing test) and see which one of the steps\n> chained with && is breaking first.\n\nLooks like a malloc() failure:\n\n+ test_expect_success 'test tracking setup via config' 'git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n+ test 2 = 2\n+ test_skip 'test tracking setup via config' 'git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n++ expr ./t3200-branch.sh : '.*/\\(t[0-9]*\\)-[^/]*$'\n+ this_test=t3200\n++ expr 19 + 1\n+ this_test=t3200.20\n+ to_skip=\n+ case \"$to_skip\" in\n+ false\n+ say 'expecting success: git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n+ say_color info 'expecting success: git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n+ test -z info\n+ shift\n+ echo '* expecting success: git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n* expecting success: git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master\n+ test_run_ 'git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n+ eval 'git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n++ git config branch.autosetupmerge true\n++ git config remote.local.url .\n++ git config remote.local.fetch 'refs/heads/*:refs/remotes/local/*'\n++ git show-ref -q refs/remotes/local/master\n++ git branch my3 local/master\nfatal: Out of memory, malloc failed\n+ eval_ret=128\n+ return 0\n+ '[' 0 = 0 -a 128 = 0 ']'\n+ test_failure_ 'test tracking setup via config' 'git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n++ expr 19 + 1\n+ test_count=20\n++ expr 0 + 1\n+ test_failure=1\n+ say_color error 'FAIL 20: test tracking setup via config'\n+ test -z error\n+ shift\n+ echo '* FAIL 20: test tracking setup via config'\n* FAIL 20: test tracking setup via config\n+ shift\n+ echo 'git config branch.autosetupmerge true &&\n     git config remote.local.url . &&\n     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n     git branch my3 local/master &&\n     test $(git config branch.my3.remote) = local &&\n     test $(git config branch.my3.merge) = refs/heads/master'\n+ sed -e 's/^/\t/'\n\tgit config branch.autosetupmerge true &&\n\t     git config remote.local.url . &&\n\t     git config remote.local.fetch refs/heads/*:refs/remotes/local/* &&\n\t     (git show-ref -q refs/remotes/local/master || git-fetch local) &&\n\t     git branch my3 local/master &&\n\t     test $(git config branch.my3.remote) = local &&\n\t     test $(git config branch.my3.merge) = refs/heads/master\n+ test t = ''\n+ trap - exit\n+ exit 1\n"},{"id":"63197","messageId":"7vir31qbpp.fsf@gitster.siamese.dyndns.org","threadId":"11294","inReplyTo":"20071214.111736.258936000.davem@davemloft.net","subject":"Re: testsuite failures in mainline...","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-14T20:10:26Z","receivedAt":"2007-12-14T20:10:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Miller <davem@davemloft.net> writes:\n\n> From: Junio C Hamano <gitster@pobox.com>\n> Date: Fri, 14 Dec 2007 11:15:01 -0800\n>\n>> When I can reproduce a breakage, in our tests, I'd run\n>> \n>> \tcd t && sh -x t3200-branch.sh -i -v\n>> \n>> (replace \"t3200-*\" with the failing test) and see which one of the steps\n>> chained with && is breaking first.\n>\n> Looks like a malloc() failure:\n> ...\n> ++ git branch my3 local/master\n> fatal: Out of memory, malloc failed\n\nDo you mean this is a malloc() failure that you can reliable reproduce?\nPuzzled...\n"},{"id":"63211","messageId":"20071214214533.GA4943@steel.home","threadId":"11294","inReplyTo":"20071214.111736.258936000.davem@davemloft.net","subject":"Re: testsuite failures in mainline...","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-12-14T21:45:33Z","receivedAt":"2007-12-14T21:45:33Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"David Miller, Fri, Dec 14, 2007 20:17:36 +0100:\n> ++ git show-ref -q refs/remotes/local/master\n> ++ git branch my3 local/master\n> fatal: Out of memory, malloc failed\n\nSomething unusual about the system? Like a malloc debugger in\nLD_PRELOAD configuration?\n\nMaybe you could retry with a little bit instrumentation?\n(The program last failed (git-branch) is normally very benign...)\n\nSomething like this:\n\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 79eb10e..a9cc249 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -230,7 +230,8 @@ static inline char* xstrdup(const char *str)\n \treturn ret;\n }\n \n-static inline void *xmalloc(size_t size)\n+#define xmalloc(size) xmalloc_((size),__FILE__,__LINE__)\n+static inline void *xmalloc_(size_t size, const char *file, int line)\n {\n \tvoid *ret = malloc(size);\n \tif (!ret && !size)\n@@ -241,7 +242,8 @@ static inline void *xmalloc(size_t size)\n \t\tif (!ret && !size)\n \t\t\tret = malloc(1);\n \t\tif (!ret)\n-\t\t\tdie(\"Out of memory, malloc failed\");\n+\t\t\tdie(\"Out of memory, malloc(%u) at %s:%d failed\",\n+\t\t\t    size, file, line);\n \t}\n #ifdef XMALLOC_POISON\n \tmemset(ret, 0xA5, size);\n@@ -263,7 +265,8 @@ static inline char *xstrndup(const char *str, size_t len)\n \treturn xmemdupz(str, p ? p - str : len);\n }\n \n-static inline void *xrealloc(void *ptr, size_t size)\n+#define xrealloc(ptr,size) xrealloc_((ptr),(size),__FILE__,__LINE__)\n+static inline void *xrealloc_(void *ptr, size_t size, const char *file, int line)\n {\n \tvoid *ret = realloc(ptr, size);\n \tif (!ret && !size)\n@@ -274,7 +277,8 @@ static inline void *xrealloc(void *ptr, size_t size)\n \t\tif (!ret && !size)\n \t\t\tret = realloc(ptr, 1);\n \t\tif (!ret)\n-\t\t\tdie(\"Out of memory, realloc failed\");\n+\t\t\tdie(\"Out of memory, realloc(%u) at %s:%d failed\",\n+\t\t\t    size, file, line);\n \t}\n \treturn ret;\n }\n"},{"id":"63216","messageId":"20071214.142448.52660507.davem@davemloft.net","threadId":"11294","inReplyTo":"20071214214533.GA4943@steel.home","subject":"Re: testsuite failures in mainline...","fromName":"David Miller","fromEmail":"davem@davemloft.net","sentAt":"2007-12-14T22:24:48Z","receivedAt":"2007-12-14T22:24:48Z","isPatch":false,"sender":{"key":"davem@davemloft.net","avatar":null},"body":"From: Alex Riesen <raa.lkml@gmail.com>\nDate: Fri, 14 Dec 2007 22:45:33 +0100\n\n> David Miller, Fri, Dec 14, 2007 20:17:36 +0100:\n> > ++ git show-ref -q refs/remotes/local/master\n> > ++ git branch my3 local/master\n> > fatal: Out of memory, malloc failed\n> \n> Something unusual about the system? Like a malloc debugger in\n> LD_PRELOAD configuration?\n\nNo, I'm not doing anything fancy like that.\n\n> Maybe you could retry with a little bit instrumentation?\n> (The program last failed (git-branch) is normally very benign...)\n> \n> Something like this:\n\nHere is the output from the debugging patch:\n\n++ git branch my3 local/master\nfatal: Out of memory, malloc(4293963242) at git-compat-util.h:256 failed\n\nThis bogus size value in hex is 0xfff0adea, FWIW.\n\nI added similar diags to xmemdupz() and xstrndup() and that gives us:\n\nfatal: Out of memory, xstrndup(0x103ebf:4293902657:4293902657) at remote.c:112 failed\n\n(the first three values are xstrndup() vars 'str', 'len', and\n the computed second argument to xmemdupz).\n\nThat bogus length is being generated via the length argument\npassed to make_branch() by handle_config() in remote.c:\n\n\tif (!prefixcmp(key, \"branch.\")) {\n\t\tname = key + 7;\n\t\tsubkey = strrchr(name, '.');\n\t\tbranch = make_branch(name, subkey - name);\n\nWhat if 'subkey' is NULL?  I bet that's what happening here.\n\nI added a debugging check for this and indeed, subkey is NULL\nin handle_condig() and that's why 'subkey - name' generates that\nbogus negative length.\n\nThe string 'key' is \"branch.autosetupmerge\" in this case.\n"},{"id":"63221","messageId":"7v7ijgq311.fsf@gitster.siamese.dyndns.org","threadId":"11294","inReplyTo":"20071214.142448.52660507.davem@davemloft.net","subject":"Re: testsuite failures in mainline...","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-14T23:18:02Z","receivedAt":"2007-12-14T23:18:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Miller <davem@davemloft.net> writes:\n\n> \tif (!prefixcmp(key, \"branch.\")) {\n> \t\tname = key + 7;\n> \t\tsubkey = strrchr(name, '.');\n> \t\tbranch = make_branch(name, subkey - name);\n>\n> What if 'subkey' is NULL?  I bet that's what happening here.\n\nWow, good eyes.\n\nIt makes me wonder what my C library has been returning during the\ntests...\n\n---\n\n remote.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex 3fb0f99..0e00680 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -220,11 +220,11 @@ static int handle_config(const char *key, const char *value)\n \tif (!prefixcmp(key, \"branch.\")) {\n \t\tname = key + 7;\n \t\tsubkey = strrchr(name, '.');\n-\t\tbranch = make_branch(name, subkey - name);\n \t\tif (!subkey)\n \t\t\treturn 0;\n \t\tif (!value)\n \t\t\treturn 0;\n+\t\tbranch = make_branch(name, subkey - name);\n \t\tif (!strcmp(subkey, \".remote\")) {\n \t\t\tbranch->remote_name = xstrdup(value);\n \t\t\tif (branch == current_branch)\n"},{"id":"63223","messageId":"20071214.160845.185161708.davem@davemloft.net","threadId":"11294","inReplyTo":"7v7ijgq311.fsf@gitster.siamese.dyndns.org","subject":"Re: testsuite failures in mainline...","fromName":"David Miller","fromEmail":"davem@davemloft.net","sentAt":"2007-12-15T00:08:45Z","receivedAt":"2007-12-15T00:08:45Z","isPatch":false,"sender":{"key":"davem@davemloft.net","avatar":null},"body":"From: Junio C Hamano <gitster@pobox.com>\nDate: Fri, 14 Dec 2007 15:18:02 -0800\n\n> It makes me wonder what my C library has been returning during the\n> tests...\n\nIf the 'name' string is high enough in the address space, the\n'NULL - name' is still small enough to keep malloc() from\nfailing.\n\nIt might be neat to defeat bugs like this by making a\npointer_diff(a,b) macro or similar, that abort()'s when\none of the arguments is NULL.  Otherwise these bugs are\nso hard to find.\n\nI tested your patch and that part of the testsuite passes now.\n\nIt now fails on t9301-fast-export.sh\n\n+ eval '\n\n\tMASTER=$(git rev-parse --verify master) &&\n\tREIN=$(git rev-parse --verify rein) &&\n\tWER=$(git rev-parse --verify wer) &&\n\tMUSS=$(git rev-parse --verify muss) &&\n\tmkdir new &&\n\tgit --git-dir=new/.git init &&\n\tgit fast-export --all |\n\t(cd new &&\n\t git fast-import &&\n\t test $MASTER = $(git rev-parse --verify refs/heads/master) &&\n\t test $REIN = $(git rev-parse --verify refs/tags/rein) &&\n\t test $WER = $(git rev-parse --verify refs/heads/wer) &&\n\t test $MUSS = $(git rev-parse --verify refs/tags/muss))\n\n'\n+++ git rev-parse --verify master\n++ MASTER=e529bca54909ee82f6ed442ef855ff541aec034c\n+++ git rev-parse --verify rein\n++ REIN=e529bca54909ee82f6ed442ef855ff541aec034c\n+++ git rev-parse --verify wer\n++ WER=ce754ded7a378a51278b2ff76d6898ec20093068\n+++ git rev-parse --verify muss\n++ MUSS=d85ef2305117d94969d4990d3c752752d4719be1\n++ mkdir new\n++ git --git-dir=new/.git init\nInitialized empty Git repository in new/.git/\n++ git fast-export --all\n++ cd new\n++ git fast-import\n./test-lib.sh: line 194: 17409 Bus error               (core dumped) git fast-import\n\nThis usually indicates an unaligned memory access on sparc,\nwhich is where I'm running this.\n\nThe problem is the pool allocator in fast-import.c, it aligned objects\non the size of a pointer.  But this is insufficient, it needs to be at\nleast \"uintmax_t\" aligned.\n\nAlso, mem_pool->space needs to be suitably aligned for a uintmax_t\nas well.\n\nThe following patch fixes the bug, and together with your patch all\ntest cases now pass for me on sparc.\n\nSigned-off-by: David S. Miller <davem@davemloft.net>\n\ndiff --git a/fast-import.c b/fast-import.c\nindex 98c2bd5..4646c05 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -196,7 +196,7 @@ struct mem_pool\n \tstruct mem_pool *next_pool;\n \tchar *next_free;\n \tchar *end;\n-\tchar space[FLEX_ARRAY]; /* more */\n+\tuintmax_t space[FLEX_ARRAY]; /* more */\n };\n \n struct atom_str\n@@ -534,15 +534,15 @@ static void *pool_alloc(size_t len)\n \t\ttotal_allocd += sizeof(struct mem_pool) + mem_pool_alloc;\n \t\tp = xmalloc(sizeof(struct mem_pool) + mem_pool_alloc);\n \t\tp->next_pool = mem_pool;\n-\t\tp->next_free = p->space;\n+\t\tp->next_free = (char *) p->space;\n \t\tp->end = p->next_free + mem_pool_alloc;\n \t\tmem_pool = p;\n \t}\n \n \tr = p->next_free;\n-\t/* round out to a pointer alignment */\n-\tif (len & (sizeof(void*) - 1))\n-\t\tlen += sizeof(void*) - (len & (sizeof(void*) - 1));\n+\t/* round out to a 'uintmax_t' alignment */\n+\tif (len & (sizeof(uintmax_t) - 1))\n+\t\tlen += sizeof(uintmax_t) - (len & (sizeof(uintmax_t) - 1));\n \tp->next_free += len;\n \treturn r;\n }\n"},{"id":"63229","messageId":"Pine.LNX.4.64.0712150117330.27959@racer.site","threadId":"11294","inReplyTo":"20071214.160845.185161708.davem@davemloft.net","subject":"Re: testsuite failures in mainline...","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-15T01:18:59Z","receivedAt":"2007-12-15T01:18:59Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 14 Dec 2007, David Miller wrote:\n\n> -\tchar space[FLEX_ARRAY]; /* more */\n> +\tuintmax_t space[FLEX_ARRAY]; /* more */\n\nUsually, a much better idea is to use\n\n\tunion {\n\t\tchar cp[FLEX_ARRAY];\n\t\tuintmax_t up[FLEX_ARRAY];\n\t}\n\nbecause that is exactly the reason union was invented for.\n\nCiao,\nDscho\n"}]}