Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 861209 - www-apps/cgit: Truncated output
Summary: www-apps/cgit: Truncated output
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Web Application Packages Maintainers
URL: https://lists.zx2c4.com/pipermail/cgi...
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2022-07-26 10:09 UTC by Marcin Deranek
Modified: 2025-03-18 13:57 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
sendfile patch (sendfile.patch,1.55 KB, patch)
2022-07-26 10:10 UTC, Marcin Deranek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Deranek 2022-07-26 10:09:22 UTC
Problem is well described at https://lists.zx2c4.com/pipermail/cgit/2022-May/004720.html
Effectively cgit output for bigger files is truncated at ~65kB. Applying attached patch (see link) addresses the issue. 

Reproducible: Always

Steps to Reproduce:
1. Configure cgit and add a bigger file to the repository (35kB+ in my case)
2. Try to display content of that file using cgit
3.
Actual Results:  
Webpage gets truncated

Expected Results:  
Full webpage gets displayed
Comment 1 Marcin Deranek 2022-07-26 10:10:50 UTC
Created attachment 794549 [details, diff]
sendfile patch
Comment 2 steffen_brauer 2022-11-14 10:06:28 UTC
Please, can this patch finally be applied in the official ebuild?
Comment 3 zurabid2016 2025-03-18 00:34:55 UTC
This bug also hits me on www-apps/cgit-1.2.3-r203, only fetching first 65 KB of 10 MB or so photo. This only happens if caching is enabled. If the cache is disabled, the photo downloads just fine.

This is supposedly fixed with 852cb3b0e267dd2ddfd2eeef6275435098c606e7 "cache: tolerate short writes in print_slot" in master, according to https://marc.info/?l=cgit&m=167146263402979&w=2.

The master branch also has a fix for at least https://bugs.gentoo.org/919779 in fb87de795b9f1b1e21825243716ff1156097adf2 "fix building with clang", so I will drop a letter to upstream mailing list asking for a new release. If this doesn't work out, we can just fetch from the latest commit.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-18 00:45:08 UTC
(In reply to zurabid2016 from comment #3)
> This bug also hits me on www-apps/cgit-1.2.3-r203, only fetching first 65 KB
> of 10 MB or so photo. This only happens if caching is enabled. If the cache
> is disabled, the photo downloads just fine.
> 
> This is supposedly fixed with 852cb3b0e267dd2ddfd2eeef6275435098c606e7
> "cache: tolerate short writes in print_slot" in master, according to
> https://marc.info/?l=cgit&m=167146263402979&w=2.
> 
> The master branch also has a fix for at least https://bugs.gentoo.org/919779
> in fb87de795b9f1b1e21825243716ff1156097adf2 "fix building with clang", so I
> will drop a letter to upstream mailing list asking for a new release. If
> this doesn't work out, we can just fetch from the latest commit.

Feel free to send a PR doing that now (using a snapshot). I think others have asked before.
Comment 5 zurabid2016 2025-03-18 00:50:47 UTC
Sure
Comment 6 zurabid2016 2025-03-18 01:30:15 UTC
(In reply to Sam James from comment #4)
> (In reply to zurabid2016 from comment #3)
> > This bug also hits me on www-apps/cgit-1.2.3-r203, only fetching first 65 KB
> > of 10 MB or so photo. This only happens if caching is enabled. If the cache
> > is disabled, the photo downloads just fine.
> > 
> > This is supposedly fixed with 852cb3b0e267dd2ddfd2eeef6275435098c606e7
> > "cache: tolerate short writes in print_slot" in master, according to
> > https://marc.info/?l=cgit&m=167146263402979&w=2.
> > 
> > The master branch also has a fix for at least https://bugs.gentoo.org/919779
> > in fb87de795b9f1b1e21825243716ff1156097adf2 "fix building with clang", so I
> > will drop a letter to upstream mailing list asking for a new release. If
> > this doesn't work out, we can just fetch from the latest commit.
> 
> Feel free to send a PR doing that now (using a snapshot). I think others
> have asked before.

Made a PR: https://github.com/gentoo/gentoo/pull/41147
Comment 7 Larry the Git Cow gentoo-dev 2025-03-18 13:57:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b89cd8e5d9d999510537488f41d676b6967d738

commit 6b89cd8e5d9d999510537488f41d676b6967d738
Author:     Zurab Kvachadze <zurabid2016@gmail.com>
AuthorDate: 2025-03-18 01:18:23 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-03-18 13:57:19 +0000

    www-apps/cgit: add 1.2.3_p20240802
    
    There has not been any release of cgit since 2020. This commit adds the
    newest version of cgit which contains fixes for two bugs.
    
    The bug 919779 is a compilation failure with GCC 15 in bundled Git. This
    bug is probably fixed, as the bundled Git's version is bumped from 2.25
    to 2.46.
    
    Bug: https://bugs.gentoo.org/919779
    Closes: https://bugs.gentoo.org/919779
    Closes: https://bugs.gentoo.org/861209
    Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 www-apps/cgit/Manifest                    |   2 +
 www-apps/cgit/cgit-1.2.3_p20240802.ebuild | 121 ++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+)