pmqs / compress-raw-lzma Goto Github PK
View Code? Open in Web Editor NEWLow-Level Perl Interface to lzma/xz compression library
Low-Level Perl Interface to lzma/xz compression library
Temp fix applied to Lzma.xs
. Revert when Dual-Life/Devel-PPPort#231 is fixed
Today I attempted to install Compress::Raw::Lzma on Linux (Ubuntu 22.04 LTS) against perl-5.38.0. I was not previously familiar with this distribution, but I noticed that you issued a new release at the same time as the new Compress::Raw::Zlib and Compress::Raw::Bzip2.
My installation failed, apparently due to lack of an lzma.h
header file. (I had no problem installing it on FreeBSD-12.)
$ uname -mrs
Linux 5.19.0-46-generic x86_64
$ perl -v | head -2 | tail -1
This is perl 5, version 38, subversion 0 (v5.38.0) built for x86_64-linux
$ cpan Compress::Raw::Lzma
Reading '/home/jkeenan/.cpan/Metadata'
Database was generated on Tue, 18 Jul 2023 00:17:01 GMT
Running install for module 'Compress::Raw::Lzma'
CPAN: Digest::SHA loaded ok (v6.04)
CPAN: Compress::Zlib loaded ok (v2.204)
Checksum for /home/jkeenan/.cpan/sources/authors/id/P/PM/PMQS/Compress-Raw-Lzma-2.205.tar.gz ok
'YAML' not installed, will not store persistent state
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::CoreList loaded ok (v5.20230520)
Configuring P/PM/PMQS/Compress-Raw-Lzma-2.205.tar.gz with Makefile.PL
CPAN: CPAN::Reporter loaded ok (v1.2019)
Parsing config.in...
Looks Good.
Up/Downgrade not needed.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Compress::Raw::Lzma
Writing MYMETA.yml and MYMETA.json
(/home/jkeenan/perl5/perlbrew/perls/perl-5.38.0/bin/perl Makefile.PL exited with 0)
CPAN::Reporter: Makefile.PL result is 'pass', No errors.
PMQS/Compress-Raw-Lzma-2.205.tar.gz
/home/jkeenan/perl5/perlbrew/perls/perl-5.38.0/bin/perl Makefile.PL -- OK
Running make for P/PM/PMQS/Compress-Raw-Lzma-2.205.tar.gz
cp lib/Compress/Raw/Lzma.pm blib/lib/Compress/Raw/Lzma.pm
AutoSplitting blib/lib/Compress/Raw/Lzma.pm (blib/lib/auto/Compress/Raw/Lzma)
Running Mkbootstrap for Lzma ()
chmod 644 "Lzma.bs"
"/home/jkeenan/perl5/perlbrew/perls/perl-5.38.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Lzma.bs blib/arch/auto/Compress/Raw/Lzma/Lzma.bs 644
"/home/jkeenan/perl5/perlbrew/perls/perl-5.38.0/bin/perl" "/home/jkeenan/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/ExtUtils/xsubpp" -typemap '/home/jkeenan/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/ExtUtils/typemap' -typemap '/home/jkeenan/.cpan/build/Compress-Raw-Lzma-2.205-1/typemap' Lzma.xs > Lzma.xsc
mv Lzma.xsc Lzma.c
cc -c -I/usr/local/include -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"2.205\" -DXS_VERSION=\"2.205\" -fPIC "-I/home/jkeenan/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/x86_64-linux/CORE" Lzma.c
Lzma.xs:18:10: fatal error: lzma.h: No such file or directory
18 | #include "lzma.h"
| ^~~~~~~~
compilation terminated.
make: *** [Makefile:347: Lzma.o] Error 1
(/usr/bin/make exited with 512)
CPAN::Reporter: make result is 'unknown', Stopped with an error.
CPAN::Reporter: preparing a CPAN Testers report for Compress-Raw-Lzma-2.205
CPAN::Reporter: this appears to be a duplicate report for the make phase:
UNKNOWN Compress-Raw-Lzma-2.205 x86_64-linux 5.19.0-45-generic
Test report will not be sent.
PMQS/Compress-Raw-Lzma-2.205.tar.gz
/usr/bin/make -- NOT OK
Would it be possible to have make
exit with a more specific error message if this header is not found?
Note also: I installed the lzma
package:
$ sudo apt install lzma
... but make
still failed:
...
cc -c -I/usr/local/include -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"2.205\" -DXS_VERSION=\"2.205\" -fPIC "-I/home/jkeenan/perl5/perlbrew/perls/perl-5.38.0/lib/5.38.0/x86_64-linux/CORE" Lzma.c
Lzma.xs:18:10: fatal error: lzma.h: No such file or directory
18 | #include "lzma.h"
| ^~~~~~~~
compilation terminated.
make: *** [Makefile:347: Lzma.o] Error 1
(/usr/bin/make exited with 512)
Suggestions?
The Changes for 2.211 say:
But those versions are associated with the backdoor CVE-2024-3094
So do you want those versions in the workflow?
Example below is from cpantesters on FreeBSD
Output from '/usr/bin/make test':
"/usr/perl5.26.3p/bin/perl5.26.3" -MExtUtils::Command::MM -e 'cp_nonempty' -- Lzma.bs blib/arch/auto/Compress/Raw/Lzma/Lzma.bs 644
PERL_DL_NONLAZY=1 "/usr/perl5.26.3p/bin/perl5.26.3" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/001version.t ....... ok
t/01llzma-generic.t .. ok
t/02filters.t ........ ok
Out of memory!
# Looks like you planned 1007 tests but only ran 193.
t/050interop-xz.t ....
Dubious, test returned 254 (wstat 65024, 0xfe00)
Failed 814/1007 subtests
t/09limitoutput.t .... ok
t/19nonpv.t .......... ok
t/99pod.t ............ ok
t/meta-json.t ........ ok
t/meta-yaml.t ........ ok
Test Summary Report
-------------------
t/050interop-xz.t (Wstat: 65024 Tests: 193 Failed: 0)
Non-zero exit status: 254
Parse errors: Bad plan. You planned 1007 tests but ran 193.
Files=9, Tests=3488, 3 wallclock secs ( 0.32 usr 0.07 sys + 1.62 cusr 0.91 csys = 2.91 CPU)
Result: FAIL
Failed 1/9 test programs. 0/3488 subtests failed.
*** Error code 255
Stop.
make: stopped in /usr/home/cpansand/.cpan/build/2019120819/Compress-Raw-Lzma-2.093-0
Seeing a number of cpantesters failures where the common denominator is the lzma error message Memory usage limit was reached
Below is a typical failure
PERL_DL_NONLAZY=1 "/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.30.0/ac75/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/000prereq.t ......... ok
t/001main.t ........... ok
# Failed test (t/010main-unzip.t at line 385)
# got: ''
# expected: 'abcd1'
# Failed test (t/010main-unzip.t at line 411)
# got: undef
# expected: '5'
# Failed test (t/010main-unzip.t at line 412)
# got: '0'
# expected: '5'
# Uncompression Error: Memory usage limit was reached
Seeing failures on Win32 for the lzip
test harness files with 2.091. These tests worked in 2.090, so the memory leak fixes in https://github.com/pmqs/Compress-Raw-Lzma are prime candidates for the source of the problem.
Examples
https://ci.appveyor.com/project/pmqs/io-compress-lzma/builds/29074982
http://www.cpantesters.org/cpan/report/a9cfeaba-6c52-1014-8029-51b869282b67
Attempt to debug with gdb on Win32 suggests this stack trace. Problem is the code doesn't touch Perl_drand48_r
, so probably a red herring.
Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000006fd97a97 in perl530!Perl_drand48_r () from C:\Strawberry\perl\bin\perl530.dll
(gdb) bt
#0 0x000000006fd97a97 in perl530!Perl_drand48_r () from C:\Strawberry\perl\bin\perl530.dll
pmqs/IO-Compress-Lzma#1 0x000000006454175d in ?? () from C:\Strawberry\perl\site\lib\auto\Compress\Raw\Lzma\Lzma.xs.dll
pmqs/IO-Compress-Lzma#2 0x0000000064548468 in ?? () from C:\Strawberry\perl\site\lib\auto\Compress\Raw\Lzma\Lzma.xs.dll
#3 0x000000006fd2e002 in perl530!Perl_clear_defarray () from C:\Strawberry\perl\bin\perl530.dll
#4 0x000000006fd3c7aa in perl530!Perl_call_sv () from C:\Strawberry\perl\bin\perl530.dll
#5 0x000000006fccf74c in perl530!Perl_newRV_noinc () from C:\Strawberry\perl\bin\perl530.dll
#6 0x000000006fccfe71 in perl530!Perl_sv_clear () from C:\Strawberry\perl\bin\perl530.dll
#7 0x000000006fcd04a3 in perl530!Perl_sv_free2 () from C:\Strawberry\perl\bin\perl530.dll
#8 0x000000006fd32cbd in perl530!Perl_gp_free () from C:\Strawberry\perl\bin\perl530.dll
#9 0x000000006fcd027f in perl530!Perl_sv_clear () from C:\Strawberry\perl\bin\perl530.dll
#10 0x000000006fcd04a3 in perl530!Perl_sv_free2 () from C:\Strawberry\perl\bin\perl530.dll
#11 0x000000006fd89f10 in perl530!Perl_leave_scope () from C:\Strawberry\perl\bin\perl530.dll
#12 0x000000006fd0a6dc in perl530!Perl_caller_cx () from C:\Strawberry\perl\bin\perl530.dll
#13 0x000000006fd87d66 in perl530!Perl_runops_standard () from C:\Strawberry\perl\bin\perl530.dll
#14 0x000000006fd445b7 in perl_run () from C:\Strawberry\perl\bin\perl530.dll
#15 0x000000006fd9aea8 in perl530!RunPerl () from C:\Strawberry\perl\bin\perl530.dll
#16 0x00000000004013c7 in ?? ()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.