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

--doc-gen returns 1 on success #1965

Closed
ncfavier opened this issue Jun 25, 2023 · 10 comments
Closed

--doc-gen returns 1 on success #1965

ncfavier opened this issue Jun 25, 2023 · 10 comments
Assignees
Labels
bug Unexpected problem or unintended behavior
Milestone

Comments

@ncfavier
Copy link

Bug summary

I'm trying to update the weechat package in nixpkgs (NixOS/nixpkgs#239716). The build currently fails with

weechat> doc generator: OK, 84 files updated
weechat> make[2]: *** [doc/CMakeFiles/doc-autogen.dir/build.make:91: doc/CMakeFiles/doc-autogen] Error 1
weechat> make[1]: *** [CMakeFiles/Makefile2:2202: doc/CMakeFiles/doc-autogen.dir/all] Error 2
weechat> make[1]: *** Waiting for unfinished jobs....

Surprisingly, the weechat-headless --doc-gen command used in the build returns an exit status of 1 despite the OK message. I can confirm this by running

$ WEECHAT_EXTRA_LIBDIR=$build/weechat-4.0.0/build/src \
  $build/weechat-4.0.0/build/src/gui/curses/headless/weechat-headless \
  --temp-dir --doc-gen foo --stdout
[2023-06-25 12:21:31] WeeChat 4.0.0 (compiled on Jun 24 2023 20:00:30)
[2023-06-25 12:21:31] Writing configuration file sec.conf (default options)
[2023-06-25 12:21:31] Reading configuration file sec.conf
[2023-06-25 12:21:31] Writing configuration file weechat.conf (default options)
[2023-06-25 12:21:31] Reading configuration file weechat.conf
[2023-06-25 12:21:31] Writing configuration file plugins.conf (default options)
[2023-06-25 12:21:31] Reading configuration file plugins.conf
[2023-06-25 12:21:31] Writing configuration file charset.conf (default options)
[2023-06-25 12:21:31] Reading configuration file charset.conf
[2023-06-25 12:21:31] Writing configuration file logger.conf (default options)
[2023-06-25 12:21:31] Reading configuration file logger.conf
[2023-06-25 12:21:31] Writing configuration file exec.conf (default options)
[2023-06-25 12:21:31] Reading configuration file exec.conf
[2023-06-25 12:21:31] Writing configuration file trigger.conf (default options)
[2023-06-25 12:21:31] Reading configuration file trigger.conf
[2023-06-25 12:21:31] Writing configuration file spell.conf (default options)
[2023-06-25 12:21:31] Reading configuration file spell.conf
[2023-06-25 12:21:31] Writing configuration file alias.conf (default options)
[2023-06-25 12:21:31] Reading configuration file alias.conf
[2023-06-25 12:21:31] Writing configuration file buflist.conf (default options)
[2023-06-25 12:21:31] Reading configuration file buflist.conf
[2023-06-25 12:21:31] Writing configuration file fifo.conf (default options)
[2023-06-25 12:21:31] Reading configuration file fifo.conf
[2023-06-25 12:21:31] Writing configuration file typing.conf (default options)
[2023-06-25 12:21:31] Reading configuration file typing.conf
[2023-06-25 12:21:31] Writing configuration file xfer.conf (default options)
[2023-06-25 12:21:31] Reading configuration file xfer.conf
[2023-06-25 12:21:31] Writing configuration file irc.conf (default options)
[2023-06-25 12:21:31] Reading configuration file irc.conf
[2023-06-25 12:21:31] Writing configuration file relay.conf (default options)
[2023-06-25 12:21:31] Reading configuration file relay.conf
[2023-06-25 12:21:31] Writing configuration file guile.conf (default options)
[2023-06-25 12:21:31] Reading configuration file guile.conf
[2023-06-25 12:21:31] Writing configuration file lua.conf (default options)
[2023-06-25 12:21:31] Reading configuration file lua.conf
[2023-06-25 12:21:31] Writing configuration file perl.conf (default options)
[2023-06-25 12:21:31] Reading configuration file perl.conf
[2023-06-25 12:21:31] Writing configuration file php.conf (default options)
[2023-06-25 12:21:31] Reading configuration file php.conf
[2023-06-25 12:21:31] Writing configuration file python.conf (default options)
[2023-06-25 12:21:31] Reading configuration file python.conf
[2023-06-25 12:21:31] Writing configuration file ruby.conf (default options)
[2023-06-25 12:21:31] Reading configuration file ruby.conf
[2023-06-25 12:21:31] Writing configuration file tcl.conf (default options)
[2023-06-25 12:21:31] Reading configuration file tcl.conf
[2023-06-25 12:21:31] Writing configuration file script.conf (default options)
[2023-06-25 12:21:31] Reading configuration file script.conf
[2023-06-25 12:21:31] Writing configuration file fset.conf (default options)
[2023-06-25 12:21:31] Reading configuration file fset.conf
doc generator: OK, no changes
[2023-06-25 12:21:31] Writing configuration file plugins.conf
[2023-06-25 12:21:31] Writing configuration file script.conf
[2023-06-25 12:21:31] Writing configuration file irc.conf
[2023-06-25 12:21:31] Writing configuration file perl.conf
[2023-06-25 12:21:31] Writing configuration file php.conf
[2023-06-25 12:21:31] Writing configuration file lua.conf
[2023-06-25 12:21:31] Writing configuration file logger.conf
[2023-06-25 12:21:31] Writing configuration file relay.conf
[2023-06-25 12:21:31] Writing configuration file spell.conf
[2023-06-25 12:21:31] Writing configuration file charset.conf
[2023-06-25 12:21:31] Writing configuration file trigger.conf
[2023-06-25 12:21:31] Writing configuration file xfer.conf
[2023-06-25 12:21:31] Writing configuration file ruby.conf
[2023-06-25 12:21:31] Writing configuration file guile.conf
$ echo $?
1

