Bug in libc 5.0.9 ??

Bug in libc 5.0.9 ??

Post by Jon Call » Tue, 28 Nov 1995 04:00:00



Wotcha,

I think the problem is that there is NO defined behaviour
when you use a % sign and some odd character...

from my man page:

       The  effect of padding the %p format with zeros (either by
       the 0 flag or by specifying a precision), and  the  benign
       effect  (i.e.,  none)  of  the # flag on %n and %p conver-
       sions, as well as other nonsensical combinations  such  as
       %Ld,   are  not  standard;  such  combinations  should  be
       avoided.

Jon
--
''''''''''''''''''''''''''''''''''''''''''''''''''
##################################################
``````````````````````````````````````````````````

 
 
 

Bug in libc 5.0.9 ??

Post by A. Roh » Tue, 28 Nov 1995 04:00:00


Hello...

I got some sourcecode with *weird* printf stuff like this:

fprintf(file, "%/blabla ....", ...);

The author wants to see

/blabla

in the output. Well, I don't know much about %-formats and in my opinion,
the usage of printf which is shown above is weird, but....

This code worked from very early versions of Linux 0.99.6 (+ gcc + libc)
until now. libc 5.0.9 (from Slackware 3.0) seems to break this behavior.

I get:

%/blabla

I use gcc 2.7.0 on Suns, too, so I think libc is responsible for the change.

Axel Rohde

 
 
 

Bug in libc 5.0.9 ??

Post by Chris Ada » Tue, 28 Nov 1995 04:00:00


-----BEGIN PGP SIGNED MESSAGE-----



>fprintf(file, "%/blabla ....", ...);

This is bad bad bad.  According to my copy of K&R2, "If the character
after the % is not a conversion character, the behavoir is undefined."
The behavoir is undefined means just that: the library can do whatever
it wants.  It could print "The programmer is stupid", seg-fault, hang,
etc., and it would still meet the standard.

Aparently the old way was to just swallow the % silently if the next
char was not a conversion char and the programmer was depending on this.
Printing the % is just as valid though.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQEVAwUBMLqgUiJFQNhhNdm5AQFPTgf9GPHjIBegPPUnwQb2ElwXnJTRVsQbpfS3
fGzy5TksrCcE4jeDkseLX/n6NR8xSQR6Pkp/NsLRrU3FbmzC62ow9cg0oxPYAIzd
6SYQX2681D+ddI89GJizUjEaEsDh81T02neTcGN3P8GqHIjWpmpD6HZRhuHdiDhf
dYAyeKAJkZIKEFIMPjmTOi3ND5RGM9zOhjwKyOFxEYEoHZRz4DQPeEDIPe2Jh7wU
0KxmXN44zF41x3tK4qqnkFKp8m+ftXofOM81P04tjN405vZgg6Bs3Q40LZinVnZt
7BrL2ERCrdskR9xw7A1GN3NzBUbScarNleJpWC0zta0QCWOygn+U5Q==
=s6dx
-----END PGP SIGNATURE-----
--

"So, if anybody wants to have hardware sent to them: don't call me, but
instead write your own unix operating system.  It has worked every time
for me." - Linus Torvalds, author of Linux (Unix-like) OS

 
 
 

1. Printf bug in libc-4.6.27 -- libc-4.7.5

Mmmm... On my system, I get a recurring sequence when more instances
of the "printf()" are added to the program:

2.5 = 2.5000000005215406
2.5 = 2.5000000000149012
2.5 = 2.5000000000223517
2.5 = 2.5000000000000000
2.5 = 2.5000000000002235
2.5 = 2.5000000000074506
2.5 = 2.5000000000000000
2.5 = 2.5000000000002235
2.5 = 2.5000000000074506
2.5 = 2.5000000000000000
2.5 = 2.5000000000002235
2.5 = 2.5000000000074506
2.5 = 2.5000000000000000
2.5 = 2.5000000000001490
2.5 = 2.5000000000052154
2.5 = 2.5000000000000000
2.5 = 2.5000000000001490
2.5 = 2.5000000000052154
2.5 = 2.5000000000000000
2.5 = 2.5000000000001490
2.5 = 2.5000000000052154
2.5 = 2.5000000000000000
2.5 = 2.5000000000001490
2.5 = 2.5000000000052154
2.5 = 2.5000000000000000
2.5 = 2.5000000000001490
2.5 = 2.5000000000052154
2.5 = 2.5000000000000000
2.5 = 2.5000000000001490
2.5 = 2.5000000000052154
2.5 = 2.5000000000000000
2.5 = 2.5000000000001490

--

For Linux IDE (big/many) help, see:  /usr/src/linux/drivers/block/README.ide
For latest Linux kernels: ftp.cs.helsinki.fi:/pub/Software/Linux/Kernel/v1.[23]

2. Monitoring Network ?'s

3. Bug in libc ? Or bug in nslookup ?

4. : X on TSENG W32P rev. d 2MB

5. libc.a and libc.so, libc.so.1libc.so.2, where is my library?

6. xircom realport in linux

7. libc 2.x, libc 5, libc 6

8. Formatting MAN Pages to Fit on One Printer Page

9. Who accepts bug reports for libc on linux?

10. BUG: 'tar +help' doesn't work with libc.so.4.4!!

11. Found+fixed bug libc 4.6.27 - please comment

12. READ!!! Your libc has a BUG

13. possible bug in libc