List for cgit developers and users
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@elastic.org>
To: cgit@lists.zx2c4.com
Subject: SEGV in cgit-1.2.3 on unreadable refs/tags/FOO
Date: Fri, 9 Jun 2023 20:03:44 -0400	[thread overview]
Message-ID: <ZIO94DtXt/LJUlLN@elastic.org> (raw)

Hi -

Over on sourceware.org, we run a cgit instance to expose the various
git repos held there.  We noticed in the logs a recurrent SEGV of the
cgi-bin/cgit process, looking thusly:

#0  0x000056510452bfae in cgit_mk_refinfo (oid=0x565105f5bc98, refname=0x565105f5bcca "cluster-2.99.02") at ../shared.c:165
#1  cgit_refs_cb (refname=0x565105f5bcca "cluster-2.99.02", oid=0x565105f5bc98, flags=<optimized out>, cb_data=0x7fff6dc25fc0)
    at ../shared.c:217
#2  0x00005651045d3b44 in do_for_each_repo_ref_iterator (r=0x56510490fc20 <the_repo>, iter=0x565105f7de00,
    fn=fn@entry=0x5651045c6cc0 <do_for_each_ref_helper>, cb_data=cb_data@entry=0x7fff6dc25f80) at refs/iterator.c:418
#3  0x00005651045c9669 in do_for_each_ref (refs=<optimized out>, prefix=prefix@entry=0x5651046a1d4e "refs/tags/",
    fn=<optimized out>, trim=<optimized out>, flags=flags@entry=(unknown: 0),
    cb_data=cb_data@entry=0x56510453295b <cgit_print_tags+75>) at refs.c:1498
#4  0x00005651045c96f2 in refs_for_each_ref_in (refs=<optimized out>, prefix=prefix@entry=0x5651046a1d4e "refs/tags/",
    fn=<optimized out>, cb_data=cb_data@entry=0x56510453295b <cgit_print_tags+75>) at refs.c:1515
#5  0x00005651045ca217 in refs_for_each_tag_ref (cb_data=0x56510453295b <cgit_print_tags+75>, fn=<optimized out>,
    refs=<optimized out>) at refs.c:409
#6  for_each_tag_ref (fn=<optimized out>, cb_data=cb_data@entry=0x7fff6dc25fc0) at refs.c:414
#7  0x000056510453295b in cgit_print_tags (maxcount=2087820800) at ../ui-refs.c:185
#8  0x0000565104539e1d in cgit_print_summary () at ../ui-summary.c:56
#9  0x0000565104525c1f in process_request () at ../cgit.c:755

(gdb) print *oid
$1 = {hash = '\000' <repeats 31 times>, algo = 1}

It appears as though the oid is null or invalid.  That in turns
appears to be because the refs/tags/cluster-2.99.02 file had perms
0440, i.e., unreadable to the cgi process.  With world-readability
restored, the code started working again.


- FChE

                 reply	other threads:[~2023-06-10  0:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZIO94DtXt/LJUlLN@elastic.org \
    --to=fche@elastic.org \
    --cc=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).