Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315745 Details for
Bug 455222
lrzip fails to compress a file
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch for F-9 lrzip
lrzip-0.19-4GB_RAM.patch (text/plain), 2.72 KB, created by
Kamil Dudka
on 2008-09-04 12:42:53 UTC
(
hide
)
Description:
patch for F-9 lrzip
Filename:
MIME Type:
Creator:
Kamil Dudka
Created:
2008-09-04 12:42:53 UTC
Size:
2.72 KB
patch
obsolete
>diff -ruNp lrzip-0.19.orig/main.c lrzip-0.19/main.c >--- lrzip-0.19.orig/main.c 2007-12-09 23:07:26.000000000 +0100 >+++ lrzip-0.19/main.c 2008-09-04 14:32:15.000000000 +0200 >@@ -19,6 +19,8 @@ > > #include "rzip.h" > >+static unsigned long hard_limit; >+ > static void usage(void) > { > printf("lrzip version %d.%d%d\n", LRZIP_MAJOR_VERSION, LRZIP_MINOR_VERSION, LRZIP_MINOR_SUBVERSION); >@@ -349,23 +351,27 @@ static unsigned long get_ram(void) > /* Darwin can't overcommit as much as linux so we return half the ram > size to fudge it to use smaller windows */ > ramsize /= 2; >+ if (ramsize > hard_limit) >+ ramsize = hard_limit; > return ramsize; > } > #else > static unsigned long get_ram(void) > { >- unsigned long ramsize; >+ long long ramsize; > FILE *meminfo; > char aux[256]; > > if(!(meminfo = fopen("/proc/meminfo", "r"))) > fatal("fopen\n"); > >- while( !feof(meminfo) && !fscanf(meminfo, "MemTotal: %lu kB", &ramsize) ) >+ while( !feof(meminfo) && !fscanf(meminfo, "MemTotal: %Lu kB", &ramsize) ) > fgets(aux,sizeof(aux),meminfo); > if (fclose(meminfo) == -1) > fatal("fclose"); >- return ramsize; >+ if (ramsize > hard_limit) >+ ramsize = hard_limit; >+ return (unsigned long)ramsize; > } > #endif > >@@ -385,6 +391,8 @@ int main(int argc, char *argv[]) > control.flags |= FLAG_DECOMPRESS; > } > >+ /* Shafted by 32 bit limits we can only use 1/3 of 4GB */ >+ hard_limit =(1ULL << 32) / 3 / 1024; > control.compression_level = 7; > control.ramsize = get_ram() / 104858; /* hundreds of megabytes */ > control.window = 0; >@@ -461,7 +469,7 @@ int main(int argc, char *argv[]) > break; > case 'M': > control.compression_level = 9; >- control.window = control.ramsize * 9 / 10 ? : 1; >+ control.window = control.ramsize / 10 * 9 ? : 1; > break; > case 'O': > if (control.outname) /* can't mix -o and -O */ >@@ -516,14 +524,19 @@ int main(int argc, char *argv[]) > } > > if (control.window > control.ramsize) >- fatal("Cannot set compression window to larger than ramsize\n"); >+ printf("Compression window has been set to larger than ramsize, proceeding at your request. If you did not mean this, abort now.\n"); > > /* The control window chosen is the largest that will not cause > massive swapping on the machine (60% of ram). Most of the pages > will be shared by lzma even though it uses just as much ram itself > */ > if (!control.window) >- control.window = control.ramsize * 2 / 3 ? : 1; >+ control.window = control.ramsize / 3 * 2 ? : 1; >+ >+ if (control.window > 14) { >+ control.window = 14; >+ printf("Limiting control window to 14 due to limitations in current version of lrzip.\n"); >+ } > > /* OK, if verbosity set, print summary of options selected */ > if ((control.flags & FLAG_VERBOSITY) || (control.flags & FLAG_VERBOSITY_MAX)) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 455222
: 315745