On Thursday 11 December 2008 15:00, Tino Keitel wrote:
> Here is the test program:
> 
> #include <unistd.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <stdio.h>
> 
> int main() {
>         mknod("foobar", S_IFCHR|0666, makedev(10,63));
>         return 0;
> }
> 
> $ strace ./test_static
> execve("./test_static", ["./test_static"], [/* 18 vars */]) = 0
> mknod("foobar", S_IFCHR|0666, makedev(10, 63)) = 0
> _exit(0)
> 
> So this works as it should. I added a puts("foobar"); after the
> mknod(), and this broke:
> 
> $ strace ./test_static_stdio_puts 
> execve("./test_static_stdio_puts", ["./test_static_stdio_puts"], [/* 18
> vars */]) = 0
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo
> ...}) = 0
> ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo
> ...}) = 0
> mknod("foobar", S_IFCHR|01001000666, makedev(4294965514, 4294967103)) =
> 0
> write(1, "foobar\n"..., 7foobar
> )              = 7

You have buggy strace. Not only it prints "..." even after non-truncated
strings, it does it without allocating enough memory for it,
corrupting memory. Upgrade it to fixed version.

> Here is the assembly of the broken version:
> 
>         .file   "test.c"
>         .section        .rodata
> .LC0:
>         .string "foobar"
>         .text
> .globl main
>         .type   main, @function
> main:
>         leal    4(%esp), %ecx
>         andl    $-16, %esp
>         pushl   -4(%ecx)
...

Please also send assembly of non-broken version
(one without puts), and also your uclibc .config.

--
vda
_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to