Bug 902 - applications core dump with a segmentation fault when LANG=en_US
Summary: applications core dump with a segmentation fault when LANG=en_US
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.1
Hardware: All AIX
: P3 normal
Target Milestone: none
Assignee: Jim McDonough
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-18 05:53 UTC by Rod Hyde
Modified: 2005-11-14 09:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rod Hyde 2003-12-18 05:53:00 UTC
OVERVIEW DESCRIPTION:
Applications such as smbpasswd and smbclient core dump immediately if the LANG 
environment variable is set to en_US. It does not core dump if LANG is set to 
other values such as C, POSIX, En_US or en_GB.

STEPS TO REPRODUCE:
Run one of the applications with LANG=en_US
# cd /usr/local/source/samba-3.0.1/source/bin
# export LANG=en_US
# ./smbpasswd

ACTUAL RESULTS:
The application core dumps with a segmentation fault.
# ./smbpasswd
Segmentation fault(coredump)

EXPECTED RESULTS:
A prompt for a password...
# export LANG=C
# ./smbpasswd
New SMB password:

BUILD DATE & PLATFORM:
Samba 3.0.1 2003-12-15 on AIX 4.3.3 ML 11

ADDITIONAL BUILDS & PLATFORMS:
I know this also occurs with Samba 3.0.0.

ADDITIONAL INFORMATION:

Here's a stack trace from dbx.

# dbx (omitted several -I directives) ./smbpasswd
Type 'help' for help.
reading symbolic information ...warning: iconv.c is newer 
than /usr/local/lib/libiconv.a

[using memory image in core]

Segmentation fault in ptrgl.$PTRGL [/usr/lib/libc.a] at 0xd0170f90
0xd0170f90 ($PTRGL)    800b0000        lwz   r0,0x0(r11)
(dbx) where
ptrgl.$PTRGL() at 0xd0170f90
setlocale.setlocale(??, ??) at 0xd018fc5c
unnamed block $b223, line 63 in "charcnv.c"
charset_name(0x2), line 63 in "charcnv.c"
unnamed block $b234, line 120 in "charcnv.c"
init_iconv(), line 120 in "charcnv.c"
lazy_initialize_conv(), line 93 in "charcnv.c"
convert_string_allocate(0x0, 0x1, 0x0, 0x2004c0f8, 0x9, 0x2ff21c14), line 391 
in "charcnv.c"
push_ucs2_allocate(0x2ff21c14, 0x2004c0f8), line 833 in "charcnv.c"
unix_strupper(0x2004c0f8, 0x9, 0x2004c0f8, 0x9), line 519 in "charcnv.c"
strupper_m(0x2004c0f8), line 1335 in "util_str.c"
set_global_myname(0x2003c860), line 102 in "util.c"
init_globals(), line 1334 in "loadparm.c"
lp_load(0x2ff225c4, 0x1, 0x0, 0x0), line 3923 in "loadparm.c"
process_options(argc = 0, argv = 0x2ff22a94, local_flags = 576), line 204 
in "smbpasswd.c"
main(argc = 1, argv = 0x2ff22a90), line 581 in "smbpasswd.c"

Note that this appears to occur in function charset_name() in charcnv.c when it 
tries to set the locale. There's a fragment of code as follows:

#ifdef HAVE_SETLOCALE
                setlocale(LC_ALL, "");
#endif

If I comment out this code and recompile then the problem does not occur.
Comment 1 Gerald (Jerry) Carter (dead mail address) 2003-12-18 14:42:12 UTC
Jeremy, can you look at this?
Comment 2 Jeremy Allison 2003-12-18 15:32:42 UTC
This looks like a AIX libc bug.
The call :

setlocale(LC_ALL, "");

is a POSIX standard call telling libc to set the locale from
the environment variables.

An IBMer needs to have a look at this.

Jeremy.
Comment 3 Jeremy Allison 2003-12-18 15:33:56 UTC
Reassigning to Jim. He has access to AIX (I don't).
Jeremy.
Comment 4 Gerald (Jerry) Carter (dead mail address) 2004-03-16 12:00:25 UTC
could someone make a call on whether this is a 
Samba issue or not?  Seems like an another AIX issue to me.
Comment 5 Gerald (Jerry) Carter (dead mail address) 2004-03-22 08:13:07 UTC
This is probably fixed if it was our bug.
If not, then it points to an AIX issue.
Closing
Comment 6 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:18:43 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 7 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:29:04 UTC
database cleanup