"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
gotwebd crash in got_gotweb_blame_cb
To:
gameoftrees@openbsd.org
Date:
Tue, 16 Aug 2022 23:42:46 +0200

Download raw body.

Thread
found that some hours ago gotwebd crashed.  I'm running gotwebd as of
bf80b15220f51490025e916633cdd70816113604 ("gotwebd: fix alternate
colors in tree entries") plus the fcgi_printf and the fix for the
double free on gotweb_free_querystring.

can't study the stacktrace now, will do that tomorrow when I have
time, but in the meantime I'm sharing it in case it rings some bells :)

antartica# egdb /usr/local/sbin/gotwebd /var/crash/gotwebd.core
[...]
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000b1546d55352 in got_gotweb_blame_cb (arg=0x7f7ffffd33a8, nlines=72,
    lineno=70, commit=0xb17d086bb80, id=0xb180f9005c0)
    at /home/op/w/got/gotwebd/got_operations.c:1173
1173            while (bline->annotated) {
(gdb) p *bline
Cannot access memory at address 0xb17d0886000
(gdb) p *a
$1 = {lines = 0xb17d08854c0, nlines = 72, nlines_prec = 2, lineno_cur = 73,
  line_offsets = 0xb17d0880000, f = 0xb18254605e0 <usual>,
  repo = 0xb180f92b520, c = 0xb1826e8d000}
(gdb) p *qs
$2 = {action = 0 '\000',
  commit = 0xb17f7ced740 "2ab37934d4c055d15861a261442c724fc936b0ff",
  previd = 0x0, prevset = 0x0, file = 0xb174b660360 "README.md", folder = 0x0,
  headref = 0xb180f930da0 "HEAD", index_page = 0,
  index_page_str = 0xb174b27dde0 "0", path = 0xb174b27d4b0 "amused.git",
  page = 0, page_str = 0x0}
(gdb) bt
#0  0x00000b1546d55352 in got_gotweb_blame_cb (arg=0x7f7ffffd33a8, nlines=72,
    lineno=70, commit=0xb17d086bb80, id=0xb180f9005c0)
    at /home/op/w/got/gotwebd/got_operations.c:1173
#1  0x00000b1546d576f3 in annotate_line (blame=0xb180f912200, lineno=69,
    commit=0xb17d086bb80, id=0xb180f9005c0,
    cb=0xb1546d55070 <got_gotweb_blame_cb>, arg=0x7f7ffffd33a8)
    at /home/op/w/got/gotwebd/../lib/blame.c:112
#2  0x00000b1546d56b32 in blame_open (blamep=0x7f7ffffd3288,
    path=0xb180f8f7100 "/README.md", start_commit_id=0xb180f929680,
    repo=0xb180f92b520, diff_algo=GOT_DIFF_ALGORITHM_MYERS,
    cb=0xb1546d55070 <got_gotweb_blame_cb>, arg=0x7f7ffffd33a8, cancel_cb=0x0,
    cancel_arg=0x0, fd1=62, fd2=63, f1=0xb1825460710 <usual+304>,
    f2=0xb18254607a8 <usual+456>) at /home/op/w/got/gotwebd/../lib/blame.c:620
#3  0x00000b1546d56558 in got_blame (path=0xb180f8fdc00 "/README.md",
    commit_id=0xb180f929680, repo=0xb180f92b520,
    diff_algo=GOT_DIFF_ALGORITHM_MYERS,
    cb=0xb1546d55070 <got_gotweb_blame_cb>, arg=0x7f7ffffd33a8, cancel_cb=0x0,
    cancel_arg=0x0, fd1=62, fd2=63, f1=0xb1825460710 <usual+304>,
    f2=0xb18254607a8 <usual+456>) at /home/op/w/got/gotwebd/../lib/blame.c:659
#4  0x00000b1546d54d2e in got_output_file_blame (c=0xb1826e8d000)
    at /home/op/w/got/gotwebd/got_operations.c:1341
#5  0x00000b1546d4d745 in gotweb_render_blame (c=0xb1826e8d000)
    at /home/op/w/got/gotwebd/gotweb.c:1171
#6  0x00000b1546d4c33d in gotweb_process_request (c=0xb1826e8d000)
    at /home/op/w/got/gotwebd/gotweb.c:208
#7  0x00000b1546d4af7f in fcgi_parse_params (buf=0xb1826e8d4b9 "\001\005",
    n=0, c=0xb1826e8d000, id=1) at /home/op/w/got/gotwebd/fcgi.c:200
#8  0x00000b1546d4ab92 in fcgi_parse_record (buf=0xb1826e8d4b1 "\001\004",
    n=16, c=0xb1826e8d000) at /home/op/w/got/gotwebd/fcgi.c:136
#9  0x00000b1546d4a8a7 in fcgi_request (fd=51, events=2, arg=0xb1826e8d000)
    at /home/op/w/got/gotwebd/fcgi.c:92
#10 0x00000b17aa746e4f in event_process_active (base=0xb17d962a800)
    at /usr/src/lib/libevent/event.c:333
#11 event_base_loop (base=0xb17d962a800, flags=<optimized out>)
    at /usr/src/lib/libevent/event.c:483
#12 0x00000b1546d4a14e in proc_run (ps=0xb17d962a000, p=0xb1546dc7f70 <procs>,
    procs=0xb1546dc7f30 <procs>, nproc=1, run=0xb1546d40930 <sockets_run>,
    arg=0x0) at /home/op/w/got/gotwebd/proc.c:584
#13 0x00000b1546d40912 in sockets (ps=0xb17d962a000, p=0xb1546dc7f70 <procs>)
    at /home/op/w/got/gotwebd/sockets.c:94
#14 0x00000b1546d48f57 in proc_init (ps=0xb17d962a000,
    procs=0xb1546dc7f70 <procs>, nproc=1, argc=6, argv=0x7f7ffffd38f8,
    proc_id=PROC_SOCKS) at /home/op/w/got/gotwebd/proc.c:256
#15 0x00000b1546d4390a in main (argc=0, argv=0x7f7ffffd38f8)
    at /home/op/w/got/gotwebd/gotwebd.c:219