public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string
@ 2007-12-13 22:50 bugs at daylessday dot org
  2007-12-13 23:53 ` [Bug libc/5486] " drepper at redhat dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: bugs at daylessday dot org @ 2007-12-13 22:50 UTC (permalink / raw)
  To: glibc-bugs

man nl_langinfo says:
"If item is not valid, a pointer to an empty string is returned."
But nl_langinfo(0x11) returns invalid pointer.

See the code below:
---
#include <stdio.h>
#include <langinfo.h>
int main() {
        char *val;
        val = nl_langinfo(0x11);
        printf("%s\n", val);
        return 0;
}
---

GDB:
---
Breakpoint 1, main () at test.c:7
7               val = nl_langinfo(0x11);
(gdb) n
8               printf("%s\n", val);
(gdb) p val
$1 = 0x47 <Address 0x47 out of bounds>

valgrind:
---
==26754== Invalid read of size 1
==26754==    at 0x4C23D92: strlen (mc_replace_strmem.c:242)
==26754==    by 0x4E88E9A: puts (in /lib64/libc-2.6.1.so)
==26754==    by 0x40058A: main (in /tmp/nl_lang)
==26754==  Address 0x47 is not stack'd, malloc'd or (recently) free'd
==26754==
==26754== Process terminating with default action of signal 11 (SIGSEGV)
==26754==  Access not within mapped region at address 0x47
==26754==    at 0x4C23D92: strlen (mc_replace_strmem.c:242)
==26754==    by 0x4E88E9A: puts (in /lib64/libc-2.6.1.so)
==26754==    by 0x40058A: main (in /tmp/nl_lang)

The problem is reproducible with glibc 2.6.1 (openSUSE 10.3 x86_64) and 2.5 
(openSUSE 10.2 x86_64 and x86).

-- 
           Summary: nl_langinfo() returns invalid pointer instead of
                    expected empty string
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: bugs at daylessday dot org
                CC: glibc-bugs at sources dot redhat dot com
  GCC host triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
@ 2007-12-13 23:53 ` drepper at redhat dot com
  2007-12-14  7:17 ` bugs at daylessday dot org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: drepper at redhat dot com @ 2007-12-13 23:53 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2007-12-13 23:53 -------
0x11 is no invalid argument.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
  2007-12-13 23:53 ` [Bug libc/5486] " drepper at redhat dot com
@ 2007-12-14  7:17 ` bugs at daylessday dot org
  2007-12-14  8:04 ` jakub at redhat dot com
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugs at daylessday dot org @ 2007-12-14  7:17 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bugs at daylessday dot org  2007-12-14 07:17 -------
Ulrich, please elaborate.
Does this mean the function is expected to return invalid pointers when passed 
valid parameters? Why? 
How am I supposed to catch this kind of situation?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
  2007-12-13 23:53 ` [Bug libc/5486] " drepper at redhat dot com
  2007-12-14  7:17 ` bugs at daylessday dot org
@ 2007-12-14  8:04 ` jakub at redhat dot com
  2007-12-14 10:53 ` bugs at daylessday dot org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at redhat dot com @ 2007-12-14  8:04 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2007-12-14 08:04 -------
nl_langinfo doesn't return always char pointers.
For some values it returns unsigned int and for others uint32_t, it really
depends on the value.  Say for _NL_TIME_WEEK_1STDAY you want:
union { char *p; unsigned int val; } u;
u.p = nl_langinfo (_NL_TIME_WEEK_1STDAY);
value = u.val;


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (2 preceding siblings ...)
  2007-12-14  8:04 ` jakub at redhat dot com
@ 2007-12-14 10:53 ` bugs at daylessday dot org
  2007-12-14 22:09 ` bugs at daylessday dot org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugs at daylessday dot org @ 2007-12-14 10:53 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bugs at daylessday dot org  2007-12-14 10:53 -------
>nl_langinfo doesn't return always char pointers.

Well, this definitely not expected..
The documentation doesn't mention anywhere that this function may return 
anything except for strings.
---
RETURN VALUE
       If no locale has been selected for the appropriate category,
       nl_langinfo() returns a pointer to the corresponding string in the 
       "C" locale.
---

>From what I see, this behaviour exists only in glibc (both MacOS and AIX know 
nothing about _NL_TIME_WEEK_1STDAY and return day name when 17 is passed) and 
probably violates the X/Open standard, according to which the function should 
return char *, not union.

/usr/include/langinfo.h doesn't have any indication of possible return values.
Can I see the extended list of 'item' values somewhere (with the corresponding 
return values)?
Are there any more undocumented return values?

Thanks in advance.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (3 preceding siblings ...)
  2007-12-14 10:53 ` bugs at daylessday dot org
@ 2007-12-14 22:09 ` bugs at daylessday dot org
  2007-12-14 22:34 ` drepper at redhat dot com
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugs at daylessday dot org @ 2007-12-14 22:09 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bugs at daylessday dot org  2007-12-14 22:09 -------
Please advise.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (4 preceding siblings ...)
  2007-12-14 22:09 ` bugs at daylessday dot org
@ 2007-12-14 22:34 ` drepper at redhat dot com
  2007-12-14 22:52 ` derick at php dot net
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: drepper at redhat dot com @ 2007-12-14 22:34 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2007-12-14 22:33 -------
Stop reopening the bug, this is no programming instruction course here.  If your
program wouldn't be buggy you would not have problems.  You can only use the
values which are documented as legal parameters.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (5 preceding siblings ...)
  2007-12-14 22:34 ` drepper at redhat dot com
@ 2007-12-14 22:52 ` derick at php dot net
  2007-12-14 23:15 ` derick at php dot net
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: derick at php dot net @ 2007-12-14 22:52 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From derick at php dot net  2007-12-14 22:52 -------
(In reply to comment #6)
> Stop reopening the bug, this is no programming instruction course here.  If your
> program wouldn't be buggy you would not have problems.  You can only use the
> values which are documented as legal parameters.

hmm, I don't understand something here. You first say that value 0x11 is not an
invalid argument *and* that nl_langinfo() can also return something else than a
char*. But at the same time nl_langinfo is both documented, as well as declared
as a function returning a char*. So, how is this buggy behavior in the app - I'd
say it's a bug in nl_langinfo() if it returns something else than a char* -
especially because it's not documented that it should return any sort of other
value. So this is either a bug in nl_langinfo(), or one in the
/usr/include/langinfo.h AND the man page...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (6 preceding siblings ...)
  2007-12-14 22:52 ` derick at php dot net
@ 2007-12-14 23:15 ` derick at php dot net
  2007-12-15  9:51 ` drepper at redhat dot com
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: derick at php dot net @ 2007-12-14 23:15 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |derick at php dot net


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (7 preceding siblings ...)
  2007-12-14 23:15 ` derick at php dot net
@ 2007-12-15  9:51 ` drepper at redhat dot com
  2007-12-15 10:13 ` derick at php dot net
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: drepper at redhat dot com @ 2007-12-15  9:51 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2007-12-15 09:51 -------
Stop reopening the bug.  If you don't understand something this is of no concern
to anyone here.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (8 preceding siblings ...)
  2007-12-15  9:51 ` drepper at redhat dot com
@ 2007-12-15 10:13 ` derick at php dot net
  2007-12-15 11:32 ` roland at gnu dot org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: derick at php dot net @ 2007-12-15 10:13 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From derick at php dot net  2007-12-15 10:13 -------
Could you then please explain how this is not a bug? I mean, the function does
*not* confirm to either: documentation, header files, nor X/Open specifications.
I wonder if you're actually reading what is being said.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (9 preceding siblings ...)
  2007-12-15 10:13 ` derick at php dot net
@ 2007-12-15 11:32 ` roland at gnu dot org
  2007-12-15 14:39 ` derick at php dot net
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: roland at gnu dot org @ 2007-12-15 11:32 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From roland at gnu dot org  2007-12-15 11:32 -------
Calling nl_langinfo with an invalid nl_item argument invokes undefined behavior,
which is what you are getting.  All the standards make it undefined behavior to
call nl_langinfo in this way.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (10 preceding siblings ...)
  2007-12-15 11:32 ` roland at gnu dot org
@ 2007-12-15 14:39 ` derick at php dot net
  2007-12-15 15:02 ` bugs at daylessday dot org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: derick at php dot net @ 2007-12-15 14:39 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From derick at php dot net  2007-12-15 14:39 -------
Roland, I understand that with an invalid valid, it returns undefined behavior. 

But in comment #1 Ulrich states: 
0x11 is no invalid argument.

And what is even *stranger* is that in comment #3 Jakub writes:
nl_langinfo doesn't return always char pointers.
For some values it returns unsigned int and for others uint32_t, it really
depends on the value.
*This* fact I can not find anywhere in either the docs, the header file *or* the
X/Open specs. And because of that, there is no way to handle this in any
application.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (11 preceding siblings ...)
  2007-12-15 14:39 ` derick at php dot net
@ 2007-12-15 15:02 ` bugs at daylessday dot org
  2007-12-15 15:07 ` jakub at redhat dot com
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: bugs at daylessday dot org @ 2007-12-15 15:02 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bugs at daylessday dot org  2007-12-15 15:02 -------
1. "0x11 is no invalid argument."
Ok, so it's valid and non-empty string is expected.

2. "You can only use the values which are documented as legal parameters."
Ok, so the value is illegal, so an empty string is expected.

3. "Calling nl_langinfo with an invalid nl_item argument invokes undefined 
behavior"
No, the manual clearly says the behaviour IS defined: an empty string is 
returned.

---

So this argument is valid (1), illegal (2) and invalid (3) in the same time.
And function behaviour is both defined (man nl_langinfo) and undefined (comment 
#10).

Can you guys finally read the report and compare the actual behaviour of the 
function and the behaviour described in the manual?
If nl_langinfo() doesn't correspond to its own description, then I guess its 
name should be changed to something else.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (12 preceding siblings ...)
  2007-12-15 15:02 ` bugs at daylessday dot org
@ 2007-12-15 15:07 ` jakub at redhat dot com
  2007-12-15 15:14 ` derick at php dot net
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at redhat dot com @ 2007-12-15 15:07 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2007-12-15 15:07 -------
Get a clue.  POSIX specifies a bunch of values that must be supported and for
them all a string is returned (though it can be empty even if the argument is
valid POSIX arg - say if some locale doesn't define AM/PM strings).  Passing
any other value triggers undefined behavior wrt. POSIX.  Some values have a
meaning for glibc and then glibc returns some value (in some cases a string, in
other cases an unsigned int, in other cases pointer to uint32_t wide chars),
which is ok, because for POSIX this is undefined behavior.  Some values are
invalid and then "" is returned as POSIX says.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (13 preceding siblings ...)
  2007-12-15 15:07 ` jakub at redhat dot com
@ 2007-12-15 15:14 ` derick at php dot net
  2007-12-15 19:46 ` derick at php dot net
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: derick at php dot net @ 2007-12-15 15:14 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From derick at php dot net  2007-12-15 15:13 -------
I am trying to get this clue Jakub :)
We're getting somewhere, but I still can't find where those POSIX-undefined
actions, which trigger some other return type than a valid string pointer from
"char *nl_langinfo()", are documented and/or defined. And, don't you think it's
strange that a function which is documented, and declared, to return a char* can
actually return an unsigned int or an unit32_t ?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (14 preceding siblings ...)
  2007-12-15 15:14 ` derick at php dot net
@ 2007-12-15 19:46 ` derick at php dot net
  2007-12-18 20:40 ` bugzilla at somabo dot de
  2008-03-09  5:56 ` drepper at redhat dot com
  17 siblings, 0 replies; 19+ messages in thread
From: derick at php dot net @ 2007-12-15 19:46 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From derick at php dot net  2007-12-15 19:46 -------
Apparently questions are ignored when a bug is considered "invalid", even while
the issue is not resolved properly - so reopening.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (15 preceding siblings ...)
  2007-12-15 19:46 ` derick at php dot net
@ 2007-12-18 20:40 ` bugzilla at somabo dot de
  2008-03-09  5:56 ` drepper at redhat dot com
  17 siblings, 0 replies; 19+ messages in thread
From: bugzilla at somabo dot de @ 2007-12-18 20:40 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From bugzilla at somabo dot de  2007-12-18 20:40 -------
We are obviously speaking about a glibc specific addition here. So wtf is that
not  handled in a glibc specific function? The standard says clearly that an
invalid value results in an empty string. Also we apparently can only receive a
string here. Because where I live we code our prototypes correct. Now even if
all you guys said were true then we still have an issue here. Any however well
documented glibc specific value is still undefined in any other open/public
documentation. That said it still needs to return an empty string. If you do not
like it then you can do that by simply getting your undocumented union right.

union glibc_fun {
  const char  string[];
  struct more_fun {
    const char nul;
    union even_more_fun {
      int an_unexpected_int_value;
      double even_a_double_is_possible;

// and so on

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug libc/5486] nl_langinfo() returns invalid pointer instead of expected empty string
  2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
                   ` (16 preceding siblings ...)
  2007-12-18 20:40 ` bugzilla at somabo dot de
@ 2008-03-09  5:56 ` drepper at redhat dot com
  17 siblings, 0 replies; 19+ messages in thread
From: drepper at redhat dot com @ 2008-03-09  5:56 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2008-03-09 05:55 -------
When we return non-empty strings the input is not invalid.

Don't reopen the bug, there is nothing wrong.  Fix your code if you have problems.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=5486

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2008-03-09  5:56 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-13 22:50 [Bug libc/5486] New: nl_langinfo() returns invalid pointer instead of expected empty string bugs at daylessday dot org
2007-12-13 23:53 ` [Bug libc/5486] " drepper at redhat dot com
2007-12-14  7:17 ` bugs at daylessday dot org
2007-12-14  8:04 ` jakub at redhat dot com
2007-12-14 10:53 ` bugs at daylessday dot org
2007-12-14 22:09 ` bugs at daylessday dot org
2007-12-14 22:34 ` drepper at redhat dot com
2007-12-14 22:52 ` derick at php dot net
2007-12-14 23:15 ` derick at php dot net
2007-12-15  9:51 ` drepper at redhat dot com
2007-12-15 10:13 ` derick at php dot net
2007-12-15 11:32 ` roland at gnu dot org
2007-12-15 14:39 ` derick at php dot net
2007-12-15 15:02 ` bugs at daylessday dot org
2007-12-15 15:07 ` jakub at redhat dot com
2007-12-15 15:14 ` derick at php dot net
2007-12-15 19:46 ` derick at php dot net
2007-12-18 20:40 ` bugzilla at somabo dot de
2008-03-09  5:56 ` drepper at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).