Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bleadperl v5.31.1-58-g73cdf3a836 breaks YVES/Sereal-Decoder-4.007.tar.gz on -DDEBUGGING builds #207

Closed
andk opened this issue Jul 28, 2019 · 17 comments

Comments

@andk
Copy link

andk commented Jul 28, 2019

XRef: https://rt.perl.org/Public/Bug/Display.html?id=134320

@jkeenan
Copy link

jkeenan commented Aug 5, 2019

Dave Mitchell has prepared a patch making a correction in Decoder.xs in RT 134320.

jkeenan pushed a commit to jkeenan/Sereal that referenced this issue Nov 3, 2019
This patch was originally provided by Dave Mitchell inline as a response
to a "Blead Breaks CPAN" report in the Perl 5 bug queue (originally
rt.perl.org; now github.com/Perl/perl5/issues).  Dave's comment in
original ticket.

    THX_ck_entersub_args_sereal_decoder() in Decoder.xs
    wasn't setting the parent link correctly when munging an op
    tree.  The following diff makes all tests pass on blead. I
    haven't tested against older perls.

References:

Perl/perl5#17114
(originally https://rt-archive.perl.org/perl5/Ticket/Display.html?id=134320)

Sereal#207
@tonycoz
Copy link

tonycoz commented Nov 6, 2019

Sereal::Encoder likely needs a similar fix.

This appears to be causing issues in modules depending on Sereal too, like Perl/perl5#17245

@jkeenan
Copy link

jkeenan commented Jan 28, 2020

@demerphq and other Sereal maintainers ... can we get an update on this ticket?

It impacts several BBC tickets in the Perl 5 issue queue.

Thank you very much.
Jim Keenan

@demerphq
Copy link
Member

demerphq commented Jan 29, 2020 via email

@demerphq
Copy link
Member

demerphq commented Jan 29, 2020 via email

@demerphq
Copy link
Member

demerphq commented Jan 30, 2020 via email

@jkeenan
Copy link

jkeenan commented Jan 30, 2020

I got PASS on both Linux and FreeBSD-11 (though I didn't build with -DDEBUGGING)
sereal-decoder-openbsd-64-build-failure.txt
openbsd-64-perl_V.txt

... but I got a build-time failure on OpenBSD-6.4. :-(

I'm attaching the relevant part of the cpanm build.log for Sereal::Decoder and the relevant perl -V output.

Thank you very much.
jimk

@jkeenan
Copy link

jkeenan commented Jan 31, 2020

I got PASS on both Linux and FreeBSD-11 (though I didn't build with -DDEBUGGING)

For both distros I got PASS on threaded debugging builds on both Linux and FreeBSD-11.

@demerphq
Copy link
Member

demerphq commented Jan 31, 2020 via email

@jkeenan
Copy link

jkeenan commented Jan 31, 2020 via email

@demerphq
Copy link
Member

demerphq commented Feb 2, 2020 via email

@demerphq
Copy link
Member

demerphq commented Feb 2, 2020 via email

@jkeenan
Copy link

jkeenan commented Feb 2, 2020 via email

@demerphq
Copy link
Member

demerphq commented Feb 2, 2020 via email

@jkeenan
Copy link

jkeenan commented Feb 2, 2020

What I got with Serial-Decoder/Encoder-4.009_003:

$ uname -mrs
OpenBSD 6.4 amd64

$ bleadperl -v | head -2 | tail -1
This is perl 5, version 31, subversion 9 (v5.31.9 (v5.31.8-89-g41eecd54c3)) built for OpenBSD.amd64-openbsd-thread-multi

config_args='-des -Dusedevel -Duseithreads -DDEBUGGING'

cpanm failed to install Serial::Decoder
Changed to the build directory underneath ~/.cpanm ...

[Sereal-Decoder-4.009_003] 99 $ bleadperl Makefile.PL
Using bundled csnappy code
Using bundled miniz code
Using bundled zstd code
Generating a Unix-style Makefile
Writing Makefile for Sereal::Decoder
Writing MYMETA.yml and MYMETA.json
[Sereal-Decoder-4.009_003] 100 $ make
Skip blib/lib/Sereal/Decoder.pm (unchanged)
Skip blib/lib/Sereal/Decoder/Constants.pm (unchanged)
Skip blib/lib/Sereal/Performance.pm (unchanged)
Running Mkbootstrap for Decoder ()
chmod 644 "Decoder.bs"
"/home/jkeenan/testing/blead/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Decoder.bs blib/arch/auto/Sereal/Decoder/Decoder.bs 644
cc -c  -I.  -pthread -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O3 -Werror=declaration-after-statement     -DVERSION=\"4.009_003\"  -DXS_VERSION=\"4.009_003\" -DPIC -fPIC  "-I/home/jkeenan/testing/blead/lib/perl5/5.31.9/OpenBSD.amd64-openbsd-thread-multi/CORE"  -DNDEBUG Decoder.c
cc -c  -I.  -pthread -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O3 -Werror=declaration-after-statement     -DVERSION=\"4.009_003\"  -DXS_VERSION=\"4.009_003\" -DPIC -fPIC  "-I/home/jkeenan/testing/blead/lib/perl5/5.31.9/OpenBSD.amd64-openbsd-thread-multi/CORE"  -DNDEBUG srl_decoder.c
cc -c  -I.  -pthread -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O3 -Werror=declaration-after-statement     -DVERSION=\"4.009_003\"  -DXS_VERSION=\"4.009_003\" -DPIC -fPIC  "-I/home/jkeenan/testing/blead/lib/perl5/5.31.9/OpenBSD.amd64-openbsd-thread-multi/CORE"  -DNDEBUG miniz.c
miniz.c:3079:9: warning: Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support
      large files. [-W#pragma-messages]
#pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not suppor...
        ^
1 warning generated.
rm -f blib/arch/auto/Sereal/Decoder/Decoder.so
cc  -shared -fPIC  -L/usr/local/lib -fstack-protector-strong  Decoder.o srl_decoder.o miniz.o zstd/libzstd.o  -o blib/arch/auto/Sereal/Decoder/Decoder.so        
cc: error: no such file or directory: 'zstd/libzstd.o'
*** Error 1 in /home/jkeenan/.cpanm/work/1580666162.82173/Sereal-Decoder-4.009_003 (Makefile:509 'blib/arch/auto/Sereal/Decoder/Decoder.so')

I then changed into the zstd/ subdir and attempted to build:

[Sereal-Decoder-4.009_003] 103 $ cd zstd    
[zstd] 104 $ make
compiling static library
cc  -I. -I./common -DXXH_NAMESPACE=ZSTD_ -DZSTD_LEGACY_SUPPORT=0 -O2 -pipe  -fPIC -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1  -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef  -Wpointer-arith  -c common/debug.c common/entropy_common.c common/error_private.c common/fse_decompress.c common/pool.c common/threading.c common/xxhash.c common/zstd_common.c compress/fse_compress.c compress/hist.c compress/huf_compress.c compress/zstd_compress.c compress/zstd_compress_literals.c compress/zstd_compress_sequences.c compress/zstd_double_fast.c compress/zstd_fast.c compress/zstd_lazy.c compress/zstd_ldm.c compress/zstd_opt.c compress/zstdmt_compress.c decompress/huf_decompress.c decompress/zstd_ddict.c decompress/zstd_decompress.c decompress/zstd_decompress_block.c
ar rcs libzstd.o *.o

[zstd] 105 $ ls -ltr | tail -n 1
-rw-r--r--  1 jkeenan  jkeenan  858150 Feb  2 12:59 libzstd.o

So now we clearly have zstd/libzstd.o. Moving back up one level ...

[zstd] 106 $ cd ..
[Sereal-Decoder-4.009_003] 107 $ make
"/home/jkeenan/testing/blead/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Decoder.bs blib/arch/auto/Sereal/Decoder/Decoder.bs 644
rm -f blib/arch/auto/Sereal/Decoder/Decoder.so
cc  -shared -fPIC  -L/usr/local/lib -fstack-protector-strong  Decoder.o srl_decoder.o miniz.o zstd/libzstd.o  -o blib/arch/auto/Sereal/Decoder/Decoder.so        
chmod 755 blib/arch/auto/Sereal/Decoder/Decoder.so

Success!?

[Sereal-Decoder-4.009_003] 108 $ make test
# Many tests skipped like this:
t/700_roundtrip/v4/snappy_incr_canon.t ........ skipped: Did not find right version of encoder (want 3.001006)
t/700_roundtrip/v4/sort_keys.t ................ skipped: Did not find right version of encoder

... but PASS, and 'make install' succeeded.

Repeated process with Sereal-Encoder-4.009_003. First tried to install using cpanm on a tarball. Failed during 'make' due to absence of zstd/libzstd.o. Went to .cpanm build dir; confirmed build failure, but then changed into zstd/, called make manually, which built zstd/libzstd.o. From there it was all downhill.

[Sereal-Encoder-4.009_003] 115 $ cd zstd/                                                 
[zstd] 116 $ bleadperl Makefile.PL
[zstd] 117 $ make
compiling static library
cc  -I. -I./common -DXXH_NAMESPACE=ZSTD_ -DZSTD_LEGACY_SUPPORT=0 -O2 -pipe  -fPIC -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1  -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef  -Wpointer-arith  -c common/debug.c common/entropy_common.c common/error_private.c common/fse_decompress.c common/pool.c common/threading.c common/xxhash.c common/zstd_common.c compress/fse_compress.c compress/hist.c compress/huf_compress.c compress/zstd_compress.c compress/zstd_compress_literals.c compress/zstd_compress_sequences.c compress/zstd_double_fast.c compress/zstd_fast.c compress/zstd_lazy.c compress/zstd_ldm.c compress/zstd_opt.c compress/zstdmt_compress.c decompress/huf_decompress.c decompress/zstd_ddict.c decompress/zstd_decompress.c decompress/zstd_decompress_block.c
ar rcs libzstd.o *.o
[zstd] 118 $ cd ..
[Sereal-Encoder-4.009_003] 119 $ make
"/home/jkeenan/testing/blead/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Encoder.bs blib/arch/auto/Sereal/Encoder/Encoder.bs 644
rm -f blib/arch/auto/Sereal/Encoder/Encoder.so
cc  -shared -fPIC  -L/usr/local/lib -fstack-protector-strong  Encoder.o srl_encoder.o miniz.o zstd/libzstd.o  -o blib/arch/auto/Sereal/Encoder/Encoder.so        
chmod 755 blib/arch/auto/Sereal/Encoder/Encoder.so
[Sereal-Encoder-4.009_003] 120 $ make test
"/home/jkeenan/testing/blead/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Encoder.bs blib/arch/auto/Sereal/Encoder/Encoder.bs 644
PERL_DL_NONLAZY=1 "/home/jkeenan/testing/blead/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/*/*/*.t
t/001_load.t .................................. ok   
t/002_constants.t ............................. ok   
t/002_have_enc_and_dec.t ...................... # Testing with both encoder and decoder.
# Sereal::Decoder v4.009003
# Sereal::Encoder v4.009003
t/002_have_enc_and_dec.t ...................... ok
[snip]   
t/800_threads.t ............................... ok   
t/900_reentrancy.t ............................ ok   
All tests successful.
Files=69, Tests=294315, 260 wallclock secs ( 3.10 usr 26.88 sys + 127.24 cusr 131.02 csys = 288.24 CPU)
Result: PASS
[Sereal-Encoder-4.009_003] 121 $ make install
"/home/jkeenan/testing/blead/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Encoder.bs blib/arch/auto/Sereal/Encoder/Encoder.bs 644
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/jkeenan/testing/blead/lib/perl5/site_perl/5.31.9/OpenBSD.amd64-openbsd-thread-multi/auto/Sereal/Encoder/Encoder.so
Installing /home/jkeenan/testing/blead/lib/perl5/site_perl/5.31.9/OpenBSD.amd64-openbsd-thread-multi/Sereal/Encoder.pm
Installing /home/jkeenan/testing/blead/lib/perl5/site_perl/5.31.9/OpenBSD.amd64-openbsd-thread-multi/Sereal/Encoder/Constants.pm
Appending installation info to /home/jkeenan/testing/blead/lib/perl5/5.31.9/OpenBSD.amd64-openbsd-thread-multi/perllocal.pod

So I infer that we have a problem in the generated Makefile for each distro, but are otherwise close to success.

Thank you very much.
Jim Keenan

@demerphq
Copy link
Member

demerphq commented Feb 3, 2020 via email

@demerphq
Copy link
Member

demerphq commented Feb 5, 2020

This should be fixed in 4.011. Thanks for the report. Closing ticket.

@demerphq demerphq closed this as completed Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants