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

Re: log -L crash (Re: [PATCH V5 13/17] Add parent rewriting to line history browser)

From
Bo Yang <struggleyb.nku@gmail.com>
Date
Sep 1, 2010, 14:47 UTC
Message-ID
<AANLkTik2WgTkjH4nDs2QKSfb+rn4-QioGOeJZJ4NgN9t@mail.gmail.com>
In-Reply-To
<20100830171007.GC21441@burratino>
Hi Jonathan,
   Thanks a lot for providing such a detail valgrind trace output, I
will find out what happened to the code in this Friday, and give a fix
then. Thanks again for let me know it. Thanks!
On Tue, Aug 31, 2010 at 1:10 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 62 quoted lines
> Hi Bo et al,
>
> The following test fails (segfaults) for me.  It bisects to 83361f5
> (Add parent rewriting to line history browser, 2010-08-11).  Notes
> from --valgrind:
>
>        Invalid read of size 4
>           at assign_parents_range (line.c:1069)
>           by cmd_line_log_walk (line.c:1403)
>           by cmd_log (log.c:619)
>           by handle_internal_command (git.c:270)
>           by main (git.c:470)
>         Address 0x432a90c is 4 bytes inside a block of size 8 free'd
>           at free (vg_replace_malloc.c:366)
>           by assign_range_to_parent (line.c:964)
>           by assign_parents_range (line.c:1036)
>           by cmd_line_log_walk (line.c:1403)
>           by cmd_log (log.c:619)
>           by handle_internal_command (git.c:270)
>           by main (git.c:470)
>
>        Invalid read of size 4
>           at assign_parents_range (line.c:1041)
>           by cmd_line_log_walk (line.c:1403)
>           by cmd_log (log.c:619)
>           by handle_internal_command (git.c:270)
>           by main (git.c:470)
>         Address 0x0 is not stack'd, malloc'd or (recently) free'd
>
>        Process terminating with default action of signal 11 (SIGSEGV): dumping core
>         Access not within mapped region at address 0x0
>           at assign_parents_range (line.c:1041)
>           by cmd_line_log_walk (line.c:1403)
>           by cmd_log (log.c:619)
>           by handle_internal_command (git.c:270)
>           by main (git.c:470)
>         If you believe this happened as a result of a stack
>         overflow in your program's main thread (unlikely but
>         possible), you can try to increase the size of the
>         main thread stack using the --main-stacksize= flag.
>         The main thread stack size used in this run was 8388608.
>
> Ideas?
>
> diff --git a/t/t0011-crash.sh b/t/t0011-crash.sh
> index e69de29..5cb3ef3 100644
> --- a/t/t0011-crash.sh
> +++ b/t/t0011-crash.sh
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +test_description=crash
> +. ./test-lib.sh
> +
> +test_expect_success "doesn't crash" '
> +       GIT_DIR="$TEST_DIRECTORY"/../.git \
> +               git log -L "/while (1) {/,/}/" git.c
> +'
> +
> +test_done
> --
>
-- 
Regards!
Bo
----------------------------
My blog: http://blog.morebits.org
Why Git: http://www.whygitisbetterthanx.com/
Previous: Jonathan NiederNext: Thomas Rast
Message 16 of 28 in “Reroll a version 5 of this series”
  1. 00/17 Reroll a version 5 of this seriesBo Yang, Aug 11, 2010
  2. 01/17 parse-options: enhance STOP_AT_NON_OPTIONBo Yang, Aug 11, 2010
  3. 02/17 parse-options: add two helper functionsBo Yang, Aug 11, 2010
  4. 03/17 Add the basic data structure for line level historyBo Yang, Aug 11, 2010
  5. 04/17 Refactor parse_locBo Yang, Aug 11, 2010
  6. 05/17 Parse the -L optionsBo Yang, Aug 11, 2010
  7. 06/17 Export three functions from diff.cBo Yang, Aug 11, 2010
  8. 07/17 Add range clone functionsBo Yang, Aug 11, 2010
  9. 08/17 map/take range to the parent of commitsBo Yang, Aug 11, 2010
  10. 09/17 Print the line logBo Yang, Aug 11, 2010
  11. 10/17 Hook line history into cmd_log, ensuring a topo-ordered walkBo Yang, Aug 11, 2010
  12. 11/17 Make rewrite_parents public to other part of gitBo Yang, Aug 11, 2010
  13. 12/17 Make graph_next_line external to other part of gitBo Yang, Aug 11, 2010
  14. 13/17 Add parent rewriting to line history browserBo Yang, Aug 11, 2010
  15. log -L crash (Re: [PATCH V5 13/17] Add parent rewriting to line history browser)Jonathan Nieder, Aug 30, 2010
  16. Bo YangSep 1, 2010
  17. log -L: do not free parents lists we might need againThomas Rast, Sep 11, 2010
  18. 14/17 Add --graph prefix before line history outputBo Yang, Aug 11, 2010
  19. 15/17 Add --full-line-diff optionBo Yang, Aug 11, 2010
  20. 16/17 Add tests for line history browserBo Yang, Aug 11, 2010
  21. Ævar Arnfjörð BjarmasonAug 12, 2010
  22. Bo YangAug 12, 2010
  23. Ævar Arnfjörð BjarmasonAug 12, 2010
  24. Junio C HamanoAug 12, 2010
  25. Junio C HamanoAug 12, 2010
  26. 17/17 Document line history browserBo Yang, Aug 11, 2010
  27. david@lang.hmAug 12, 2010
  28. Junio C HamanoAug 12, 2010

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.