Without Inline::C, and without Nix's sandbox
--------------------------------------------

I get 3 tests to fail (in addition to those currently disabled in Nixpkgs:
https://github.com/NixOS/nixpkgs/pull/104457/files#diff-77474340b38081fea7ce3b112c1bc060d3a95cc5e781915463e2f3fc5556da7bR34-R69
ie. convert-compact, search, v2writable, www_listing, eml, hl_mod,
lei-mirror and spawn):
$ nix develop -f . public-inbox
$ doCheck= bash pkgs/development/perl-modules/generic/builder.sh
$ make -C public-inbox-1.7.0 test
> [...]
> Test Summary Report
> -------------------
> t/nntpd-v2.t               (Wstat: 256 Tests: 113 Failed: 1)
>   Failed test:  102
>   Non-zero exit status: 1                                       
> t/nntpd.t                  (Wstat: 256 Tests: 110 Failed: 1)
>   Failed test:  99
>   Non-zero exit status: 1
> t/solver_git.t             (Wstat: 1280 Tests: 13 Failed: 5)
>   Failed tests:  9-13
>   Non-zero exit status: 5
>   Parse errors: No plan found in TAP output                     
> Files=149, Tests=4658, 296 wallclock secs ( 1.78 usr  0.56 sys + 116.73 cusr 
> 165.82 csys = 284.89 CPU)
> Result: FAIL
> Failed 3/149 test programs. 7/4658 subtests failed.

More precisely:
$ (cd public-inbox-1.7.0; perl -I$out/lib/perl5/site_perl t/nntpd-v2.t )
> [...]
> ok 101 - new article retrieved after compact
> not ok 102 - no deleted files
> #   Failed test 'no deleted files'
> #   at ./t/nntpd.t line 363.
> #     Structures begin differing at:
> #          $got->[0] = '-nntpd    3130714 julm    4u      REG               
> 0,53     77189  2606550 /tmp/nix-shell.D0VGvX (deleted)
> #     '
> #     $expected->[0] = Does not exist
> # [
> #   '-nntpd    3130714 julm    4u      REG               0,53     77189  
> 2606550 /tmp/nix-shell.D0VGvX (deleted)
> # '
> # ]

$ (cd public-inbox-1.7.0; perl -I$out/lib/perl5/site_perl t/nntpd.t )
> [...]
> not ok 99 - no deleted files
> #   Failed test 'no deleted files'
> #   at t/nntpd.t line 363.
> #     Structures begin differing at:
> #          $got->[0] = '-nntpd    3131133 julm    4u      REG               
> 0,53     77189  2606550 /tmp/nix-shell.D0VGvX (deleted)
> #     '
> #     $expected->[0] = Does not exist
> # [
> #   '-nntpd    3131133 julm    4u      REG               0,53     77189  
> 2606550 /tmp/nix-shell.D0VGvX (deleted)
> # '
> # ]

$ (cd public-inbox-1.7.0; perl -I$out/lib/perl5/site_perl t/solver_git.t )
> ok 1 - use PublicInbox::Inbox;
> ok 2 - use PublicInbox::V2Writable;
> ok 3 - use PublicInbox::Git;
> ok 4 - use PublicInbox::SolverGit;
> ok 5 - use PublicInbox::WWW;
> ok 6 # skip Inline::C unconfigured/missing (mkdir -p 
> ~/.cache/public-inbox/inline-c) OR Socket::MsgHdr missing
> ok 7 # skip Inline::C unconfigured/missing (mkdir -p 
> ~/.cache/public-inbox/inline-c) OR Socket::MsgHdr missing
> ok 8 # skip Inline::C unconfigured/missing (mkdir -p 
> ~/.cache/public-inbox/inline-c) OR Socket::MsgHdr missing
> not ok 9 - solved a blob!
> #   Failed test 'solved a blob!'
> #   at t/solver_git.t line 151.
> not ok 10 - got a git object for the blob
> #   Failed test 'got a git object for the blob'
> #   at t/solver_git.t line 153.
> #          got: ''
> #     expected: 'PublicInbox::Git'
> not ok 11 - resolved blob to unabbreviated identifier
> #   Failed test 'resolved blob to unabbreviated identifier'
> #   at t/solver_git.t line 154.
> #          got: undef
> #     expected: '69df7d565d49fbaaeb0a067910f03dc22cd52bd0'
> not ok 12 - type specified
> #   Failed test 'type specified'
> #   at t/solver_git.t line 155.
> #          got: undef
> #     expected: 'blob'
> not ok 13 - size returned
> #   Failed test 'size returned'
> #   at t/solver_git.t line 156.
> #          got: undef
> #     expected: '4405'
> Can't call method "cat_file" on an undefined value at t/solver_git.t line 158.
> # Tests were run but no plan was declared and done_testing() was not seen.

