Hi,

Looking a bit more at the first problem I mentioned, I can see that  
__socketcall is not defined in uclibc, it is just declared and uclibc  
just uses it to call into the kernel the socket syscall. However, I  
don't understand why, for instance, "ioctl" can be successfully  
executed by the ExternalDispatcher, while __socketcall cannot.

The ExternalDispatcher calls runProtectedCall(Function *f, uint64_t  
*args) but since f is NULL it cannot execute the call.

One way to get around this is to just use the symbolic environment and  
try to make a stub for network connections there, but I would like to  
understand why I cannot execute the socket syscall directly.

Thanks for your help.

Cristi

On Feb 8, 2009, at 2:38 AM, Cristian Zamfir wrote:

>
> Hi,
>
> I have two linking problems.
>
> The first one is when compiling a program that uses sockets. In my  
> case, it should be OK if the socket calls/syscalls are executed as  
> external functions, however, I get this error message:
>
> KLEE: WARNING: undefined reference to function: __socketcall
> .
> .
> .
> KLEE: WARNING: calling external: __socketcall
> KLEE: ERROR: failed external call: __socketcall
>
> I can see that in the file system model you are ignoring  
> __socketcall (and basically return an error (klee_warning("ignoring  
> (EAFNOSUPPORT)")) but in this particular case I am not using the  
> model and this is not called.
>
> Looking at uclibc, I can see in libc/sysdeps/linux/common/ 
> __socketcall.c that the function is defined and thus KLEE should see  
> it since it automatically links against microlibc.
>
> Is there any way to see why the external call failed?
>
> Could it be that uclibc is not compiled with socket support in the  
> first place (I am using the default configure file for uclibc which  
> looks like does not disable the networking support)?
>
> The second problem is when I compile a library called NL using klee- 
> gcc and separately a program (also with klee-gcc) that links against  
> this library.
>
> I do something like make CC=klee-gcc AR="llvm-ar cru" RANLIB="llvm- 
> ranlib" to make the library and everything goes ok, no errors.
>
> Then I simply do "make CC=klee-gcc" for the program that links  
> against the NL library which in the end runs
> llvm-ld --disable-opt -lNL -L../src program.o -o program
> Again no errors.
>
> However, when running with klee, I get the warning
> "KLEE: WARNING: undefined reference to function"
> for all library functions and the same "failed external call" error  
> for the first invocation of a function from the library.
>
> I noticed that llvm-ld does not complain if I just run llvm-ld -- 
> disable-opt program.o -o program without linking at all.
>
> My question is if you have any idea what I am doing wrong.
> Also, is there a llvm-ldd which I can use to see how llvm-ld links?
>
> Thanks a lot for your help.
>
> Cheers,
> Cristi
>
>
>
>
>

Reply via email to