Ticket #38855

Breakage on Solaris under ISO-8859 locales

Eröffnet am: 2019-01-10 05:05 Letztes Update: 2019-01-21 18:19

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
(Keine)
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Ungültiger
Datei:
Keine
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-Verlauf (3/5 Historien)

2019-01-10 05:05 Aktualisiert von: mcdutchie
  • New Ticket "Breakage on Solaris under ISO-8859 locales" created
2019-01-15 22:31 Aktualisiert von: magicant
Kommentar

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

2019-01-16 00:30 Aktualisiert von: magicant
Kommentar

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 Aktualisiert von: magicant
Kommentar

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 Aktualisiert von: magicant
  • Lösung Update from Keine to Ungültiger
  • Status Update from Offen to Geschlossen
Kommentar

Added a note in the README.

Dateianhangliste

Keine Anhänge

Bearbeiten

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