Debugging cgit

flattr this!

For my git repositories I use cgit as the web frontend. The package I used had a problem displaying the treeview. Looking at /var/log/messages I saw that it segfaults. I’ve already fixed a segfault in cgit some time ago. I wondered how I was able to get gdb attached to it. It took me some time to figure it out so this is the way to document it for the future. Maybe someone else will find this useful.

The command to display the html on the commandline is:

CGIT_CONFIG="/srv/www/vhosts/libssh/cgitrc" /srv/www/cgi-bin/cgit/cgit.cgi 1>cgit.html 2>cgit.log

This will write the html output to cgit.html and the errors to cgit.log. So if you want to display a tree of the project, the url to it would be for example: http://git.libssh.org/projects/libssh.git/

So on the commandline this is:

QUERY_STRING="url=projects/libssh.git" CGIT_CONFIG="/srv/www/vhosts/libssh/cgitrc" /srv/www/cgi-bin/cgit/cgit.cgi 1>cgit.html 2>cgit.log

and if you need gdb to get a segfault you can simply use:

QUERY_STRING="url=projects/libssh.git/tree" CGIT_CONFIG="/path/to/libssh/cgitrc" gdb /srv/www/cgi-bin/cgit/cgit.cgi

It segfaulted cause the current version doesn’t support git 1.7.6 and a NULL pointer was passed to a function instead of the right values.

2 thoughts on Debugging cgit

Leave a Reply


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post comment

What is Persona?