Topic: llcp-test-server and client end in hang condition

Hi,

first of all, thanks for libnfc and all the tools around it. Great work!!

I did some experiments with libnfc-llcp in order to get a basic understanding for
P2P transfers using LLCP. I tested with llcp-test-server and client and it caused
some kind of hang condition during tests and the inability to start the test code
again after killing the server and client codes. (btw: nfc-dep-target and inititator
examples from libnfc work fine).

Here my detailed problem description:
I am using two NFC readers (ARYGON, ADRB1US00) on one computer, the server code
was slightly modified in order  not to use the same reader as the client.

On the server side I started:
./llcp-test-server --mode=target

On the client side:
./llcp-test-client --mode=initiator --test 1

Both sides seem to transfer data as expected, but at some point the communication
stops. Especially the client seems to have finished communication, and hangs during
MAC Link deactivation.

The server and client program can't be killed by pressing Ctr+C, only the kill
command works. After killing client and server, a restart of the client oder server code does
no longer work (nfc-list still works). No output, it just hangs. Unplugging and plugging in the readers
does not change anything sad Resetting USB-Ports also does not work. I fact the
only thing that works for me is rebooting the machine.

I am using latest svn versions of libnfc and libnfc-llcp. I am testing on Ubuntu 11.10 x86_64.
Here are the outputs (Is there a possibility to submit the full as an attachment? The two logs
exceed the limits, so I can only post parts of it...)
Client:
[stderr] 20111204 11:03:45.546 TRACE    libnfc-llcp.llc.link- service 0x2080dd0 bound to SAP 1
[stderr] 20111204 11:03:45.547 INFO     libnfc-llcp.mac.link- (PN532 (/dev/ttyUSB1) - PN532 v1.4 (0x07)) Attempting to activate LLCP Link as initiator
[stderr] 20111204 11:03:45.567 DEBUG    libnfc-llcp.mac.link- (PN532 (/dev/ttyUSB1) - PN532 v1.4 (0x07)) nfc_initiator_init() succeeded
[stderr] 20111204 11:03:45.632 DEBUG    libnfc-llcp.mac.link- (PN532 (/dev/ttyUSB1) - PN532 v1.4 (0x07)) nfc_initiator_select_dep_target() succeeded
[stderr] 20111204 11:03:45.632 INFO     libnfc-llcp.mac.link- (PN532 (/dev/ttyUSB1) - PN532 v1.4 (0x07)) LLCP Link activated (initiator)
[stderr] 20111204 11:03:45.632 TRACE    libnfc-llcp.llc.link- llc_link_configure (0x2081b60, (nil), 0)
[stderr] 20111204 11:03:45.632 DEBUG    libnfc-llcp.llc.link- mq_open (/libnfc-llcp-2336-0x2081b60-up)
[stderr] 20111204 11:03:45.633 DEBUG    libnfc-llcp.llc.link- mq_open (/libnfc-llcp-2336-0x2081b60-down)
[stderr] 20111204 11:03:45.633 INFO     libnfc-llcp.llc.link- LLC Link started successfully
[stderr] 20111204 11:03:45.633 INFO     libnfc-llcp.llc.llc- (0x7f935972f700) Link activated
[stderr] 20111204 11:03:45.633 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) mq_receive+
[stderr] 20111204 11:03:45.633 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:45.655 TRACE    libnfc-llcp.mac.link- Received 2 bytes (Requested 8192, buffer size 2)
[stderr] 20111204 11:03:45.655 TRACE    libnfc-llcp.mac.link- Received 2 bytes
.
.
.
[stderr] 20111204 11:03:48.605 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) Received 2 bytes
[stderr] 20111204 11:03:48.605 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) Symmetry PDU
[stderr] 20111204 11:03:48.605 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) mq_send+
[stderr] 20111204 11:03:48.605 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) Nothing to send
[stderr] 20111204 11:03:48.605 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) mq_receive+
[stderr] 20111204 11:03:48.605 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:48.605 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.mac.link- Received 2 bytes (Requested 8192, buffer size 2)
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) Received 2 bytes
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) Symmetry PDU
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) mq_send+
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) Nothing to send
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.llc.llc- (0x7f935972f700) mq_receive+
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:48.628 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:48.633 INFO     libnfc-llcp.llc.link- Deactivating LLC Link
[stderr] 20111204 11:03:48.633 DEBUG    libnfc-llcp.llc.link- The LLC Link has an active MAC link
[stderr] 20111204 11:03:48.633 INFO     libnfc-llcp.mac.link- MAC Link deactivation requested (reason: 0)


