[ 0:00] compiling /home/xrockai/src/divine/nightly/test/posix/sock/recvfrom.c [ 0:00] compiling /dios/lib/config/seqklee.bc [ 0:00] setting up pass: functionmeta, options = [ 0:01] setting up pass: fuse-ctors, options = [ 0:01] KLEE: output directory is "/var/obj/divine-nightly/semidbg/test/__test_work_dir.15/_klee_out" [ 0:04] KLEE: Using Z3 solver backend [ 0:04] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:04] warning: Linking two modules of different target triples: klee_div_zero_check.bc' is 'x86_64-unknown-linux-gnu' whereas 'klee.bc' is 'x86_64-unknown-none-elf' [ 0:04] [ 0:04] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:06] KLEE: WARNING: undefined reference to function: klee_free [ 0:06] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:06] about to __boot:0 [ 0:06] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:06] about to run the scheduler:0 [ 0:06] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:06] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:06] KLEE: NOTE: now ignoring this error at this location [ 0:06] KLEE: ERROR: EXITING ON ERROR: [ 0:06] Error: failed external call: __dios_tainted_init [ 0:06] File: /dios/libc/sys/start.cpp [ 0:06] Line: 87 [ 0:06] assembly.ll line: 35969 [ 0:06] Stack: [ 0:06] #000035969 in __dios_start (l=0, argc=1, argv=94775120920584, envp=94775120939016) at /dios/libc/sys/start.cpp:87 [ 0:06] #100010244 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:06] #200043552 in klee_boot (argc=1, argv=94775107766336) at /dios/arch/klee/boot.c:41 [ 0:06] [ 0:06] [ 0:06] 1 /* TAGS: c */ [ 0:06] 2 #include [ 0:06] 3 #include [ 0:06] 4 #include [ 0:06] 5 #include [ 0:06] 6 #include [ 0:06] 7 #include [ 0:06] 8 #include [ 0:06] 9 #include [ 0:06] 10 #include [ 0:06] 11 [ 0:06] 12 int main() [ 0:06] 13 { [ 0:06] 14 int server = socket( AF_UNIX, SOCK_STREAM, 0 ); [ 0:06] 15 assert( server >= 0 ); [ 0:06] 16 [ 0:06] 17 int client = socket( AF_UNIX, SOCK_STREAM, 0 ); [ 0:06] 18 assert( client >= 0 ); [ 0:06] 19 [ 0:06] 20 struct sockaddr_un server_addr, client_addr, peer_addr; [ 0:06] 21 socklen_t len = sizeof( server_addr ); [ 0:06] 22 server_addr.sun_family = AF_UNIX; [ 0:06] 23 strcpy( server_addr.sun_path, "server" ); [ 0:06] 24 [ 0:06] 25 assert( bind( server, (struct sockaddr *) &server_addr, len ) == 0 ); [ 0:06] 26 assert( listen( server, 5 ) == 0 ); [ 0:06] 27 assert( connect( client, (struct sockaddr *) &server_addr, len ) == 0 ); [ 0:06] 28 int server_fd = accept( server, (struct sockaddr *) &client_addr, &len ); [ 0:06] 29 assert( server_fd > 0 ); [ 0:06] 30 [ 0:06] 31 char buf[8]; [ 0:06] 32 assert( send( server_fd, "asdf", 5, 0 ) == 5 ); [ 0:06] 33 assert( recvfrom( client, buf, 5, 0, (struct sockaddr *) &peer_addr, &len ) == 5 ); [ 0:06] 34 [ 0:06] 35 /* Not all systems appear to support getpeername on AF_UNIX sockets (the [ 0:06] 36 * address comes out empty on Linux, but gives the expected 'server' on [ 0:06] 37 * OpenBSD). */ [ 0:06] 38 assert( !strcmp( peer_addr.sun_path, "server" ) ); [ 0:06] 39 [ 0:06] 40 /* NB. The below is the kind of behaviour Linux implements. It is not clear [ 0:06] 41 * from POSIX whether that is the intended behaviour -- getting sizeof( [ 0:06] 42 * struct sockaddr_un ) back would also appear to be legit and is what [ 0:06] 43 * OpenBSD does. */ [ 0:06] 44 assert( len == sizeof( struct sockaddr ) + strlen( peer_addr.sun_path ) + 1 ); [ 0:06] 45 [ 0:06] 46 return 0; [ 0:06] 47 } [ 0:06] # no errors were expected but one was found anyway