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

[mu bug] 1.12.0 test failures #2631

Closed
1 task done
manphiz opened this issue Feb 25, 2024 · 6 comments · Fixed by #2635
Closed
1 task done

[mu bug] 1.12.0 test failures #2631

manphiz opened this issue Feb 25, 2024 · 6 comments · Fixed by #2635

Comments

@manphiz
Copy link
Contributor

manphiz commented Feb 25, 2024

Describe the bug
3 out of 46 tests fail when building in Debian's chroot environment (sbuild). Though the failures are deterministic, I suspect that this may be due to that the build environment produces different output compared with the Developers. It would be good if the tests are made more robust so that they won't be affected by environment differences.

  • 34: test-cmd-view
----------------------------------- stderr -----------------------------------
**
ERROR:../mu/mu-cmd-view.cc:334:void test_mu_view_01(): assertion failed (res->standard_out.size() == 364): (388 == 364)
==============================================================================
  • 36: test-cmd-cfind
----------------------------------- stderr -----------------------------------
**
ERROR:../mu/mu-cmd-cfind.cc:336:void test_mu_cfind_plain(): assertion failed (s1s__.c_str() == s2s__.c_str()): ("M\\303\\274 testmu@testmu.xx\nHelmut Kr\\303\\266ger hk@testmu.xxx\n" == "M\303\274 testmu@testmu.xx\nHelmut Kr\303\266ger hk@testmu.xxx\n")
==============================================================================
  • 38: test-mu-guile
----------------------------------- stderr -----------------------------------
guile: warning: failed to install locale
Backtrace:
           1 (primitive-load "/<<BUILDDIR>>/maildir-ut?")
           0 (setlocale 6 "")

ERROR: In procedure setlocale:
In procedure setlocale: Invalid argument
Error: something went wrong
**
ERROR:../guile/tests/test-mu-guile.cc:89:void test_something(const char*): assertion failed: (0)
==============================================================================

Full build log: https://gist.github.com/manphiz/76fe2b46cc685736fc9ce7bbefee3593

Environment
Current Debian sid/unstable

Checklist

  • you are running either the latest 1.8.x/1.10.x release or master (otherwise, please upgrade).
    Running 1.12.0
@djcb
Copy link
Owner

djcb commented Feb 25, 2024

Yes, we test locally and in CI (Ubuntu & MacOS):
https://github.com/djcb/mu/actions/runs/8031147033/job/21939183124

I suspect the sbuild environment is so bare-bones it is missing some locale-related things. Can you find what? And what is the exact sequence of commands you use to setup / build mu in the sbuild environment? Thanks.

@djcb djcb added needinfo and removed new labels Feb 25, 2024
@manphiz
Copy link
Contributor Author

manphiz commented Feb 25, 2024

Yes, we test locally and in CI (Ubuntu & MacOS): https://github.com/djcb/mu/actions/runs/8031147033/job/21939183124

I suspect the sbuild environment is so bare-bones it is missing some locale-related things. Can you find what?

sbuild uses a chroot environment and installs all required build dependencies of a given package before building, so it should provide a sufficient environment. More specifically, it uses dash which is a posix-compatible shell, and uses C.UTF-8 locale by default:

# locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8

And what is the exact sequence of commands you use to setup / build mu in the sbuild environment? Thanks.

The exact commands used to set up the environment and run the build and test can be found in the full build log I included in the first post, more specifically:

Build comamnd: https://gist.github.com/manphiz/76fe2b46cc685736fc9ce7bbefee3593#file-maildir-utils_1-12-0-1_amd64-2024-02-25t00-51-07z-build-L1399

Test command: https://gist.github.com/manphiz/76fe2b46cc685736fc9ce7bbefee3593#file-maildir-utils_1-12-0-1_amd64-2024-02-25t00-51-07z-build-L1730

@djcb
Copy link
Owner

djcb commented Feb 25, 2024

