Re: [RFA] Handle older iconv programs

Paul Pluzhnikov
2009-12-11T21:03:29Z

On Mon, Dec 7, 2009 at 12:36 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> +  set_in_environ (iconv_env, "LANGUAGE", "en");
>
> I think "C" would be preferable here.
> Or, just remove LANGUAGE from the environment.

I am seeing a crash which I think directly relates to this patch:

(top) r
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/grte/v1/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
*__GI_getenv (name=0x7ffff6cb8f85 "NGUAGE") at ../sysdeps/generic/getenv.c:93
93 if (name_start == ep_start && !strncmp (*ep + 2, name, len)
(top) bt
#0 *__GI_getenv (name=0x7ffff6cb8f85 "NGUAGE") at
../sysdeps/generic/getenv.c:93
#1 0x00007ffff6bcbf8f in guess_category_value (domainname=0x9cffb0 "gdb",
msgid1=0x77d8a0 "The `host character set' is the one used by the
system GDB is running on.\nYou may only use supersets of ASCII for
your host character set; GDB does\nnot support any others.\nTo see a
list of the charact"..., msgid2=0x0, plural=0, n=0,
category=8) at dcigettext.c:1107
#2 __dcigettext (domainname=0x9cffb0 "gdb",
msgid1=0x77d8a0 "The `host character set' is the one used by the
system GDB is running on.\nYou may only use supersets of ASCII for
your host character set; GDB does\nnot support any others.\nTo see a
list of the charact"..., msgid2=0x0, plural=0, n=0,
category=8) at dcigettext.c:533
#3 0x00000000004abd33 in _initialize_charset () at ../../src/gdb/charset.c:898
#4 0x000000000041d5d8 in initialize_all_files () at init.c:160
#5 0x000000000040c289 in gdb_init (argv0=0x7fffffffddf2
"/home/ppluzhnikov/bin/gdb64-cvs") at ../../src/gdb/top.c:1729
#6 0x0000000000400fa5 in captured_main (data=0x7fffffffd940) at
../../src/gdb/main.c:688
#7 0x00000000004fdbd9 in catch_errors (func=0x40068d <captured_main>,
func_args=0x7fffffffd940, errstring=0x74f01f "", mask=6) at
../../src/gdb/exceptions.c:510
#8 0x00000000004016d4 in gdb_main (args=0x7fffffffd940) at
../../src/gdb/main.c:911
#9 0x00000000004003a4 in main (argc=1, argv=0x7fffffffda38) at
../../src/gdb/gdb.c:33

Environment has been stepped on:

(top) p __environ[0]
$4 = 0x6e0a73656f642042 <Address 0x6e0a73656f642042 out of bounds>
(top) x/s __environ
0x9fa370: "B does\nnot support any others.\nTo see a list of
the character sets GDB supports, type `set charset <TAB>'."

Still digging into the cause ...

--
Paul Pluzhnikov