I can also reproduce Infinisil's test failure with:
$ (cd public-inbox-1.7.0; TMPDIR=/var/tmp perl -I$out/lib/perl5/site_perl 
t/lei_to_mail.t )
> ok 96 - got Maildir callback
> Use of uninitialized value in open at t/lei_to_mail.t line 263. 
> Bail out!  No such file or directory 

$ mount | grep 'on /var/tmp'
> losurdo/var/tmp on /var/tmp type zfs (rw,relatime,xattr,posixacl)



With Inline::C, and without Nix's sandbox
-----------------------------------------
I get one more test to fail:
$ export PERL_INLINE_DIRECTORY=$PWD/inline-c; rm -rf $PERL_INLINE_DIRECTORY; 
mkdir $PERL_INLINE_DIRECTORY
$ make -C public-inbox-1.7.0 test
> [...]
> Test Summary Report
> -------------------
> t/lei-q-save.t             (Wstat: 512 Tests: 108 Failed: 2)
>   Failed tests:  95, 97
>   Non-zero exit status: 2

More precisely:
$ (cd public-inbox-1.7.0; perl -I$out/lib/perl5/site_perl t/lei-q-save.t )
> [...]
> ok 93 - lei up $TMPDIR/lei-daemon/s (absolute lei up)
> execve: No such file or directory
> fork_exec blib/script/perl -i -p -e s/\[/\0/ 
> /tmp/nix-shell.EKTZrS/pi-lei-q-save-3131696-HNqt/lei-daemon/.local/share/lei/saved-searches/after-af0b1d56d93b52910b7172f052d9b9e6c7b3411a060b50006e417c9aa83f5ce2/lei.saved-search
>  failed: No such file or directory

Which is an artifact of my testing method, because with an absolute perl:
$ (cd public-inbox-1.7.0; $(which perl) -I$out/lib/perl5/site_perl 
t/lei-q-save.t )
> [...]
> not ok 95 - git config parse error shown w/ lei ls-search
> #   Failed test 'git config parse error shown w/ lei ls-search'
> #   at t/lei-q-save.t line 228.
> #                   'fatal: ligne 3 de config incorrecte dans le fichier 
> /tmp/nix-shell.EKTZrS/pi-lei-q-save-3132353-xECZ/lei-daemon/.local/share/lei/saved-searches/after-c8d60f185616bece7957076be4604781d6cae876642a4faa127a2fcfc9647fc8/lei.saved-search
> # git config -z -l --includes 
> --file=/tmp/nix-shell.EKTZrS/pi-lei-q-save-3132353-xECZ/lei-daemon/.cache/lei/saved-tmp.3132468.1639007508.config
>  failed: $?=32768
> # '
> #     doesn't match '(?^:bad config 
> line.*?\/tmp\/nix\-shell\.EKTZrS\/pi\-lei\-q\-save\-3132353\-xECZ\/lei\-daemon\/\.local\/share\/lei\/saved\-searches\/after\-c8d60f185616bece7957076be4604781d6cae876642a4faa127a2fcfc9647fc8\/lei\.saved\-search)'
> ok 96 - lei up --all (up works with bad config)
> not ok 97 - git config parse error shown w/ lei up
> #   Failed test 'git config parse error shown w/ lei up'
> #   at t/lei-q-save.t line 231.
> #                   'fatal: ligne 3 de config incorrecte dans le fichier 
> /tmp/nix-shell.EKTZrS/pi-lei-q-save-3132353-xECZ/lei-daemon/.local/share/lei/saved-searches/after-c8d60f185616bece7957076be4604781d6cae876642a4faa127a2fcfc9647fc8/lei.saved-search
> # git config -z -l --includes 
> --file=/tmp/nix-shell.EKTZrS/pi-lei-q-save-3132353-xECZ/lei-daemon/.cache/lei/saved-tmp.3132468.1639007508.config
>  failed: $?=32768
> # '
> #     doesn't match '(?^:bad config 
> line.*?\/tmp\/nix\-shell\.EKTZrS\/pi\-lei\-q\-save\-3132353\-xECZ\/lei\-daemon\/\.local\/share\/lei\/saved\-searches\/after\-c8d60f185616bece7957076be4604781d6cae876642a4faa127a2fcfc9647fc8\/lei\.saved\-search)'
It succeeds if I use LANG=C instead of LANG=fr_FR.UTF-8



