zephyr/samples
Robert Lubos 46e93f67a6 samples: net: sockets: echo_server: Fix userspace crash
k_work_* API cannot not be used from the user threads as the APIs are
not syscalls. Doing so leads to a crash when userspace is enabled.

As the current use of delayed work API from user threads is merely
scheduling of the initial work execution, it can be moved into the main
thread context. The time difference from the former and current approach
should be marginal, as the start_tcp/udp_proto() calls are not blocking
calls.

Another issue was usage of k_mem_domain_add_thread() on uninitialized
TCP threads. This lead to another crash, as assigning thread to a memory
domain also involves removing it from the previous domain, which lead to
NULL pointer dereference if thread was not initialized yet. As, by
default, newly spawned threads inherit memory domain assignment from
their parent, it's not really needed to assign the same domain
explicitly, hence, it can be safely removed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-03-03 10:48:21 +01:00
..
application_development treewide: update usage of zephyr_code_relocate 2023-01-17 18:08:37 +01:00
arch boards: xtensa: m5stickc_plus: initial support 2023-01-09 10:16:27 +01:00
basic samples: basic: hash_map increasing the stack size for cxx_unordered_map 2023-03-02 07:05:09 -05:00
bluetooth Samples: Bluetooth: Unicast Audio Client support no sink/source ASE 2023-03-03 10:47:51 +01:00
boards samples and tests: Add REQUIRED to Zephyr find_package call 2023-03-02 09:58:27 +01:00
compression samples: compression: lz4 requires more than 64kB of RAM 2022-11-02 16:06:06 -05:00
cpp subsys/cpp: Also run C++ tests with picolibc when possible 2023-01-20 09:03:25 +01:00
drivers dts: gpio: Add Microchip XEC GPIO macros for use in device tree 2023-03-02 13:52:03 +01:00
hello_world yamllint: indentation: fix files in samples/ 2023-01-04 14:23:53 +01:00
kernel yamllint: indentation: fix files in samples/ 2023-01-04 14:23:53 +01:00
modules samples and tests: Add REQUIRED to Zephyr find_package call 2023-03-02 09:58:27 +01:00
net samples: net: sockets: echo_server: Fix userspace crash 2023-03-03 10:48:21 +01:00
philosophers Revert "Samples: Philosophers: Revert stack size change" 2023-02-22 08:15:56 -05:00
posix samples: posix: gettimeofday: include time.h 2023-01-11 09:41:29 +01:00
sensor samples and tests: Add REQUIRED to Zephyr find_package call 2023-03-02 09:58:27 +01:00
shields samples: shields: npm6001_ek: remove dead assignment 2022-12-27 13:12:55 +01:00
subsys rtio: Shareable lock-free iodevs 2023-03-03 09:18:09 +01:00
synchronization samples: synchronization: Convert CONFIG_MP_NUM_CPUS handling 2022-10-27 13:59:57 -04:00
tfm_integration samples: tfm: Disable initial attestation test 2023-02-11 07:59:06 +09:00
userspace yamllint: indentation: fix files in samples/ 2023-01-04 14:23:53 +01:00
classic.rst
index.rst samples: cpp: Relocate samples/subsys/cpp to samples/cpp 2023-01-13 17:42:55 -05:00
sample_definition_and_criteria.rst Bluetooth: Remove point 6 of Samples Guidelines 2023-02-06 10:43:31 +01:00