Ticket #38855

Breakage on Solaris under ISO-8859 locales

Open Date: 2019-01-10 05:05 Last Update: 2019-01-20 12:37

Reporter:
Owner:
Type:
Status:
Open [Owner assigned]
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
None
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

Attachment File List

No attachments

Ticket History (3/4 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
Comment

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

2019-01-16 00:30 Updated by: magicant
Comment

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
Comment

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".

Edit

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