With Inline::C, and with Nix's sandbox
--------------------------------------

Using (in pkgs/servers/mail/public-inbox/default.nix):
> preCheck = ''
>   perl certs/create-certs.perl
>   export HOME=$(mktemp -d)
>   mkdir -p $HOME/.cache/public-inbox/inline-c
> '';

$ nix -L build -f . public-inbox
> [...]
> perl5.34.0-public-inbox> t/lei-refresh-mail-sync.t .... ok
Hangs like forever after this line, while on t/lei-sigpipe.t:

$ ps auxwwf
> root     1755997  0.0  0.0 453172  2800 ?        Ssl  déc.04   0:03 
> nix-daemon --daemon
> root     1811429  0.0  0.0 453652  1928 ?        Ssl  déc.04   0:00  \_ 
> nix-daemon 1757028
> root     1811455  0.0  0.0 453652  2004 ?        Ssl  déc.04   0:00  \_ 
> nix-daemon 1757031
> root     1839837  0.0  0.0 453652  1832 ?        Ssl  déc.04   0:00  \_ 
> nix-daemon 1757027
> root     1839841  0.0  0.0 453652  1996 ?        Ssl  déc.04   0:00  \_ 
> nix-daemon 1757030
> root     1839856  0.0  0.0 453652  1832 ?        Ssl  déc.04   0:00  \_ 
> nix-daemon 1757029
> root     3135741  0.0  0.2 603352 17080 ?        Ssl  01:05   0:00  \_ 
> nix-daemon 3135672
> nixbld1  3137110  0.0  0.0   5200  4072 ?        Ss   01:05   0:01      \_ 
> bash -e /nix/store/qf3mzpvsmkrw963xchbivcci06078n13-builder.sh
> nixbld1  3140619  0.0  0.0   4996  4012 ?        S    01:05   0:00          
> \_ make 
> SHELL=/nix/store/l0wlqpbsvh1pgvhcdhw7qkka3d31si7k-bash-5.1-p8/bin/bash 
> VERBOSE=y test
> nixbld1  3140633  0.0  0.1  17188 13352 ?        S    01:05   0:01          | 
>   \_ /nix/store/vslsa0l17xjcrdgm2knwj0z5hlvf73m7-perl-5.34.0/bin/perl 
> -MExtUtils::Command::MM -MTest::Harness -e undef *Test::Harness::Switches; 
> test_harness(0, 'blib/lib', 'blib/arch') t/admin.t t/altid.t t/altid_v2.t 
> t/cgi.t t/cmd_ipc.t t/content_hash.t t/dir_idle.t t/edit.t 
> t/eml_content_disposition.t t/eml_content_type.t t/epoll.t t/extindex-psgi.t 
> t/extsearch.t t/fake_inotify.t t/feed.t t/gcf2.t t/gcf2_client.t t/httpd.t 
> t/idx_stack.t t/imap.t t/imap_searchqp.t t/imapd-tls.t t/imapd.t 
> t/inbox_idle.t t/index-git-times.t t/indexlevels-mirror.t t/ipc.t 
> t/kqnotify.t t/lei-auto-watch.t t/lei-convert.t t/lei-daemon.t 
> t/lei-export-kw.t t/lei-externals.t t/lei-import-http.t t/lei-import-imap.t 
> t/lei-import-maildir.t t/lei-import-nntp.t t/lei-import.t t/lei-index.t 
> t/lei-inspect.t t/lei-lcat.t t/lei-p2q.t t/lei-q-kw.t t/lei-q-remote-import.t 
> t/lei-q-save.t t/lei-q-thread.t t/lei-refresh-mail-sync.t t/lei-sigpipe.t 
> t/lei-tag.t t/lei-up.t t/lei-watch.t t/lei.t t/lei_dedupe.t t/lei_external.t 
> t/lei_lcat.t t/lei_mail_sync.t t/lei_overview.t t/lei_saved_search.t 
> t/lei_store.t t/lei_to_mail.t t/lei_xsearch.t t/mbox_lock.t t/mbox_reader.t 
> t/mdir_reader.t t/mime.t t/miscsearch.t t/net_reader-imap.t t/nntpd-tls.t 
> t/nntpd.t t/nodatacow.t t/on_destroy.t t/plack.t t/psgi_attach.t 
> t/psgi_bad_mids.t t/psgi_mount.t t/psgi_multipart_not.t t/psgi_scan_all.t 
> t/psgi_search.t t/psgi_v2.t t/rename_noreplace.t t/reply.t 
> t/search-thr-index.t t/shared_kv.t t/solver_git.t t/thread-index-gap.t 
> t/uri_imap.t t/uri_nntps.t t/v2dupindex.t t/www_altid.t t/xcpdb-reshard.t 
> t/www_static.t t/watch_multiple_headers.t t/watch_maildir_v2.t 
> t/watch_maildir.t t/watch_imap.t t/watch_filter_rubylang.t t/view.t 
> t/v2reindex.t t/v2mirror.t t/v2mda.t t/v2index-late-dupe.t 
> t/v2-add-remove-add.t t/v1reindex.t t/v1-add-remove-add.t t/time.t 
> t/thread-cycle.t t/spamcheck_spamc.t t/sigfd.t t/replace.t 
> t/reindex-time-range.t t/qspawn.t t/purge.t t/psgi_text.t t/precheck.t 
> t/over.t t/nulsubject.t t/nntpd-v2.t t/nntp.t t/multi-mid.t t/msgtime.t 
> t/msgmap.t t/msg_iter.t t/mid.t t/mda_filter_rubylang.t t/mda.t t/linkify.t 
> t/init.t t/indexlevels-mirror-v1.t t/inbox.t t/import.t t/imap_tracker.t 
> t/hval.t t/httpd-unix.t t/httpd-https.t t/httpd-corner.t t/gzip_filter.t 
> t/git.t t/filter_vger.t t/filter_subjecttag.t t/filter_rubylang.t 
> t/filter_mirror.t t/filter_base.t t/emergency.t t/ds-poll.t t/ds-leak.t 
> t/ds-kqxs.t t/config_limiter.t t/config.t t/address.t
> nixbld1  3145719  0.0  0.4  44576 35640 ?        S    01:09   0:01          | 
>       \_ t/lei-sigpipe.t
> nixbld1  3145743  0.0  0.1  14388 10388 ?        S    01:09   0:00          | 
>           \_ /nix/store/vslsa0l17xjcrdgm2knwj0z5hlvf73m7-perl-5.34.0/bin/perl 
> -w 
> -I/nix/store/vslsa0l17xjcrdgm2knwj0z5hlvf73m7-perl-5.34.0/lib/perl5/site_perl 
> -I/nix/store/1hdx7bxjwqrfnalalkgbwi32l45h8z7b-perl5.34.0-Mail-IMAPClient-3.42/lib/perl5/site_perl
>  -I/nix/st blib/script/lei q -q -t z:1..
> nixbld1  3145724  0.0  0.5  50504 42160 ?        S    01:09   0:00          
> \_ lei-daemon 
> /build/pi-lei-sigpipe-7522-WoHO/lei-daemon/xdg_run/lei/5.seq.sock
> nixbld1  3145730  0.0  0.4  50092 39736 ?        S    01:09   0:00            
>   \_ lei/store /build/pi-lei-sigpipe-7522-WoHO/lei-daemon/.local/share

t/lei-sigpipe.t is on:
> 01:30:29.508334 clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=1, tv_nsec=0}, 
> 0x7fffffff5090) = 0 <1.000360>
> 01:30:30.509837 clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=1, tv_nsec=0}, 
> 0x7fffffff5090) = 0 <1.000186>
> 01:30:31.510259 clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=1, tv_nsec=0}, 
> 0x7fffffff5090) = 0 <1.000175>
> [...]

lei-daemon store is on:
> 01:31:03.834708 epoll_wait(5,

Looks like it is waiting on sysread() in
https://public-inbox.org/public-inbox.git/tree/t/lei-sigpipe.t#n35

This test does succeed outside Nix's sandbox:
$ (cd public-inbox-1.7.0; export PERL_INLINE_DIRECTORY=$PWD/inline-c; rm -rf 
$PERL_INLINE_DIRECTORY; mkdir $PERL_INLINE_DIRECTORY; prove -bvw 
t/lei-sigpipe.t )
> t/lei-sigpipe.t ..               
> ok 1 - lei import $TMPDIR/lei-daemon/big.eml
> ok 2 - read one byte             
> ok 3 - signaled                  
> ok 4 - got SIGPIPE               
> ok 5 - quiet after sigpipe 
> ok 6 - read one byte
> ok 7 - signaled -f mboxcl2       
> ok 8 - got SIGPIPE -f mboxcl2    
> ok 9 - quiet after sigpipe -f mboxcl2
> ok 10 - read one byte
> ok 11 - signaled -f text         
> ok 12 - got SIGPIPE -f text
> ok 13 - quiet after sigpipe -f text
> ok 14 - lei daemon-pid (daemon-pid after t/lei-sigpipe.t:44)
> ok 15 - daemon running after t/lei-sigpipe.t:44
> ok 16 - lei daemon-kill (daemon-kill after t/lei-sigpipe.t:44)
> ok 17 - t/lei-sigpipe.t:44 daemon stopped
> ok 18 - t/lei-sigpipe.t:44 daemon XDG_RUNTIME_DIR/lei/errors.log empty
> 1..18
> ok
> All tests successful.
> Files=1, Tests=18,  7 wallclock secs ( 0.06 usr  0.06 sys +  3.44 cusr  2.73 
> csys =  6.29 CPU)
> Result: PASS

More surprisingly, it even succeeds when run manually
inside the hanging Nix sandbox:
$ sudo nsenter --target 3137110 --all -S 1000 -G 100 $(readlink -e $(which 
bash))
$ . /build/env-vars
$ cd /build
$ export HOME=$(mktemp -d)
$ mkdir -p $HOME/.cache/public-inbox/inline-c
$ LANG=C prove -bvw t/lei-sigpipe.t
> t/lei-sigpipe.t .. 
> ok 1 - lei import $TMPDIR/lei-daemon/big.eml
> ok 2 - read one byte
> ok 3 - signaled 
> ok 4 - got SIGPIPE 
> ok 5 - quiet after sigpipe 
> ok 6 - read one byte
> ok 7 - signaled -f mboxcl2
> ok 8 - got SIGPIPE -f mboxcl2
> ok 9 - quiet after sigpipe -f mboxcl2
> ok 10 - read one byte
> ok 11 - signaled -f text
> ok 12 - got SIGPIPE -f text
> ok 13 - quiet after sigpipe -f text
> ok 14 - lei daemon-pid (daemon-pid after t/lei-sigpipe.t:44)
> ok 15 - daemon running after t/lei-sigpipe.t:44
> ok 16 - lei daemon-kill (daemon-kill after t/lei-sigpipe.t:44)
> ok 17 - t/lei-sigpipe.t:44 daemon stopped
> ok 18 - t/lei-sigpipe.t:44 daemon XDG_RUNTIME_DIR/lei/errors.log empty
> 1..18
> ok
> All tests successful.
> Files=1, Tests=18,  4 wallclock secs ( 0.06 usr  0.06 sys +  1.23 cusr  1.48 
> csys =  2.83 CPU)
> Result: PASS

Even more strange, Dominique was able to reproduce
the hang this morning, but no longer tonight..

Cheers,
Julien

Reply via email to