Server:
[stderr] 20111204 11:03:42.544 TRACE    libnfc-llcp.llc.link- service 0x1722dd0 bound to SAP 1
[stderr] 20111204 11:03:42.545 TRACE    libnfc-llcp.llc.link- service 0x1722c80 bound to SAP 16
[stderr] 20111204 11:03:42.545 TRACE    libnfc-llcp.llc.link- service 0x1722e70 bound to SAP 17
[stderr] 20111204 11:03:42.545 INFO     libnfc-llcp.mac.link- (PN532 (/dev/ttyUSB0) - PN532 v1.4 (0x07)) Attempting to activate LLCP Link as target (blocking)
[stderr] 20111204 11:03:45.624 INFO     libnfc-llcp.mac.link- (PN532 (/dev/ttyUSB0) - PN532 v1.4 (0x07)) LLCP Link activated (target)
[stderr] 20111204 11:03:45.624 TRACE    libnfc-llcp.llc.link- llc_link_configure (0x1723b60, 0x7fff391354c4, 0)
[stderr] 20111204 11:03:45.624 DEBUG    libnfc-llcp.llc.link- mq_open (/libnfc-llcp-2322-0x1723b60-up)
[stderr] 20111204 11:03:45.625 DEBUG    libnfc-llcp.llc.link- mq_open (/libnfc-llcp-2322-0x1723b60-down)
[stderr] 20111204 11:03:45.625 INFO     libnfc-llcp.llc.link- LLC Link started successfully
[stderr] 20111204 11:03:45.625 INFO     libnfc-llcp.llc.llc- (0x7ff385455700) Link activated
[stderr] 20111204 11:03:45.625 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_receive+
[stderr] 20111204 11:03:45.625 TRACE    libnfc-llcp.mac.link- Waiting for MAC Link PDU exchange thread to exit
[stderr] 20111204 11:03:45.644 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:45.644 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:45.645 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Received 2 bytes
[stderr] 20111204 11:03:45.645 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:45.645 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:45.645 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Symmetry PDU
[stderr] 20111204 11:03:45.645 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_send+
[stderr] 20111204 11:03:45.645 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Nothing to send
[stderr] 20111204 11:03:45.645 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_receive+
[stderr] 20111204 11:03:45.667 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:45.667 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:45.667 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Received 2 bytes
[stderr] 20111204 11:03:45.668 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Symmetry PDU
[stderr] 20111204 11:03:45.668 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_send+
[stderr] 20111204 11:03:45.668 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Nothing to send
[stderr] 20111204 11:03:45.668 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_receive+
.
.
.
[stderr] 20111204 11:03:48.594 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Received 2 bytes
[stderr] 20111204 11:03:48.594 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Symmetry PDU
[stderr] 20111204 11:03:48.594 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_send+
[stderr] 20111204 11:03:48.594 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Nothing to send
[stderr] 20111204 11:03:48.594 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_receive+
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Received 2 bytes
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Symmetry PDU
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_send+
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Nothing to send
[stderr] 20111204 11:03:48.617 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_receive+
[stderr] 20111204 11:03:48.640 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:48.640 TRACE    libnfc-llcp.mac.link- Received 2 bytes
[stderr] 20111204 11:03:48.640 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:48.641 TRACE    libnfc-llcp.mac.link- Sending 2 bytes
[stderr] 20111204 11:03:48.641 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Received 2 bytes
[stderr] 20111204 11:03:48.641 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Symmetry PDU
[stderr] 20111204 11:03:48.641 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_send+
[stderr] 20111204 11:03:48.641 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) Nothing to send
[stderr] 20111204 11:03:48.641 TRACE    libnfc-llcp.llc.llc- (0x7ff385455700) mq_receive+

