Tíquete #38855

Breakage on Solaris under ISO-8859 locales

: 2019-01-10 05:05 Última Atualização: 2019-01-21 18:19

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Marcos:
(Nenhum)
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Invalid
Arquivo:
Nenhum
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

Yash 2.48 breaks badly on Solaris when an ISO-8859-* locale is active and any high-byte characters are processed.

Test script:

set -x
sh -xc 'echo "XaYöb"'

case XaYöb in
( X*Y* ) echo ok; exit ;;
( *Y* ) echo yashbug; exit ;;
( * ) echo wrong; exit ;;
esac
echo WRONG2

To trigger the bug, run this on Solaris with something like: LANG=nl_NL.ISO8859-1 yash test.sh

Symptoms:

  • The sh -xc command is traced but otherwise not executed. In general it seems like an external command is silently skipped if any of its arguments contain a high-byte character.
  • The case pattern matches *Y* but not X*Y* as it should, so yashbug is output.

Whether this is a Solaris bug or a yash bug, I couldn't say. However, yash seems to be the only shell exhibiting these symptoms on Solaris.

FYI, Solaris VMs can be downloaded and used free of charge for the purposes of software development and testing. See: https://www.oracle.com/technetwork/server-storage/solaris11/downloads/vm-templates-2245495.html

Ticket History (3/5 Histories)

2019-01-10 05:05 Updated by: mcdutchie
  • New Ticket "Breakage on Solaris under ISO-8859 locales" created
2019-01-15 22:31 Updated by: magicant
Comentário

Reproduced. But yash does not seem to compile correctly on Solaris in the first place.

2019-01-16 00:30 Updated by: magicant
Comentário

Yash's configuration header defines _XOPEN_SOURCE_EXTENDED to get the declaration of the "enhanced curses" features, but on Solaris this macro hides functions that are only available on XPG5 or later. The macro should not be defined on Solaris.

That said, just removing the macro definition did not fix the encoding issue.

2019-01-20 12:37 Updated by: magicant
Comentário

It seems the wcsnrtombs function is broken on Solaris. If you comment out the HAVE_WCSNRTOMBS macro definition in config.h, yash no longer prints "yashbug".

2019-01-21 18:19 Updated by: magicant
  • Resolução Update from Nenhum to Invalid
  • Estado Update from Aberto to Fechado
Comentário

Added a note in the README.

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login