Hmm, I don't have the required setup, nor the time to set it up right now, let alone tracking down the specific problem.
Since it's such a specific setup, I guess there's something missing in the setup, can you find what? One clue is that setlocale(LC_ALL, "") seems to fail in your environment.

@manphiz
Copy link
Contributor Author

manphiz commented Feb 26, 2024

Turns out that to correctly handle all the unicode we do need a more full fledged locales environment. After fixing the dependencies in the Debian build control, the (setlocale LC_ALL "") issue is fixed together with the other tests that outputs different texts. Now test-mu-guile fails due to unable to dlopen "libguile-mu.so", which should be fixed by fixing the load path but I'm not sure how to do that for guile.

Test log regarding the failed tests:

=================================== 38/46 ====================================
test:         test-mu-guile
start time:   00:11:22
duration:     0.48s
result:       killed by signal 6 SIGABRT
command:      MALLOC_PERTURB_=27 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/guile/tests/test-mu-guile
----------------------------------- stdout -----------------------------------
TAP version 13
# random seed: R02S319b08b187720419953670827db68076
# mu-DEBUG: run-command: '/usr/bin/rm'  '-fr'  '/tmp/mu-tmp-F9EEJ2'
# mu-DEBUG: removed '/tmp/mu-tmp-F9EEJ2'
1..3
# Start of guile tests
not ok /guile/queries - ERROR:../guile/tests/test-mu-guile.cc:89:void test_something(const char*): assertion failed: (0)
Bail out!
----------------------------------- stderr -----------------------------------
Backtrace:
          18 (primitive-load "/<<BUILDDIR>>/maildir-ut…")
In ice-9/eval.scm:
   721:20 17 (primitive-eval _)
In ice-9/psyntax.scm:
  1229:36 16 (expand-top-sequence _ _ _ #f _ _ _)
  1221:19 15 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
   259:10 14 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) …)
In ice-9/boot-9.scm:
  3935:20 13 (process-use-modules _)
   222:17 12 (map1 (((mu)) ((mu stats))))
  3936:31 11 (_ ((mu)))
  3327:17 10 (resolve-interface (mu) #:select _ #:hide _ #:prefix _ # …)
In ice-9/threads.scm:
    390:8  9 (_ _)
In ice-9/boot-9.scm:
  3253:13  8 (_)
In ice-9/threads.scm:
    390:8  7 (_ _)
In ice-9/boot-9.scm:
  3544:20  6 (_)
   2836:4  5 (save-module-excursion _)
  3564:26  4 (_)
In unknown file:
           3 (primitive-load-path "mu" #<procedure 7fddd3465c60 at i…>)
           2 (load-extension "libguile-mu" "mu_guile_init")
In system/foreign-library.scm:
   190:25  1 (load-foreign-library _ #:extensions _ # _ #:search-path …)
In unknown file:
           0 (dlopen "libguile-mu.so" 1)

ERROR: In procedure dlopen:
In procedure dlopen: file "libguile-mu.so", message "libguile-mu.so: cannot open shared object file: No such file or directory"
Error: something went wrong
**
ERROR:../guile/tests/test-mu-guile.cc:89:void test_something(const char*): assertion failed: (0)
==============================================================================

Full build log: https://gist.github.com/manphiz/cb253a234cd1fadfc2c03d7aa74ed8a1#file-maildir-utils_1-12-0-1_amd64-build-L3001

EDIT: more specifically, the generated library can be found at guile/libguile-mu.so under the build path, whereas the tests are located at guile/tests/test-mu-guile.scm.

EDIT 2: sent #2635 which I've tested to fix this issue. PTAL.

@djcb
Copy link
Owner

djcb commented Mar 1, 2024

I've pushed a small change a few days ago which may help to double-check some locale things.

Anyhow, this is working now? Can we close this ticket?

@manphiz
Copy link
Contributor Author

manphiz commented Mar 1, 2024

#2635 should fix this. Any concerns before merging that?

@djcb djcb closed this as completed in db6191e Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants