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

Add Docker setup #1

Open
wants to merge 171 commits into
base: master
Choose a base branch
from
Open

Add Docker setup #1

wants to merge 171 commits into from

Conversation

buesima
Copy link

@buesima buesima commented Jun 14, 2021

Bascially just the commit dee6e10. Master on Daimler/dlt-daemon is outdated though.

Major goal is here to be able to run the dlt daemon in a containerized environment.

Local build

docker build -t genivi/dlt-daemon .

Run container

docker run -it --rm -v /tmp:/tmp -p 3490:3490 genivi/dlt-daemon
# Update permissions
sudo chmod o+rw /tmp/dlt

oncaphillis and others added 30 commits November 8, 2019 18:41
* New CMake option WITH_DLT_FILETRANSFER
* Only request ZLIB package if
  WITH_DLT_COREDUMPHANDLER==ON or
  WITH_DLT_FILETRANSFER==ON

Signed-off-by: Sebastian Kloska <[email protected]>
* Avoided Seg fault in dlt_message_payload (COVESA#179)

 Avoided Seg fault by adding boundary check before buffer access.

Signed-off-by: Ravi Sankar P <[email protected]>
Signed-off-by: Vo Trung Chi <[email protected]>
Fix the issue that DLT offline trace creating mutiple files
even after reaching MaxTrace size when filename is index based.

Related to: COVESA#174

Signed-off-by: Vo Trung Chi <[email protected]>
* Fix a potential memory leak in file transfer

This potential memory leak in dlt-system-filetransfer.c can happen if only a filename
is passed to dirname(). In the current implementation of dlt-daemon, this issue cannot happen.
But in case of refactoring or different usage there is a chance that it can be triggered.
See: https://linux.die.net/man/3/dirname

Signed-off-by: Andreas Seidl <[email protected]>
…ESA#191)

The use of this macro in a if condition is actually non-standard C++
code. GCC issues a warning that ISO C++ forbids braced-groups within
expressions when compiled with -Wpedantic. Other compilers fail with an
error. Change the macro to an internal function in order to improve the
portability to other platforms (i.e. MSVC, proprietary embedded).

Signed-off-by: Sebastian Lipponer <[email protected]>
* Symptome: If access to the trace directory is not
  granted by AppArmor access(...) still reports otherwise.
  dlt_offline_trace_get_total_size(...)
  tries to open the dir via opendir(...) and tries a
  readdir without any further check, which results in an
  SEGFAULT

* Solution: (1) Make dlt_offline_trace_get_total_size return
  ssize_t instead of unsigned long, which gives us a
  chance to return an error state (2) Check the return value
  from opendir(...) and bail out on error. Use this to return
  DLT_RETURN_ERROR in dlt_offline_trace_check_size.

* ToDo: (1) Error state is not yet checked and reported
  back. On Error we just don't generate any offline
  log files without any further complain. (2) Find a replacement
  for access(...) which reports properly under AppArmor.
  (3) Report the confusing behaviour of access(...) to the
  AppArmor team.

Signed-off-by: Sebastian Kloska <[email protected]>
report by coverity with Resource leak (RESOURCE_LEAK)

Signed-off-by: Phong Tran <[email protected]>
return without close the file descriptor.
reported by Resource leak (RESOURCE_LEAK)

Signed-off-by: Phong Tran <[email protected]>
for fixing the coverity warnings type Uninitialized scalar variable (UNINIT).
Using uninitialized value log.use_timestamp when
calling dlt_user_log_send_log.

Signed-off-by: Phong Tran <[email protected]>
CID 351398 (mercedes-benz#1 of 1): Use after close (USE_AFTER_FREE)
8. pass_closed_arg: Passing closed handle *sock as an argument to dlt_daemon_socket_get_send_qeue_max_size

Signed-off-by: Phong Tran <[email protected]>
There are some warnings while running dlt-daemon:

$dlt-daemon
Unknown option: UDPConnectionSetup=1
Unknown option: UDPMulticastIPAddress=225.0.0.37
Unknown option: UDPMulticastIPPort=3491

cause the WITH_UDP_CONNECTION is not enabled by default (c9d1ba4).
The configuration for this feature should be sync.

Signed-off-by: Phong Tran <[email protected]>
… a missing include for pthread_t reference:

see https://errors.yoctoproject.org/Errors/Details/308000/ for details

Thanks Khem Raj <[email protected]> for the report

Signed-off-by: Gianfranco Costamagna <[email protected]>
Signed-off-by: Gianfranco Costamagna <[email protected]>
… to uint being undefined.

This is actually an "int" type, looking at the test implementation

Signed-off-by: Gianfranco Costamagna <[email protected]>
Signed-off-by: Gianfranco Costamagna <[email protected]>
…ants poll.h being included directly.

This fixes a build failure on musl systems with strict c hardening flags

Signed-off-by: Gianfranco Costamagna <[email protected]>
Signed-off-by: Gianfranco Costamagna <[email protected]>
The GNU preprocessor supports naming of the variadic macro parameter,
but not preprocessors does.

Signed-off-by: Ted Lyngmo <[email protected]>
The include directive '#include <dlt/dlt.h>' that is stated in the
developer guide (see 'doc/dlt_for_developers.md') does not work when the
include path is set via the pkg-config file 'automotive-dlt.pc'.

The include path set via this file requires users to use the include
directive '#include <dlt.h>'. This is also in accordance with older DLT
documentation.

Signed-off-by: Sebastian Lipponer <[email protected]>
Check for file == null before accessing the pointer
for a debug message

Signed-off-by: Sebastian Kloska <[email protected]>
A DLT lib user can create a message large enough that
dlt_user.resend_buffer is not large enough, and thus it will overflow

Signed-off-by: Ricardo Leite <[email protected]>
The log message was printed as a signed value for uint64 type. This
commit fixes to print as an unsigned value.

Signed-off-by: Saya Sugiura <[email protected]>
`dlt_daemon_log_internal` is called with with a null `local_str`.
This has been introduced by mistake during a code refactoring.
Code has been reverted to the previous version:
  COVESA@bfa7026

Signed-off-by: Francesco Montefoschi <[email protected]>
This use case is common in C++ code nowadays, due to the usage of e.g.
std::string_view, which does not provide a function for retrieving a
null-terminated C-string, but which provides quick access to the string
length via std::string_view::size().

Such use cases can now avoid an entirely unnecessary strlen() call.

Signed-off-by: Martin Willers <[email protected]>
There is no need to have both an array and a pointer to it;
just use the array directly.

Signed-off-by: Martin Willers <[email protected]>
Problem occurs always if application exits and
dlt_user.dlt_segmented_queue_read_handle is not initialized.
Warning "NWTSegmented: Error while reading queue" is printed
on terminal on embedded devices.

Signed-off-by: Rudolf Svanda <[email protected]>
KHANH LUONG HONG DUY and others added 30 commits January 6, 2021 09:27
Introduce cpack options to build DLT debian package

Signed-off-by: KHANH LUONG HONG DUY <[email protected]>
Signed-off-by: KHANH LUONG HONG DUY <[email protected]>
- Correct the data type of 'headersize' and 'datasize' variables in
  header 'dlt_common.h', then config those functions using this library.

- Explicit the data type.

Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <[email protected]>
 - Explicit type conversion from 'signed' to 'unsigned'

Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <[email protected]>
- Some functions like 'strncmp()', 'strncat()', 'strcpy()'
  and 'memcpy()' take an argument in type 'size_t',
  so explicit data type to 'size_t' in this case is needed to avoid
  conversion warnings.

- Function 'strlen' return data type 'size_t', which still need to cast
  data type

Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <[email protected]>
- Data type of 'textlength' create a lot of warnings while using in
  function 'snprintf()', so change data type to 'size_t' will resolve
  these warnings.
- Change data type of variable 'size' to the right type 'unsigned int',
  which is located in struct DltBuffer in dlt_common.h (line 832).

Signed-off-by: Dinh Cong Toan <[email protected]>
Signed-off-by: Saya Sugiura <[email protected]>
- Instead of casting frequently, change the data type of 'to_remove' to
  'uint32_t' for the correct format, also adding temp variable to check
  return value.

- Change data type of 2 variable 'offset' and 'sizecont' to 'size_t'
  (dlt_daemon_client.c), because these variable using many time with
  function 'sizeof', and they was used as local variable so it will not
  effect dlt library.

Signed-off-by: Dinh Cong Toan <[email protected]>
- Casting data type to the right format.

Signed-off-by: Dinh Cong Toan <[email protected]>
- Change the data type of variable 'size' in DltContextData struct
  (dlt_user.h.in). Variable 'size' was used repeated with function
  'sizeof()' many time, so change type to 'size_t' can avoid a lot of
  warnings.

- Adding temporary variable to calculate the datasize header (define in
  dlt_common.h) in 'dlt_common.c' file.

Signed-off-by: Dinh Cong Toan(RBVH/ECM12) <[email protected]>
- Converting datatype to the correct one.

- As macro do not perform type-checking before, so these functions used
  it with different datatype could create a lot of conversion warnings.
  For this reason, these warnings could be consider as normal
  information and will not be fixed.

Signed-off-by: Dinh Cong Toan <[email protected]>
-It's now possbile to enter a custom app and context ID by using the new
 implemented "-A" and "-C" arguments.
-Also added a markdown manual in the doc directory for dlt-example-user.

Signed-off-by: dbiastoch <[email protected]>
- Checking size of buffer and size of message before using memcpy().

- Adding configuration file for testfilter in /tests/CMakeLists.txt.

Signed-off-by: Dinh Cong Toan <[email protected]>
…xit of DLT Client code (COVESA#284)

Issue:
------
dlt_client_main_loop currently uses an infinite loop ("while (1)"). This
creates problems when a DLT client is running in a thread as part of a larger
application. Graceful exit (for example: during object destruction) is not
possible because a thread is running dlt_client_main_loop in the background.

It is also not possible to exit the client, if we want it to fetch only a
pre-decided number of messages.

Solution:
---------
Allow user to define a callback function to check whether the next message
should be fetched.

dlt-test-client.c has a new option to fetch a pre-decided number of messages,
after which the client will exit.

Signed-off-by: Sreeharsha Ramanavarapu <[email protected]>
security-wise dlt pip(FIFO) should be exclusively readable only by owner not the dlt group
to prevent eavesdropping by clients

Signed-off-by: Mostafa Emami <[email protected]>
CVE: CVE-2020-29394

Signed-off-by: KHANH LUONG HONG DUY <[email protected]>

Co-authored-by: KHANH LUONG HONG DUY <[email protected]>
dlt_user_log_write_*_attr() enables to writing these types, but also support
adding "attributes" for them, i.e. a "name" and a "unit".

Signed-off-by: Martin Willers <[email protected]>
Co-authored-by: FIXED-TERM Kaczorowski Radoslaw (BSOT/PJ-ES21) <[email protected]>
Previously, the bytes of a RAWD argument were be printed onto the console
as space-separated hex values, making it difficult or impossible to see
where the RAWD argument ends and the next argument starts. For instance,
with code like this:

    dlt_user_log_write_raw(&ctxData, "data", 4);
    dlt_user_log_write_uint8(&ctxData, 53);

the console output is shown as:

    [64 61 54 61 53]

and there is no indication that there are two arguments, one RAWD and
one UINT8.

This patch changes for console formatting of RAW data to separate by
apostrophs, making the above message appear as:

    [64'61'54'61 53]

This makes it immediately obvious that there is a RAWD argument, and
still keeps the separators quite unobtrusive.

Signed-off-by: Martin Willers <[email protected]>
Create and install proper CMake *-target.cmake and *-config.cmake files,
for use by other CMake-using projects.

It installs a file called automotive-dlt-targets.cmake into a common
location for such files, namely
<prefix>/lib/cmake/automotive-dlt/automotive-dlt-targets.cmake
They can now call find_package(automotive-dlt) and obtain a target
called Genivi::dlt that they can link against with target_link_libraries(),
by which they automatically gain all necessary attributes, including libdlt's
include directories.

Signed-off-by: Martin Willers <[email protected]>
The configuration of memory buffer size must be carefully
parsed and validated to avoid segmentation fault

Any misleading information in configuration file must be
considered as major error and dlt-daemon should stop
and raise error message to stderr

This commit also corrects error handling of
dlt_buffer_init_dynamic().

Signed-off-by: Bui Nguyen Quoc Thanh <[email protected]>
daemon: check the conf inputs
* Make Non-Verbose mode non-exclusive

Switching to global Non-Verbose mode now does not force Verbose messages to
also be sent as Non-Verbose ones anymore. That would not make any sense,
because Verbose messages don't have a MessageId and thus are all getting
the same MessageId of 65535.

Instead, setting global "Non-Verbose" mode will allow both Verbose and
Non-Verbose messages to be sent in a single session.
The "Verbose-APIs" (e.g. dlt_user_log_write_start()) will then only write
Verbose messages, whereas the "Non-Verbose APIs" (e.g. dlt_user_log_write_start_id())
will then only write Non-Verbose messages.

Signed-off-by: Martin Willers <[email protected]>
Find system-provided external gtest in case a system version is available, without need to recompile the bundled version everytime
Allows running the dlt-daemon in a containerized setup.

Signed-off-by: Marcel Buesing <[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.