Trying to restart one of the codes (client or server) produces no output. Maybe an strace
of the call is of interest:

execve("./llcp-test-client", ["./llcp-test-client", "--mode=initiator", "--test", "1"], [/* 43 vars */]) = 0
brk(0)                                  = 0x2638000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe4a9c40000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=139442, ...}) = 0
mmap(NULL, 139442, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fe4a9c1d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libncurses.so.5", O_RDONLY)  = 3
.
.
.
execve("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/tools/llcp-test-client/.libs/lt-llcp-test-client", ["/home/klug/install/nfc/nfc-tools"..., "--mode=initiator", "--test", "1"], [/* 43 vars */]) = 0
brk(0)                                  = 0x2343000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2607490000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/tls/x86_64/libnfc.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/tls/x86_64", 0x7fff52927250) = -1 ENOENT (No such file or directory)
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/tls/libnfc.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/tls", 0x7fff52927250) = -1 ENOENT (No such file or directory)
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/x86_64/libnfc.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/x86_64", 0x7fff52927250) = -1 ENOENT (No such file or directory)
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/libnfc.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=139442, ...}) = 0
mmap(NULL, 139442, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f260746d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libnfc.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320Y\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=170348, ...}) = 0
mmap(NULL, 2188832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f260705b000
mprotect(0x7f2607070000, 2093056, PROT_NONE) = 0
mmap(0x7f260726f000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f260726f000
close(3)                                = 0
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/libnfc-llcp.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 5\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0775, st_size=157881, ...}) = 0
mmap(NULL, 2151424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f2606e4d000
mprotect(0x7f2606e5a000, 2093056, PROT_NONE) = 0
mmap(0x7f2607059000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f2607059000
close(3)                                = 0
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \24\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1677624, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f260746c000
mmap(NULL, 3793768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f2606aae000
mprotect(0x7f2606c43000, 2093056, PROT_NONE) = 0
mmap(0x7f2606e42000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x194000) = 0x7f2606e42000
mmap(0x7f2606e47000, 21352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f2606e47000
close(3)                                = 0
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/liblog4c.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/liblog4c.so.3", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220O\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=69144, ...}) = 0
mmap(NULL, 2166352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f260689d000
mprotect(0x7f26068ad000, 2093056, PROT_NONE) = 0
mmap(0x7f2606aac000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f2606aac000
close(3)                                = 0
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/librt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200!\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=31752, ...}) = 0
mmap(NULL, 2129016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f2606695000
mprotect(0x7f260669c000, 2093056, PROT_NONE) = 0
mmap(0x7f260689b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f260689b000
close(3)                                = 0
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/libexpat.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libexpat.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3009\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=169992, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f260746b000
mmap(NULL, 2265168, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f260646b000
mprotect(0x7f2606492000, 2097152, PROT_NONE) = 0
mmap(0x7f2606692000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27000) = 0x7f2606692000
close(3)                                = 0
open("/home/klug/install/nfc/nfc-tools-read-only/libnfc-llcp/libnfc-llcp/.libs/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0Pl\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=135500, ...}) = 0
mmap(NULL, 2212920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f260624e000
mprotect(0x7f2606266000, 2093056, PROT_NONE) = 0
mmap(0x7f2606465000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f2606465000
mmap(0x7f2606467000, 13368, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f2606467000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f260746a000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2607468000
arch_prctl(ARCH_SET_FS, 0x7f2607468720) = 0
mprotect(0x7f2606465000, 4096, PROT_READ) = 0
mprotect(0x7f2606692000, 8192, PROT_READ) = 0
mprotect(0x7f260689b000, 4096, PROT_READ) = 0
mprotect(0x7f2606aac000, 4096, PROT_READ) = 0
mprotect(0x7f2606e42000, 16384, PROT_READ) = 0
mprotect(0x7f2607059000, 4096, PROT_READ) = 0
mprotect(0x7f260726f000, 8192, PROT_READ) = 0
mprotect(0x602000, 4096, PROT_READ)     = 0
mprotect(0x7f2607492000, 4096, PROT_READ) = 0
munmap(0x7f260746d000, 139442)          = 0
set_tid_address(0x7f26074689f0)         = 4354
set_robust_list(0x7f2607468a00, 0x18)   = 0
futex(0x7fff52927b2c, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fff52927b2c, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f2607468720) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x7f26062546c0, [], SA_RESTORER|SA_SIGINFO, 0x7f260625e060}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f2606254750, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f260625e060}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
rt_sigaction(SIGUSR1, {0x7f2606e505f0, [], SA_RESTORER, 0x7f2606ae4420}, NULL, 8) = 0
statfs("/dev/shm", {f_type=0x1021994, f_bsize=4096, f_blocks=502909, f_bfree=502840, f_bavail=502840, f_files=502909, f_ffree=502898, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
futex(0x7f260646a328, FUTEX_WAKE_PRIVATE, 2147483647) = 0
open("/dev/shm/sem.libnfc-llcp", O_RDWR|O_NOFOLLOW) = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=32, ...}) = 0
brk(0)                                  = 0x2343000
brk(0x2364000)                          = 0x2364000
mmap(NULL, 32, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x7f260748f000
close(3)                                = 0
access("/etc/log4crc", R_OK)            = -1 ENOENT (No such file or directory)
access("/home/klug/.log4crc", R_OK)     = -1 ENOENT (No such file or directory)
access("./log4crc", R_OK)               = 0
stat("./log4crc", {st_mode=S_IFREG|0664, st_size=785, ...}) = 0
open("./log4crc", O_RDONLY)             = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=785, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f260748e000
read(3, "<?xml version=\"1.0\" encoding=\"IS"..., 8192) = 785
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f260748e000, 4096)            = 0
rt_sigaction(SIGINT, {0x401730, [INT], SA_RESTORER|SA_RESTART, 0x7f2606ae4420}, {SIG_DFL, [], 0}, 8) = 0
open("/dev", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fcntl(3, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
getdents(3, /* 224 entries */, 32768)   = 6624
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
open("/dev/ttyUSB0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B0 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B0 -opost -isig -icanon -echo ...}) = 0
ioctl(3, TCFLSH, 0)                     = 0
ioctl(3, FIONREAD, [0])                 = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B0 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
pipe([4, 5])                            = 0
ioctl(3, TCFLSH, 0)                     = 0
ioctl(3, FIONREAD, [0])                 = 0
write(3, "UU\0\0\0", 5)                 = 5
ioctl(3, TCFLSH, 0)                     = 0
ioctl(3, FIONREAD, [0])                 = 0
write(3, "\0\0\377\3\375\324\24\1\27\0", 10) = 10
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 997985})
ioctl(3, FIONREAD, [6])                 = 0
read(3, "\0\0\377\0\377\0", 6)          = 6
select(6, [3 5], NULL, NULL, {1, 0})    = 1 (in [3], left {0, 998374})
ioctl(3, FIONREAD, [9])                 = 0
read(3, "\0\0\377\2\376", 5)            = 5
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [4])                 = 0
read(3, "\325\25", 2)                   = 2
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [2])                 = 0
read(3, "\26\0", 2)                     = 2
write(3, "\0\0\377\t\367\324\0\0libnfc\276\0", 16) = 16
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 996645})
ioctl(3, FIONREAD, [6])                 = 0
read(3, "\0\0\377\0\377\0", 6)          = 6
select(6, [3 5], NULL, NULL, {1, 0})    = 1 (in [3], left {0, 998592})
ioctl(3, FIONREAD, [16])                = 0
read(3, "\0\0\377\t\367", 5)            = 5
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [11])                = 0
read(3, "\325\1", 2)                    = 2
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [9])                 = 0
read(3, "\0libnfc", 7)                  = 7
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [2])                 = 0
read(3, "\274\0", 2)                    = 2
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
close(3)                                = 0
access("/etc/log4crc", R_OK)            = -1 ENOENT (No such file or directory)
access("/home/klug/.log4crc", R_OK)     = -1 ENOENT (No such file or directory)
access("./log4crc", R_OK)               = 0
stat("./log4crc", {st_mode=S_IFREG|0664, st_size=785, ...}) = 0
open("./log4crc", O_RDONLY)             = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=785, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f260748e000
read(3, "<?xml version=\"1.0\" encoding=\"IS"..., 8192) = 785
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f260748e000, 4096)            = 0
open("/dev/ttyUSB0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B0 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B0 -opost -isig -icanon -echo ...}) = 0
ioctl(3, TCFLSH, 0)                     = 0
ioctl(3, FIONREAD, [0])                 = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B0 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
pipe([6, 7])                            = 0
ioctl(3, TCFLSH, 0)                     = 0
ioctl(3, FIONREAD, [0])                 = 0
write(3, "UU\0\0\0", 5)                 = 5
ioctl(3, TCFLSH, 0)                     = 0
ioctl(3, FIONREAD, [0])                 = 0
write(3, "\0\0\377\3\375\324\24\1\27\0", 10) = 10
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 997612})
ioctl(3, FIONREAD, [6])                 = 0
read(3, "\0\0\377\0\377\0", 6)          = 6
select(8, [3 7], NULL, NULL, {1, 0})    = 1 (in [3], left {0, 998636})
ioctl(3, FIONREAD, [9])                 = 0
read(3, "\0\0\377\2\376", 5)            = 5
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [4])                 = 0
read(3, "\325\25", 2)                   = 2
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [2])                 = 0
read(3, "\26\0", 2)                     = 2
write(3, "\0\0\377\t\367\324\0\0libnfc\276\0", 16) = 16
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 997028})
ioctl(3, FIONREAD, [6])                 = 0
read(3, "\0\0\377\0\377\0", 6)          = 6
select(8, [3 7], NULL, NULL, {1, 0})    = 1 (in [3], left {0, 998392})
ioctl(3, FIONREAD, [16])                = 0
read(3, "\0\0\377\t\367", 5)            = 5
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [11])                = 0
read(3, "\325\1", 2)                    = 2
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [9])                 = 0
read(3, "\0libnfc", 7)                  = 7
select(4, [3], NULL, NULL, {1, 0})      = 1 (in [3], left {0, 999995})
ioctl(3, FIONREAD, [2])                 = 0
read(3, "\274\0", 2)                    = 2
ioctl(3, TCFLSH, 0)                     = 0
ioctl(3, FIONREAD, [0])                 = 0
write(3, "\0\0\377\2\376\324\2*\0", 9)  = 9
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
ioctl(3, FIONREAD, [6])                 = 0
read(3, "\0\0\377\0\377\0", 6)          = 6
select(8, [3 7], NULL, NULL, NULL)      = 1 (in [3])
ioctl(3, FIONREAD, [13])                = 0
read(3, "\0\0\377\6\372", 5)            = 5
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
ioctl(3, FIONREAD, [8])                 = 0
read(3, "\325\3", 2)                    = 2
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
ioctl(3, FIONREAD, [6])                 = 0
read(3, "2\1\4\7", 4)                   = 4
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
ioctl(3, FIONREAD, [2])                 = 0
read(3, "\352\0", 2)                    = 2
ioctl(3, TCFLSH, 0)                     = 0
ioctl(3, FIONREAD, [0])                 = 0
write(3, "\0\0\377\3\375\324\22\24\6\0", 10) = 10
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
ioctl(3, FIONREAD, [6])                 = 0
read(3, "\0\0\377\0\377\0", 6)          = 6
select(8, [3 7], NULL, NULL, NULL)      = 1 (in [3])
ioctl(3, FIONREAD, [9])                 = 0
read(3, "\0\0\377\2\376", 5)            = 5
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
ioctl(3, FIONREAD, [4])                 = 0
read(3, "\325\23", 2)                   = 2
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
ioctl(3, FIONREAD, [2])                 = 0
read(3, "\30\0", 2)                     = 2
futex(0x7f260748f000, FUTEX_WAIT, 0, NULL <unfinished ...>

I would be happy to get a hint what is going wrong.

Thanks in advance!

Cheers,

        Tobi