From: Dmitry V. L. <ld...@al...> - 2011-03-05 14:28:03
|
On Fri, Feb 18, 2011 at 04:20:24PM +0000, Grant Edwards wrote: > On 2011-02-18, Dmitry V. Levin <ld...@al...> wrote: > > On Thu, Feb 17, 2011 at 11:29:27AM -0600, Grant Edwards wrote: [...] > >> * Change the way that file descriptors are printed by the display > >> functions. Instead of using "%s" and a function that returns a > >> formatted string, they now use a printfd() function analogous to > >> the printpath() function. > > > > BTW, there is a long standing bug in decoding of file descriptors on > > 64bit architectures, and it's time to fix it in one place. > > > > For example, > > $ cat close.c > > int close(unsigned long fd); > > int main(void){return !!close(0xffffffff00000000UL);} > > $ gcc -Wall -O2 close.c -o close > > $ strace -eclose -o'|tail -1' ./close > > close(-4294967296) = 0 > > $ strace -y -eclose -o'|tail -1' ./close > > close(-4294967296</dev/pts/1>) = 0 > > > > The fix is to change "fd" type in printfd() from long to int, and to print > > it using %d format. > > Done. Thanks, I've merged this fix to HEAD. -- ldv |