[riot-notifications] [RIOT-OS/RIOT] examples/nanocoap_server hangs after > 256 bytes packet (#10972)

Juan I Carrano notifications at github.com
Fri Feb 8 12:29:02 CET 2019


### Description

Sending a UDP packet bigger than 256 bytes to the "examples/nanocoap_server" application causes it to stop responding to requests.

I tested this in native only.

### Steps to reproduce the issue

#### Start the application:

```
$ ./dist/tools/tapsetup/tapsetup
$ cd examples/nanocoap_server
$ make
$ make term
/home/jcarrano/source/masterRIOT/examples/nanocoap_server/bin/native/nanocoap_server.elf tap0 
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2019.04-devel-143-gf9ae375-up-master)
RIOT nanocoap example application
Waiting for address autoconfiguration...
Configured network interfaces:
Iface  5  HWaddr: 0A:0C:BF:83:6E:EC 
          L2-PDU:1500 MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::80c:bfff:fe83:6eec  scope: local  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff83:6eec

```

### Verify the server is up

```
$ aiocoap-client 'coap://[fe80::80c:bfff:fe83:6eec%tapbr0]/riot/ver'
This is RIOT (Version: 2019.04-devel-143-gf9ae375-up-master) running on a native board with a native MCU.
(No newline at end of message)
```

### Send 256 zeros, no problem

```
$ dd if=/dev/zero bs=1 count=256 | netcat -6u -w0 fe80::80c:bfff:fe83:6eec%tapbr0 5683
$ aiocoap-client 'coap://[fe80::80c:bfff:fe83:6eec%tapbr0]/riot/ver'
This is RIOT (Version: 2019.04-devel-143-gf9ae375-up-master) running on a native board with a native MCU.
(No newline at end of message)
```

### Send 257 zeros, it breaks

```
$ dd if=/dev/zero bs=1 count=257 | netcat -6u -w0 fe80::80c:bfff:fe83:6eec%tapbr0 5683
$ aiocoap-client 'coap://[fe80::80c:bfff:fe83:6eec%tapbr0]/riot/ver'
Traceback (most recent call last):
  File "/home/jcarrano/.local/bin/aiocoap-client", line 11, in <module>
    sys.exit(sync_main())
  File "/home/jcarrano/.local/lib/python3.7/site-packages/aiocoap/cli/client.py", line 223, in sync_main
    asyncio.get_event_loop().run_until_complete(single_request(args))
  File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/home/jcarrano/.local/lib/python3.7/site-packages/aiocoap/cli/client.py", line 149, in single_request
    response_data = yield from requester.response
aiocoap.error.RequestTimedOut
```

### Expected results

The 247-zeros packets should get ignored and the server should still be responsive.

### Actual results

The server does not crash, but stops responding to coap requests.

### Versions

<details><summary>./dist/tools/ci/print_toolchain_versions.sh</summary>
<p>


```
Operating System Environment
-----------------------------
       Operating System: "Arch Linux" 
                 Kernel: Linux 4.20.6-arch1-1-ARCH x86_64 unknown

Installed compiler toolchains
-----------------------------
             native gcc: gcc (GCC) 8.2.1 20181127
      arm-none-eabi-gcc: arm-none-eabi-gcc (Arch Repository) 8.2.0
                avr-gcc: missing
       mips-mti-elf-gcc: missing
             msp430-gcc: missing
   riscv-none-embed-gcc: missing
   xtensa-esp32-elf-gcc: missing
   xtensa-lx106-elf-gcc: missing
                  clang: clang version 7.0.1 (tags/RELEASE_701/final)

Installed compiler libs
-----------------------
   arm-none-eabi-newlib: "3.0.0"
    mips-mti-elf-newlib: missing
riscv-none-embed-newlib: missing
xtensa-esp32-elf-newlib: missing
xtensa-lx106-elf-newlib: missing
               avr-libc: missing (missing)

Installed development tools
---------------------------
                  cmake: cmake version 3.13.4
               cppcheck: Cppcheck 1.86
                doxygen: 1.8.15
                 flake8: 3.7.4 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.0) CPython 3.7.2 on Linux
                    git: git version 2.20.1
                   make: GNU Make 4.2.1
                openocd: Open On-Chip Debugger 0.10.0
                 python: Python 3.7.2
                python2: Python 2.7.15
                python3: Python 3.7.2
             coccinelle: missing
```

</p>
</detail>


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/10972
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190208/fcd8c72d/attachment.html>


More information about the notifications mailing list