git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: new segfault in master (6a6c0f10a70a6eb1)

From
Jeff King <peff@peff.net>
Date
May 11, 2019, 22:31 UTC
Message-ID
<20190511223120.GA25224@sigill.intra.peff.net>
In-Reply-To
<20190511205711.tdclwrdixaau75zv@dcvr>
On Sat, May 11, 2019 at 08:57:11PM +0000, Eric Wong wrote:
> This test-tool submodule segfault seems new.  Noticed it while
> checking dmesg for other things.

Yeah, I hadn't seen it before. It's almost certainly the expect_failure added in 2b1257e463 (t/helper: add test-submodule-nested-repo-config, 2018-10-25), since otherwise we'd be complaining of a test failure.

I know we don't expect this to do the right thing yet, but it seems like there's still a bug, since the test seems to think we should output a nice message (and it's possible that the segfault can be triggered from non-test-tool code, too).

+cc the author.
> There's also "name-rev HEAD~4000" (bottom), which is old, I think...
> [...]
> Looks like a stack overflow:

Yeah, this one is old and expected. It's also in an expect_failure. The CI we run things through at GitHub complains if there are any segfaults, and I hacked around it with the patch below.

I sort of assumed nobody else cared, since they hadn't mentioned it. But we could do something similar. Though note in my version the default is "do not run the test", and we'd maybe want to flip it the other way (and also break up the setup step so that the succeeding test actually runs).

-- >8 --
Subject: [PATCH] t6120: mark a failing test with SEGFAULT_OK prereq

Upstream recently added a test of name-rev on a deep repository, which shows that its recursive algorithm can blow out the stack and segfault. We have several such tests already, but the twist here is that it's expect_failure. So we _know_ it's going to segfault and Git's test suite is OK with that, until the problem is fixed.

But our CI is not so forgiving. If it sees any segfault at all, it interrupts the test run and declares the whole thing a failure.

Let's just skip this test by adding a prerequisite that isn't filled. It's not telling us anything interesting. And if it ever gets fixed upstream, that will cause a conflict and we can start running it.

Note that we also have to skip the test after it, which relies on the state set up by the first one. This isn't a big deal, as it's not testing code that we're likely to change ourselves.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t6120-describe.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 1c0e8659d9..9d98b95ba6 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -310,7 +310,7 @@ test_expect_success 'describe ignoring a borken submodule' '
 	grep broken out
 '
 
-test_expect_failure ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
+test_expect_failure ULIMIT_STACK_SIZE,SEGFAULT_OK 'name-rev works in a deep repo' '
 	i=1 &&
 	while test $i -lt 8000
 	do
@@ -331,7 +331,7 @@ EOF"
 	test_cmp expect actual
 '
 
-test_expect_success ULIMIT_STACK_SIZE 'describe works in a deep repo' '
+test_expect_success ULIMIT_STACK_SIZE,SEGFAULT_OK 'describe works in a deep repo' '
 	git tag -f far-far-away HEAD~7999 &&
 	echo "far-far-away" >expect &&
 	git describe --tags --abbrev=0 HEAD~4000 >actual &&
-- 
2.21.0.1388.g2b1efd806f
Previous: Eric WongNext: Jeff King
Message 2 of 16 in “new segfault in master (6a6c0f10a70a6eb1)”
  1. Eric WongMay 11, 2019
  2. Jeff KingMay 11, 2019
  3. Jeff KingMay 11, 2019
  4. Duy NguyenMay 12, 2019
  5. get_oid: handle NULL repo->indexJeff King, May 14, 2019
  6. Eric WongMay 14, 2019
  7. Duy NguyenMay 15, 2019
  8. Jeff KingMay 15, 2019
  9. Junio C HamanoMay 15, 2019
  10. Duy NguyenMay 15, 2019
  11. Junio C HamanoMay 16, 2019
  12. repository.c: always allocate 'index' at repo init timeNguyễn Thái Ngọc Duy, May 19, 2019
  13. Jeff KingMay 20, 2019
  14. Duy NguyenMay 21, 2019
  15. Jeff KingMay 21, 2019
  16. Junio C HamanoMay 28, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.