Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daemon connection handling fixes #5

Merged
merged 2 commits into from
Mar 23, 2017

Conversation

clipka
Copy link
Contributor

@clipka clipka commented Feb 10, 2017

If connection to e.g. DLT Viewer is established/removed very frequently, a memory violation might happen due to a bug in connection handling.

Christoph Lipka and others added 2 commits February 1, 2017 12:14
It might happen that an event is part of the epoll event queue that
belongs to a connection which was destroyed before the event is handled.
Due to this, the event handling main loop might stop and the daemon
exits. This misbehavior is fixed with this patch.

Signed-off-by: Christoph Lipka <[email protected]>
In dlt_daemon_send_all_multiple, if the connection was broken, we closed
it before getting the next available connection. This must be avoided by
having a temporary next pointer.
The same kind of problem is valid for pointers coming from the epoll
interface. The kernel can provide back connection pointer that are not
valid any longer. Therefore, we need to use an ID instead of the pointer
value to retrieve the connections.

Signed-off-by: Frederic Berat <[email protected]>
Signed-off-by: Christoph Lipka <[email protected]>
@RalphNiemeyer RalphNiemeyer merged commit 49d5962 into COVESA:master Mar 23, 2017
ssugiura pushed a commit that referenced this pull request Jul 6, 2020
now you can do make test after make :)
=== Sample build and test:
$ cmake -Bbuild -H. \
          -DDLT_IPC=UNIX_SOCKET \
          -DWITH_DLT_ADAPTOR=ON \
          -DWITH_DLT_UNIT_TESTS=ON \
          -DWITH_DLT_CXX11_EXT=ON \
          -DWITH_DLT_MONITOR=OFF \
          -DWITH_DLT_USE_IPv6=OFF
$ cd build
$ make
$ make test
Running tests...
Test project /home/fherrmann/git/dlt-daemon/build
    Start 1: gtest_dlt_common
1/5 Test #1: gtest_dlt_common .................   Passed    0.02 sec
    Start 2: gtest_dlt_user
2/5 Test #2: gtest_dlt_user ...................   Passed    1.01 sec
    Start 3: gtest_dlt_daemon_common
3/5 Test #3: gtest_dlt_daemon_common ..........   Passed    0.01 sec
    Start 4: dlt_env_ll_unit_test
4/5 Test #4: dlt_env_ll_unit_test .............   Passed    0.04 sec
    Start 5: gtest_dlt_daemon_event_handler
5/5 Test #5: gtest_dlt_daemon_event_handler ...   Passed    1.01 sec

100% tests passed, 0 tests failed out of 5

Total Test time (real) =   2.09 sec
===

Signed-off-by: Felix Herrmann <[email protected]>
Signed-off-by: KHANH LUONG HONG DUY <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants