On Mon, Mar 12, 2012 at 12:56:36PM +0000, Olivier Mehani wrote:
> Hi,
>
> I'm trying to run cgit on 5.0 GENERIC#53 amd64 on a VIA Nano U2250 (Dell
> XS11-VX8). But I get segfaults right at the start.
>
> I've tried both the binary package (cgit-0.8.3.5p1 from
> ftp.fr.openbsd.org) and one built from ports (same from OPENBSD_5_0 on
> anoncvs.fr.openbsd.org).
>
> In both cases, it segfaults in trim_end() (line 114 [0]: t[len] = '\0';)
> called from main() (line 686 [1]; both according to gdb*). This bit of
> code tries to trim the path after the last '/' in argv[0], whitc never
> seems to have one even when manually called from a different directory
> (e.g. ./cgi-bin/cgit.cgi).
>
> What is odd is that in trim_end(), at the previous line also references
> t[len] (c = t[len];), but doesn't fail there. c then changes to '\0'
> (and gdb says it's "not available"), supposedly at line 113, then the
> segfault occurs. len is 8, which is the length of str ("cgit.cgi").
>
> However, there is some possibly dirty things happening as *t is a
> pointer equals to trim_end's argument const char *str. Could this be
> some protection forbidding functions to modifiy anything in the memory
> passed as const?
/etc/malloc.conf ?
> Did anybody notice anything similar? Any idea on how to fix it or
> investigate it further?
Never had any issue on amd64 since i've imported it. You may discuss it
with upstream... or try the new versions (0.9.0.2 is in current)
Landry