1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AIX 7.3 TL3 SP0 の LANG=Ja_JP 環境は perl 5.38 のため "Locale 'Ja_JP' is unsupported, and may crash the interpreter. "というメッセージが出力する

Last updated at Posted at 2025-03-27

はじめに

AIX 7.3 TL3 ではデフォルトで perl のバージョンは 5.38 が導入されています。
しかしながら、perl 5.38 ではJa_JP (Shift JIS) がサポートされないそうです。

そのため "Locale 'Ja_JP' is unsupported, and may crash the interpreter." というメッセージが出力します。


環境

AIX 7.3 TL3 SP0
perl 5.38

# oslevel -s
7300-03-00-2446

# perl --version
This is perl 5, version 38, subversion 2 (v5.38.2) built for aix-thread-multi

perl コマンドで該当メッセージ確認

# LANG=Ja_JP perl --version
Locale 'Ja_JP' is unsupported, and may crash the interpreter.

This is perl 5, version 38, subversion 2 (v5.38.2) built for aix-thread-multi

Copyright 1987-2023, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.

# echo $?
0
#
# LANG=Ja_JP perl -h
Locale 'Ja_JP' is unsupported, and may crash the interpreter.

Usage: perl [switches] [--] [programfile] [arguments]
  -0[octal/hexadecimal] specify record separator (\0, if no argument)
  -a                    autosplit mode with -n or -p (splits $_ into @F)
  -C[number/list]       enables the listed Unicode features
  -c                    check syntax only (runs BEGIN and CHECK blocks)
  -d[t][:MOD]           run program under debugger or module Devel::MOD
  -D[number/letters]    set debugging flags (argument is a bit mask or alphabets)
  -e commandline        one line of program (several -e's allowed, omit programfile)
  -E commandline        like -e, but enables all optional features
  -f                    don't do $sitelib/sitecustomize.pl at startup
  -F/pattern/           split() pattern for -a switch (//'s are optional)
  -g                    read all input in one go (slurp), rather than line-by-line (alias for -0777)
  -i[extension]         edit <> files in place (makes backup if extension supplied)
  -Idirectory           specify @INC/#include directory (several -I's allowed)
  -l[octnum]            enable line ending processing, specifies line terminator
  -[mM][-]module        execute "use/no module..." before executing program
  -n                    assume "while (<>) { ... }" loop around program
  -p                    assume loop like -n but print line also, like sed
  -s                    enable rudimentary parsing for switches after programfile
  -S                    look for programfile using PATH environment variable
  -t                    enable tainting warnings
  -T                    enable tainting checks
  -u                    dump core after parsing program
  -U                    allow unsafe operations
  -v                    print version, patchlevel and license
  -V[:configvar]        print configuration summary (or a single Config.pm variable)
  -w                    enable many useful warnings
  -W                    enable all warnings
  -x[directory]         ignore text before #!perl line (optionally cd to directory)
  -X                    disable all warnings

Run 'perldoc perl' for more help with Perl.

# echo $?
0
#

コメントにも記載していますが、上記メッセージが出ても、Return Code は 0 でした。


AIXコマンドでの出力確認


AIX の一部のコマンドの中には perl を使用するものがあり、コマンドの標準出力にも出る場合があります。

例:

・shutdown コマンド (コマンド内の wpar 停止を行う箇所(/etc/rc.d/rc2.d/Kwpars)で使用されています
・lswpar コマンド

など。

shutdown コマンド確認

# shutdown -F
SHUTDOWN PROGRAM

~ 省略 ~ 

Locale 'Ja_JP' is unsupported, and may crash the interpreter.
Locale 'Ja_JP' is unsupported, and may crash the interpreter.

lswpar コマンド確認

# lswpar
Locale 'Ja_JP' is unsupported, and may crash the interpreter.

回避するには?

perl スクリプトの場合は LANG=C や LANG=ja_JP.UTF-8 などで回避可能と考えられます。


補足:perl の locale サポートについて

perl document に 非UTF-8のマルチバイト文字を含むロケールのサポートはない旨の記載があります。

Locale '%s' is unsupported, and may crash the interpreter(S locale) The named locale is not supported by Perl, and using it leads to undefined behavior, including potentially crashing the computer.Currently the only locales that generate this severe warning are non-UTF-8 ones which have characters that require more than one byte to represent (common in older East Asian language locales). See perllocale.


おわりに

AIX コマンドの部分については今後のOSの修正があればなと思います。


以上です。

1
0
8

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?