Where $build points to Nix's build directory.

If I remove the WEECHAT_EXTRA_LIBDIR variable, then the command does not load any plugins and succeeds with status 0, so presumably one of the plugins is silently crashing.

Steps to reproduce

That's a tough one, sorry. Install nix, clone nixpkgs, check out the above PR, run nix-build -A weechat-unwrapped --keep-failed, observe the error. Nix should say something like keeping build directory '$build', set build to that value to experiment.

Current behavior

1

Expected behavior

0

Suggested solutions

Additional information


  • WeeChat version: 4.0.0
  • OS, distribution and version: NixOS unstable
@ncfavier ncfavier added the bug Unexpected problem or unintended behavior label Jun 25, 2023
@ncfavier
Copy link
Author

It's guile. Building without guile supports succeeds. Possibly related to #1951 ?

@flashcode
Copy link
Member

Yeah in case a plugin crashes while quitting, the return code will be 1.

But the guile crash you're pointing is supposed to be fixed in 4.0.0, if you run WeeChat normally (with guile compiled), is guile crashing on /quit?

If yes, please put the backtrace with gdb, and I can take a look.

@ncfavier
Copy link
Author

It does seem like guile is crashing on /quit, because weechat exits with status 1 and does not reset the screen properly, but there's no error message or core dump. I'm not sure how to get a stack trace.

@ncfavier
Copy link
Author

I built weechat with 4185e7b reverted, and now everything is fine: no crash during doc-gen, guile loads fine, weechat exits cleanly with status 0. Do we know why that commit was necessary in the first place, or what caused the crash on Hurd?

@ncfavier
Copy link
Author

Okay, using guile 3 solves it. We were using guile 2.0.13.

@flashcode
Copy link
Member

OK, even if guile 3 fixes the issue, WeeChat is still supposed to run fine with Guile 2.0, so I'll update the fix I made for GNU/Hurd and make it specific to this OS (as for now I think it's just crashing on this OS with the old code).

I target this for version 4.0.1 (should be released very soon), that will address several other issues as well.

@flashcode flashcode self-assigned this Jun 25, 2023
@flashcode flashcode added this to the 4.0.1 milestone Jun 25, 2023
@flashcode
Copy link
Member

Or if you say it works with Guile 3, maybe the condition should be:

  • If running on GNU/Hurd (any Guile version) OR with Guile 2.x: use the current code
  • If running on other OS OR with Guile ≥ 3.x: use the old code

That means the fix I made only applies to GNU/Hurd or Guile < 3.

@ncfavier
Copy link
Author

Ideally we should understand why the crash happens, rather than just when. Maybe ask a guile developer?

@flashcode
Copy link
Member

I agree it would be better to understand, it could be hard to investigate though, there could be interactions between plugins in WeeChat, causing the crash.

I'll try to write a minimal program that reproduce the crash.

@flashcode
Copy link
Member

For now I'm not able to reproduce such crash outside WeeChat.
I'll just then commit my fix, to use scm_with_guile only on GNU/Hurd or with Guile < 3.

We can still try to understand and apply a better fix in a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants