Strange: MIPS, librt, malloc (Cross Post: originally sent to Buildroot -- oops).

Carmelo AMOROSO carmelo.amoroso at st.com
Wed Mar 2 09:11:50 UTC 2011


On 2/25/2011 11:56 PM, ANDY KENNEDY wrote:
> Given the following code:
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> int main(void)
> {
> void *mem;
> 
> mem = malloc(1);
> printf("Hello world\n");
> return 0;
> }
> 
> and the build command:
> 
> ../../../buildroot/output/host/usr/bin/mips-unknown-linux-uclibc-gcc -o
> test -g -Wall test.c
> 
> Everything works as you would expect. However, if I use the following
> build command:
> 
> ../../../buildroot/output/host/usr/bin/mips-unknown-linux-uclibc-gcc -o
> test -g -Wall test.c -lrt
> 
> 
> malloc never returns and I sit in the _pthread_cleanup_push_defer()
> while (1) loop.
> 
> 
> If I remove the malloc(), I get Hello World but never return.
> 
> 
> Where do I start tracking this problem down? Anyone else have this
> issue?
> 
> Thanks,
> Andy

Hi Andy,
please post the output of ldd in both case. Are you using NPTL ?
I'm currently looking at a similar issue... I'm suspecting on something
wrong in the forward.c.

I'll try to reproduce it on my side too.

Cheers,
Carmelo



> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
> 


More information about the uClibc mailing list