Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
Incorrect Behavior
Description
Here is the input program, the compile line and the output.
$ cat t.cpp && xlC -g t.cpp -o ./t && ./t #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> int main (int, char**) { FILE* pipe = popen ("locale -a", "r"); if (!pipe) return 1; char buf [128]; while (fgets (buf, sizeof (buf), pipe)) { const size_t len = strlen (buf); buf [len ? len - 1 : 0] = '\0'; setlocale (LC_CTYPE, buf); } pclose (pipe); if (!setlocale (LC_ALL, "EN_US")) return 2; const time_t t = time (0); const tm *ptm = localtime (&t); strftime (buf, sizeof buf, "%Y", ptm); return 0; } Segmentation fault (core dumped) $ dbx ./t Type 'help' for help. warning: The core file is not a fullcore. Some info may not be available. [using memory image in core] reading symbolic information ... Segmentation fault in __xisdigit at 0xd033cc08 0xd033cc08 (__xisdigit+0x1c) 80650134 lwz r3,0x134(r5) (dbx) where __xisdigit(0x28165874, 0x59) at 0xd033cc08 doformat(??, ??, ??, ??, ??, ??, ??, ??) at 0xd0338660 __strftime_std(??, ??, ??, ??, ??, ??, ??, ??) at 0xd0338464 strftime(??, ??, ??, ??) at 0xd0341c48 main( = 1, = 0x2ff22ac4), line 29 in "t.cpp" (dbx) quit
Attachments
Issue Links
- is depended upon by
-
STDCXX-847 [XLC++ 7,8,9] SEGV in 22.locale.time.get
- Open