[uClibc]Call to sysconf blocking

Erik Andersen andersen at codepoet.org
Tue Nov 20 19:35:06 UTC 2001


On Mon Nov 19, 2001 at 11:27:16AM +0000, Brian Stafford wrote:
> When the following simple program is compiled, it blocks indefinitely in 
> clock().  A gdb stack trace shows that it actually blocks in sysconf().
> 
> Any ideas?
> 
> #include <stdio.h>
> #include <time.h>
> 
> main ()
> {
>   clock_t length;
> 
>   length = clock ();
>   printf ("%ld\n", length);
> }

My gdb stackstrace looks like this....

    #0  0x40040cf6 in __sysconf (name=2) at sysconf_src.c:69
    #1  0x40040f8a in __sysconf (name=2) at sysconf_src.c:93
    #2  0x40040f8a in __sysconf (name=2) at sysconf_src.c:93
    #3  0x40040f8a in __sysconf (name=2) at sysconf_src.c:93
    #4  0x40040f8a in __sysconf (name=2) at sysconf_src.c:93
    #5  0x40040f8a in __sysconf (name=2) at sysconf_src.c:93
    #6  0x40040f8a in __sysconf (name=2) at sysconf_src.c:93
    #7  0x40040f8a in __sysconf (name=2) at sysconf_src.c:93

Seems sysconf recurses itself till the stack overflows and it
chokes to death.  Oops.

<fixing noises in the distance>

Ok, fixed now.  This was broken by the header file change.  The
new headers actually define CLK_TCK as __sysconf(_SC_CLK_TCK) 
causing us to recurse.  Oops.  Good spotting,

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--





More information about the uClibc mailing list