Skip to content

sigsegv on set --show variable (when LANG is set to fr_FR.utf8) #8358

Closed

Description

@Nimamoh

fish version 3.3.1.

Playing with set builtin I stumbled upon a sigsegv using set --show var

Example script.fish:

#!/usr/bin/env fish

set -l local_var 'on'
set --show local_var
sh -c 'env HOME=$(mktemp -d) fish'
chmod +x script.fish
./script.fish

gives:
terminated by signal SIGSEGV

Playing abit further I realized that it is dependant of the LANG variable (since it happens when setting it to fr_FR.utf8 although it is not reproductible with en_US.utf8 neither fr_FR)

asciicast

Activity

  1. floam commented on Oct 17, 2021

    @floam
    Member

    I assume it's this bogus translation string:

    #: src/builtin_set.cpp:554
    #, c-format
    msgid "$%ls[%d]: |%ls|\n"
    msgstr "$%ls[%d] : taille=%d valeur=|%ls|\n"

    It doesn't crash here, but, obviously it can't work right with those format specifiers

    > set -l local_var 'foo bar'
    > set --show local_var
    $local_var: set in local scope, non exportée, with 1 elements
    $local_var[1] : taille=62063360 valeur=||
  2. added
    bug
    on Oct 17, 2021
  3. faho commented on Oct 18, 2021

    @faho
    Member

    We should really do the equivalent of

    for f in *.po
        msgfmt --check-format $f
    end

    in the tests - that uncovers this issue plus 6 more in sv.po. To be determined is where we can do that - maybe check that msgfmt --help works, in case there are other implementations? It's okay if this test doesn't run everywhere, as long as it runs on one of the CI machines.

    (tbh our translations are bad to begin with - we really need more people working on this to make them viable)

  4. floam commented on Oct 18, 2021

    @floam
    Member

    I feel like extremely poor quality translations are worse than the shell printing English text. How do we evaluate the quality of each language we support? Are we comfortable shipping each and every?

  5. faho commented on Oct 18, 2021

    @faho
    Member

    Ignoring the german translations (which I don't use), I can't say if they are "poor quality" as such - I have no idea if the translations that are there make any sort of sense. I know the french ones had a bunch of work put in.

    All I can say is how good the coverage is:

    for f in po/*.po
        echo $f: (msgfmt --statistics $f 2>&1)
    end

    after a msgmerge (i.e. updating the messages) shows:

    po/de.po: 1449 translated messages, 20297 untranslated messages.
    po/en.po: 2489 translated messages, 19257 untranslated messages.
    po/fr.po: 7865 translated messages, 13881 untranslated messages.
    po/nb.po: 0 translated messages, 21746 untranslated messages.
    po/nn.po: 0 translated messages, 21746 untranslated messages.
    po/pl.po: 163 translated messages, 21583 untranslated messages.
    po/pt_BR.po: 1287 translated messages, 20459 untranslated messages.
    po/sv.po: 1717 translated messages, 20029 untranslated messages.
    po/zh_CN.po: 85 translated messages, 21661 untranslated messages.
    

    which is

    po/de.po: 10.50609%
    po/en.po: 18.046694%
    po/fr.po: 57.025812%
    po/nb.po: 0%
    po/nn.po: 0%
    po/pl.po: 1.181845%
    po/pt_BR.po: 9.331497%
    po/sv.po: 12.449246%
    po/zh_CN.po: 0.616299%
    

    However, that includes a lot of completion scripts and such that aren't relevant to most people. So let's just check the much more important core translations by only generating the catalog for src/*, and the numbers look a bit better:

    po/de.po: 178 translated messages, 278 untranslated messages.
    po/en.po: 245 translated messages, 211 untranslated messages.
    po/fr.po: 337 translated messages, 119 untranslated messages.
    po/nb.po: 0 translated messages, 456 untranslated messages.
    po/nn.po: 0 translated messages, 456 untranslated messages.
    po/pl.po: 162 translated messages, 294 untranslated messages.
    po/pt_BR.po: 249 translated messages, 207 untranslated messages.
    po/sv.po: 193 translated messages, 263 untranslated messages.
    po/zh_CN.po: 85 translated messages, 371 untranslated messages.
    

    which is

    po/de.po: 39.035088%
    po/en.po: 53.72807%
    po/fr.po: 73.903509%
    po/nb.po: 0%
    po/nn.po: 0%
    po/pl.po: 35.526316%
    po/pt_BR.po: 54.605263%
    po/sv.po: 42.324561%
    po/zh_CN.po: 18.640351%
    

    So:

    • nb and nn are dead and should be removed
    • Why does "en.po" exist? The file says it was translated by @zanchey?
    • All others seem "viable" - they could be extended by one or two people working on them
    • We never really had a "string freeze" for translators, and have been changing messages pretty much on a whim, so a lot of these are bound to be almost-correct already, and just need to be updated. (note that a string freeze would also require a definite release date - or else what would we freeze for?)

    The big problem with translations here is that we really really need someone who speaks both the language and english to translate, and we don't, in general, have a lot of people working on fish. I'm not sure what's needed to improve the situation? Outreach? A nicer translation platform (I know "transifex" is a thing, as are "pootle" and "weblate")?

  6. faho commented on Oct 18, 2021

    @faho
    Member

    Okay, I've now added a test that runs msgfmt --check-format (if msgfmt --help works - we assume it's either full-GNU or not, if that turns out to not be true we can refine it). It fails like it should: https://github.com/faho/fish-shell/runs/3928302150

    Then I've fixed both the french and swedish format strings, so it should be fixed and not happen again. If anyone adds broken translations, they'll see the test fail and can fix it.

    Anything else related to the translations is 1. an open question, 2. can be done later, in a separate issue.

  7. added this to the fish 3.4.0 milestone on Oct 18, 2021
  8. zanchey commented on Oct 19, 2021

    @zanchey
    Member

    The English translation has curly quotation marks instead of straight marks. I think that's about all. It's useful for checking things are working, though.

  9. floam commented on Oct 22, 2021

    @floam
    Member

    Oh right. It probably needs to be updated, I think I see a lot of ' unlike the olden days.

  10. added a commit that references this issue on Dec 12, 2021
  11. locked as resolved and limited conversation to collaborators on Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions