covesa / dlt-daemon Goto Github PK
View Code? Open in Web Editor NEWDiagnostic Log and Trace.
Home Page: https://covesa.github.io/dlt-daemon/
License: Mozilla Public License 2.0
Diagnostic Log and Trace.
Home Page: https://covesa.github.io/dlt-daemon/
License: Mozilla Public License 2.0
automotive-dlt.pc.in specifies "-lz" in it's Libs line regardless of whether or not WITH_DLT_SYSTEM is set to OFF.
When building under versions of Yocto newer than Pyro (i.e. those with recipe-specific sysroots) this causes clients of the daemon to fail to link unless zlib is ALWAYS present in the DEPENDS line of themselves or of the dlt-daemon recipe.
Hello @ssugiura -san,
please update the maintainer/contact information. Thanks.
Currently we the allocation/de-allocation logic does unneccessary memory copy causing CPU load and on top we need double the heap size than it actually requires in usual cases.
Let's say we configure the dlt buffer size as 20 MB, we need approx 40 MB during the allocation of the final step size.
Same logic is used in dltlib, this all applications are also affected due to this inefficient logic.
We need to improve it.
Environment:
dlt daemon 2.18
dlt_logstorage.conf:
[FILTER1]
LogAppName=CM,PA,VM,VS,AUD,VIP
ContextName=.*
LogLevel=DLT_LOG_DEBUG
File=TJXW2000
FileSize=500000
NOFiles=2
SyncBehavior=ON_MSG
Steps:
Start dlt-daemon for a long time.
Expected:
Dlt-daemon only creates 2 files (as specified in dlt_logstorage.conf) and rotates them.
Error:
Dlt-daemon creates so many files, as shown below:
root@kliu5:/logs/dlt/log# ls -l
total 2414
-rw-rw-rw- 1 root socket 499947 Jan 1 2014 TJXW2000_1_19700101-000030.dlt
-rw-rw-rw- 1 root socket 0 Jan 1 2014 TJXW2000_2_20140101-001230.dlt
-rw-rw-rw- 1 root socket 499958 Jan 1 2014 TJXW2000_2_20140101-001231.dlt
-rw-rw-rw- 1 root socket 46059 Jan 1 2014 TJXW2000_3_20140101-001350.dlt
-rw-rw-rw- 1 root socket 17336 Jan 1 2014 TJXW2000_3_20140101-001351.dlt
-rw-rw-rw- 1 root socket 864 Jan 1 2014 TJXW2000_3_20140101-001352.dlt
-rw-rw-rw- 1 root socket 499990 Jan 1 2014 TJXW2000_3_20140101-001353.dlt
-rw-rw-rw- 1 root socket 0 Jan 1 2014 TJXW2000_4_20140101-000049.dlt
-rw-rw-rw- 1 root socket 0 Jan 1 2014 TJXW2000_4_20140101-000050.dlt
-rw-rw-rw- 1 root socket 0 Jan 1 2014 TJXW2000_4_20140101-000051.dlt
-rw-rw-rw- 1 root socket 4096 Jan 1 2014 TJXW2000_4_20140101-000054.dlt
-rw-rw-rw- 1 root socket 499965 Jan 1 2014 TJXW2000_4_20140101-000055.dlt
-rw-rw-rw- 1 root socket 122880 Jan 1 2014 TJXW2000_5_20140101-000204.dlt
-rw-rw-rw- 1 root socket 62317 Jan 1 2014 TJXW2000_5_20140101-000205.dlt
-rw-rw-rw- 1 root socket 4096 Jan 1 2014 TJXW2000_5_20140101-000207.dlt
-rw-rw-rw- 1 root socket 8192 Jan 1 2014 TJXW2000_5_20140101-000208.dlt
-rw-rw-rw- 1 root socket 103333 Jan 1 2014 TJXW2000_5_20140101-000209.dlt
-rw-rw-rw- 1 root socket 11196 Jan 1 2014 TJXW2000_5_20140101-000212.dlt
-rwxr-xr-x 1 root root 797 Jan 1 1970 dlt_logstorage.conf
I don't know why would this happen, and please help to check this problem, thanks!
dlt-system reads file content block by block only once and sends it to the dlt library. The file content is never read again, thus file access could be done in O_DIRECT mode without consuming as much memory resources.
When I test offline logstorge, at first, logs are stored well.
But after a while, there are lots of message_buffer_overflow logs are stored in the offline file.
35083 2019/12/05 06:56:29.939936 152031749 000 ECU1 DA1- DC1- control response N 1 [message_buffer_overflow, ok, 01 5a af 02 00]
Is there anything wrong with my offline logstorage? Why this happend? How can I avoid this?
Thanks!
There are a lot of dead links in doc/ directory (and most likely others, too). Those should be updated or removed.
dlt_message_payload does not consider textlength parameter before copy of data to "text"
DltReturnValue dlt_message_payload(DltMessage *msg, char *text, int textlength, int type, int verbose)
see the case:
if ((type_info & DLT_TYPE_INFO_STRG) &&
(((type_info & DLT_TYPE_INFO_SCOD) == DLT_SCOD_ASCII) || ((type_info & DLT_TYPE_INFO_SCOD) == DLT_SCOD_UTF8))) {
in function dlt_message_argument_print
if variables "datalength" and "length" are larger than textlength still DLT_MSG_READ_STRING((text + strlen(text)), *ptr, *datalength, length); is called and length number of bytes are copied into "text" buffer beyond the textlength boundary.
This was discovered calling dlt_message_payload with a rather small text buffer. In my case size 64.
If I use dlt-control -r 0 -uv, -> set all traces to 0.
This can be confirmed by: dlt-control -juv and indeed all traces are set to 0.
But the logs are still visible in dlt-viewer. Shouldn't the logs be disabled at this point?
In the same scenario but using logLevel instead of Trace state we get the following:
dlt-control -l 0 -uv -> set all log levels to 0.
Logs are correctly set to 0, confirmed by dlt-control -juv.
At this point, logs are no longer visible in dlt-viewer, so for logLevel we get the expected behavior but not the same behavior when using trace state.
version:2.18.4
OS: QNX7.0
The log is as follows:
/home/jzhang61/core/log/LogManager/dlt-daemon-2.18.4/src/daemon/udp_connection/dlt_daemon_udp_common_socket.h:37:23: fatal error: sys/epoll.h: No such file or directory
compilation terminated.
src/daemon/CMakeFiles/dlt-daemon.dir/build.make:494: recipe for target 'src/daemon/CMakeFiles/dlt-daemon.dir/udp_connection/dlt_daemon_udp_socket.c.o' failed
make[2]: *** [src/daemon/CMakeFiles/dlt-daemon.dir/udp_connection/dlt_daemon_udp_socket.c.o] Error 1
CMakeFiles/Makefile2:209: recipe for target 'src/daemon/CMakeFiles/dlt-daemon.dir/all' failed
make[1]: *** [src/daemon/CMakeFiles/dlt-daemon.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
I want to print file name along with line number wherever i put info/debug/error without changing any of the code. Is this possible?
As defined in the "Specification of Diagnostic Log and Trace AUTOSAR Release 4.2.2" and "PRS 1.4.0", the DLT protocol allows for type STRUCT and type ARRAY verbose arguments to be contained in the payload.
Are there any plans to implement support for these argument types?
software version:2.18.4 STABLE, Please help to confirm it. Thanks.
Device serial output:
dlt-daemon &
[1] 1044544
Unknown option: UDPConnectionSetup=1
Unknown option: UDPMulticastIPAddress=225.0.0.37
Unknown option: UDPMulticastIPPort=3491
[ 1962.843466]DLT1044544~NOTICE ~Starting DLT Daemon; DLT Package Version: 2.18.4 STABLE, Package Revision: , build on Jan 2 2020 13:35:33
-SYSTEMD -SYSTEMD_WATCHDOG -TEST -SHM
[ 1962.843466]DLT1044544~INFO Activate connection type: 4INFO
[ 1962.843466]DLT1044544dlt_daemon_socket_open: Socket createdINFO
[ 1962.843466]DLT1044544dlt_daemon_socket_open: Listening on ip 0.0.0.0 and port: 3490INFO
[ 1962.843466]DLT1044544dlt_daemon_socket_open: Socket send queue size: 90112INFO
[ 1962.843466]DLT1044544Activate connection type: 1INFO
[ 1962.844466]DLT1044544Activate connection type: 9INFO
[ 1962.844466]DLT1044544Ringbuffer configuration: 500000/10000000/500000NOTICE
[ 1962.845466]DLT1044544Failed to open ECU Software version file.INFO ~Switched to buffer state for socket connections.
[ 1962.845466]DLT1044544
[ 2954.517369]DLT1044544~INFO Activate connection type: 5WARNING
[ 2954.517369]DLT1044544Duplicate registration of ApplicationID: 'EXA1'; registering from PID 1146945, existing from PID 1126465NOTICE
[ 2954.517369]DLT1044544Send log-level to context: EXA1:CON [-1 -> 4] [-1 -> 0]INFO
[ 2954.519369]DLT1044544Deactivate connection type: 5INFO ~Switched to buffer state for socket connections.
[ 2954.519369]DLT1044544
There is a compilation/linker problem wen trying to compile with systemd and tests enabled:
$ cmake -DWITH_DLT_TESTS=ON -DWITH_TESTSCRIPTS=ON -DWITH_DLT_UNIT_TESTS=ON -DWITH_SYSTEMD=ON -DWITH_SYSTEMD_JOURNAL=ON CMakeLists.txt
Error output:
[ 93%] Building CXX object tests/CMakeFiles/gtest_dlt_daemon_gateway.dir/gtest_dlt_daemon_gateway.cpp.o
[ 94%] Linking CXX executable gtest_dlt_daemon_gateway
../src/daemon/libdlt_daemon.so: undefined reference to `sd_booted'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/gtest_dlt_daemon_gateway] Error 1
make[1]: *** [tests/CMakeFiles/gtest_dlt_daemon_gateway.dir/all] Error 2
make: *** [all] Error 2
[FILTER1]
LogAppName=.*
ContextName=.*
...
When I write a filter like this, I can't store any logs.
I want to store all logs in offline storage, so I must add filter in dlt_logstorage.conf, but it seems filter can't support store logs of all apps and contexts.
Can anyone give me some suggestion?
welll, i got another issue.
i have install dlt-daemon 2.17 from source code,
and th .pc file is at path:
$ ll /usr/lib/x86_64-linux-gnu/pkgconfig/automotive-dlt.pc
-rw-r--r-- 1 root root 728 Jun 20 20:49 /usr/lib/x86_64-linux-gnu/pkgconfig/automotive-dlt.pc
the file content is as below:
$ cat /usr/lib/x86_64-linux-gnu/pkgconfig/automotive-dlt.pc
prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib/x86_64-linux-gnu
includedir=${exec_prefix}/include
Name: DLT
Description: Diagnostic Log and Trace
Version: 2.17.0
Requires:
Libs: -L${libdir} -ldlt -lrt -lpthread -lz
Cflags: -I${includedir}/dlt -DDLT_2_17
and, i have config pkg-config search path as below:
$ echo $PKG_CONFIG_PATH
/usr/lib/x86_64-linux-gnu/pkgconfig:
but, when i trying to compiler anthoer project, i always got an error as below:
-- Checking for one of the modules 'automotive-dlt;2.17'
CMake Error at /usr/local/share/cmake-3.12/Modules/FindPkgConfig.cmake:659 (message):
None of the required 'automotive-dlt;2.17' found
Call Stack (most recent call first):
CMakeLists.txt:57 (pkg_search_module)
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Configuring incomplete, errors occurred!
See also "/path/to/myproject/build/native/log/CMakeFiles/CMakeOutput.log".
See also "/path/to/myproject/build/native/log/CMakeFiles/CMakeError.log".
did i miss something?
i have no idea now
.../dlt_daemon_udp_common_socket.h:37:23: fatal error: sys/epoll.h: No such file or directory
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6)
I get these compilation errors with the latest release:
dlt-viewer/build> make
[ 0%] Automatic moc and uic for target dlt_parser
[ 0%] Built target dlt_parser_automoc
[ 4%] Built target dlt_parser
[ 5%] Automatic moc and uic for target qdlt
[ 5%] Built target qdlt_automoc
[ 19%] Built target qdlt
[ 20%] Automatic moc and uic for target qextserialport
[ 20%] Built target qextserialport_automoc
[ 24%] Built target qextserialport
[ 25%] Automatic moc and uic for target dlt-viewer
[ 25%] Built target dlt-viewer_automoc
[ 26%] Building CXX object src/CMakeFiles/dlt-viewer.dir/main.cpp.o
In file included from /home/vagrant/dlt-viewer/src/mainwindow.h:34:0,
from /home/vagrant/dlt-viewer/src/main.cpp:22:
/home/vagrant/dlt-viewer/src/searchdialog.h:60:40: error: ‘>>’ should be ‘> >’ within a nested template argument list
QHash<QString, QList <unsigned long>> cachedHistoryKey;
^
/home/vagrant/dlt-viewer/src/searchdialog.h:86:33: error: ‘>>’ should be ‘> >’ within a nested template argument list
QList < QList <unsigned long>> m_searchHistory;
^
src/CMakeFiles/dlt-viewer.dir/build.make:149: recipe for target 'src/CMakeFiles/dlt-viewer.dir/main.cpp.o' failed
make[2]: *** [src/CMakeFiles/dlt-viewer.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:352: recipe for target 'src/CMakeFiles/dlt-viewer.dir/all' failed
make[1]: *** [src/CMakeFiles/dlt-viewer.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
[ 88%] Building CXX object src/CMakeFiles/dlt-viewer.dir/dlt-viewer_automoc.cpp.o
In file included from /home/vagrant/dlt-viewer/src/dltmsgqueue.cpp:1:0:
/home/vagrant/dlt-viewer/src/dltmsgqueue.h:25:37: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
const int maxSleepTime = 1000 * 10;
^
/home/vagrant/dlt-viewer/src/dltmsgqueue.h:26:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
const int sleepTimeSteps = 10;
^
/home/vagrant/dlt-viewer/src/dltmsgqueue.cpp: In destructor ‘DltMsgQueue::~DltMsgQueue()’:
/home/vagrant/dlt-viewer/src/dltmsgqueue.cpp:16:18: error: ‘nullptr’ was not declared in this scope
if(buffer != nullptr)
Hello,
I propose to start using Travis CI for linux builds.
General technical details:
Goals:
P.S.
If it's interesting for you, I can do it at several weeks.
If you have some concerns, please let's discuss it. As I can see there are no any problem with CI integration.
Use DLT Viewer v2.18 in Ubuntu. Connect ECU in Serial Mode over COM port. Connection is not established.
Note: Minicom working properly in Ubuntu VM and also there is no issue in windows version of same Dlt-viewer.
I can't start dlt-daemon on ubuntu 16.04 with the default config in /usr/local/etc/dlt.conf
Daemon returns with error code 255.
(edited default config for verbosity just for this report):
dlt-daemon
[21506.169517]~DLT~ 609~NOTICE ~Starting DLT Daemon; DLT Package Version: 2.17.0 STABLE, Package Revision: v2.17.0, build on Feb 12 2018 13:44:26
-SYSTEMD -SYSTEMD_WATCHDOG -TEST -SHM
[21506.169528]~DLT~ 609~INFO ~main()
[21506.169535]~DLT~ 609~INFO ~dlt_daemon_local_init_p1()
[21506.169546]~DLT~ 609~INFO ~dlt_file_init()
[21506.169547]~DLT~ 609~INFO ~dlt_message_init()
[21506.169552]~DLT~ 609~INFO ~dlt_daemon_local_connection_init()
[21506.169582]~DLT~ 609~INFO ~FIFO size: 65536
[21506.169589]~DLT~ 609~INFO ~Activate connection type: 3
[21506.170343]~DLT~ 609~WARNING ~socket() error
[21506.170362]~DLT~ 609~WARNING ~failed to bind socket
[21506.170364]~DLT~ 609~ERROR ~Could not initialize main socket.
[21506.170365]~DLT~ 609~CRITICAL ~Initialization of local connections failed!
I tried different -p and -t options unsuccessfully.
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6)
Fix: uncomment line 343 in include/dlt/dlt_common.h
/**
* Provision to test static function
*/
#ifndef DLT_UNIT_TESTS
//#define STATIC static // <-- UNCOMMENT ME
#else
#define STATIC
#endif
dlt-daemon/build> make
[ 0%] Built target compress_man
[ 8%] Built target dlt
[ 9%] Building C object src/daemon/CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c:66:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
STATIC int dlt_connection_send(DltConnection *conn,
^
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c: In function ‘dlt_connection_send_multiple’:
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c:118:15: warning: implicit declaration of function ‘dlt_connection_send’ [-Wimplicit-function-declaration]
ret = dlt_connection_send(con,
^
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c: At top level:
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c:163:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
STATIC void dlt_connection_destroy_receiver(DltConnection *con)
^
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c:195:1: error: unknown type name ‘STATIC’
STATIC DltReceiver *dlt_connection_get_receiver(DltDaemonLocal *daemon_local,
^
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c:195:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
STATIC DltReceiver *dlt_connection_get_receiver(DltDaemonLocal *daemon_local,
^
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c: In function ‘dlt_connection_destroy’:
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c:326:5: warning: implicit declaration of function ‘dlt_connection_destroy_receiver’ [-Wimplicit-function-declaration]
dlt_connection_destroy_receiver(to_destroy);
^
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c: In function ‘dlt_connection_create’:
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c:381:22: warning: implicit declaration of function ‘dlt_connection_get_receiver’ [-Wimplicit-function-declaration]
temp->receiver = dlt_connection_get_receiver(daemon_local, type, fd);
^
/home/vagrant/dlt-daemon/src/daemon/dlt_daemon_connection.c:381:20: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
temp->receiver = dlt_connection_get_receiver(daemon_local, type, fd);
^
src/daemon/CMakeFiles/dlt-daemon.dir/build.make:110: recipe for target 'src/daemon/CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o' failed
make[2]: *** [src/daemon/CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o] Error 1
CMakeFiles/Makefile2:258: recipe for target 'src/daemon/CMakeFiles/dlt-daemon.dir/all' failed
make[1]: *** [src/daemon/CMakeFiles/dlt-daemon.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Maybe I just miss how to do this correctly but trying to terminate a dlt-client results in a SIG32 for me.
In a debugger/IDE this results in messages or popups, on command line I get a warning (while I'm not sure if that's related at all):
[282850.288472]~DLT~81290~WARNING ~dlt_user_atexit_handler dlt_user_initialised false
IMHO I'm shutting down the client correctly by calling DLT_UNREGISTER_CONTEXT
and DLT_UNREGISTER_APP
before exiting (despite those are called by the exit handler anyway (dlt_user_atexit_handler
):
for (auto && context : contexts_) {
DLT_UNREGISTER_CONTEXT(context.second);
}
DLT_UNREGISTER_APP();
Inspecting dlt_user.c
a bit I found
dlt_stop_threads()
call pthread_cancel
terminating the receiver thread (which itself has no abort-condition).
I also fiddled a bit with this_thread::sleep_for()
before / after calling dlt_free()
manually but with no effect.
I'm using dlt-daemon
/ dlt-client
v2.18 on a recent Linux kernel (5.0.5) on Fedora 29 - and tried v2.16 before with the same result.
Expectation: client terminates gracefully in debugger and stand alone
EINTR dlt-daemon do not deal with
I think this is very import ,
but the current version do not deal with this signal(EINTR)
The DLT implementation uses non-POSIX shared memory and semaphore API like shmget, semget etc.,
These APIs are not availble in POSIX, the suggestion is to use shm_open, sem_open APIs. I can submit a patch if needed.
I got an error as below, did i miss any develop lib?
i followed reademe, installed zlib1g-dev libdbus-glib-1-dev.
and i have tried many libs, like libdbus-1-dev...
bye the way, my env:
ubuntu 16.04
cmake 3.12.1
any suggestion?
thank you very much
ERROR MESSAGE:
$ cmake3 .. -DWITH_SYSTEMD=ON -DWITH_SYSTEMD_JOURNAL=ON -DCMAKE_INSTALL_PREFIX=/usr
-- Checking for module 'dbus-1'
-- No package 'dbus-1' found
CMake Error at /usr/local/share/cmake-3.12/Modules/FindPkgConfig.cmake:436 (message):
A required package was not found
Call Stack (most recent call first):
/usr/local/share/cmake-3.12/Modules/FindPkgConfig.cmake:602 (_pkg_check_modules_internal)
CMakeLists.txt:96 (pkg_check_modules)
-- Configuring incomplete, errors occurred!
See also "/path/to/dlt-daemon-2.17.0/build/CMakeFiles/CMakeOutput.log".
See also "/path/to/dlt-daemon-2.17.0/build/CMakeFiles/CMakeError.log".
Hi all,
I would like to propose a modification inside dlt-system which adds a new feature. This new feature allows dlt-system to completely replace syslogd.
Instead of having syslogd running + dlt-system running, we have only dlt-system which is running (means one less application on the system).
This work on my side should be a little adapted to be cleanly up streamed.
It's why I ask you here if you're interested by such kind of new feature or if it's something you consider not very useful knowing that, currently, dlt-system can catch the log of syslogd through the UDP socket.
Thanks in advance for your answer.
Sébastien
[ 35%] Building C object src/console/logstorage/CMakeFiles/dlt-logstorage-ctrl.dir/dlt-logstorage-common.c.o
In function ‘prepare_message_body.constprop’,
inlined from ‘dlt_logstorage_send_event’ at /home/ykhokhulya/work/packages/dlt-daemon/src/console/logstorage/dlt-logstorage-common.c:329:10:
/home/ykhokhulya/work/packages/dlt-daemon/src/console/logstorage/dlt-logstorage-common.c:309:5: error: ‘strncpy’ specified bound 1024 equals destination size [-Werror=stringop-truncation]
strncpy(serv->mount_point, path, DLT_MOUNT_PATH_MAX);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 35%] Building C object src/console/logstorage/CMakeFiles/dlt-logstorage-ctrl.dir/dlt-logstorage-common.c.o
In function ‘prepare_message_body.constprop’,
inlined from ‘dlt_logstorage_send_event’ at /home/ykhokhulya/work/packages/dlt-daemon/src/console/logstorage/dlt-logstorage-common.c:329:10:
/home/ykhokhulya/work/packages/dlt-daemon/src/console/logstorage/dlt-logstorage-common.c:309:5: error: ‘strncpy’ specified bound 1024 equals destination size [-Werror=stringop-truncation]
strncpy(serv->mount_point, path, DLT_MOUNT_PATH_MAX);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GCC version: 8.1.0
Actual behaviour: DLT_LOG() can't release memery
Expect behaviour: DLT_LOG() release memery immediatelly
Detail: In DltContextData log_local, there is a 1390 bytes buffer "unsigned char buffer[DLT_USER_BUF_MAX_SIZE]", each DLT_LOG() will create this buffer, if there are 2 calls in one function, the function will create 1390 * 2 bytes buffer. More calls in one function, will cost more bigger memery, which will lead Stack overflow.
#define DLT_LOG(CONTEXT,LOGLEVEL,ARGS...)
do {
if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE)
{
DltContextData log_local;
int dlt_local;
dlt_local = dlt_user_log_write_start(&CONTEXT,&log_local,LOGLEVEL);
if (dlt_local > 0)
{
ARGS;
(void)dlt_user_log_write_finish(&log_local);
}
}
} while(0)
#endif
For example,
In bellowing function testFile1Run1(), there are 2 calls of DLT_LOG(), which mean DLT will take at least 1390*2 bytes of memery.
int testFile1Run1(){
//Just some log to the main context
DLT_LOG(mainContext,DLT_LOG_INFO,DLT_STRING("Started testF1P1 - dlt_user_log_file_complete"),DLT_STRING(file1));
//Here's the line where the dlt file transfer is called. The method call needs a context, the absolute file path, will the file be deleted after transfer and the timeout between the packages
transferResult = dlt_user_log_file_complete(&fileContext,file1,0,20);
if(transferResult < 0 )
{
printf("Error: dlt_user_log_file_complete\n");
return transferResult;
}
//Just some log to the main context
DLT_LOG(mainContext,DLT_LOG_INFO,DLT_STRING("Finished testF1P1"),DLT_STRING(file1));
printTestResultPositiveExpected(__FUNCTION__,transferResult);
return transferResult;
}
Environment:
dlt daemon 2.17
dlt.conf:
OfflineLogstorageMaxDevices = 3
OfflineLogstorageDirPath = .
OfflineLogstorageMaxCounter = 100
OfflineLogstorageCacheSize = 500000
dlt_logstorage.conf:
[FILTER1]
LogAppName=LOG, LOG1
ContextName=.*
LogLevel=DLT_LOG_INFO
File=testlog
FileSize=99
NOFiles=5
Steps:
Expected:
Dlt-daemon creates 5 files (as specified in dlt_logstorage.conf) and rotates them.
Error:
Dlt-daemon creates 10 files and rotates them, 5 files for "LOG" app id and 5 files for "LOG"1 app id.
Reason:
Bad synchronization of dlt_offline_logstoarge files.
We need to look at struct DltLogStorage inside the DltDaemon struct. It has config_list which is key-value list. Each value DltLogStorageFilterConfig has field records. It is the list of files that was recorded in offline logstorage directory, and it used for creating new file when the old one is full. Than we look to the dlt_logstorage_open_log_file function:
if (config->records == NULL)
{
if (dlt_logstorage_storage_dir_info(file_config, storage_path, config) != 0)
{
return -1;
}
}
This code executes when log with key (CTXT: or APPID: or APPID:CTXTID) writes in logstorage for the first time. dlt_logstorage_storage_dir_info fills records with names of log files which are present in directory at this moment. But another key has it's own records and it can rotate files in directory which wont be actual for other keys. So dlt-daemon rotates files for each key but not for each [FILTER]
The fastest fix is:
erase(config->records)
config->records = NULL;
if (config->records == NULL)
{
if (dlt_logstorage_storage_dir_info(file_config, storage_path, config) != 0)
{
return -1;
}
}
But it will do a lot of unnecessary actions and will load CPU.
The README has a nice build badge now but clicking on it just shows the image again.
Is this done on a public build server, and is it possible to link the build image to the details page of the actual build?
Of course, this is very useful in particular if it fails, but also to study what was actually done in a build, whether it is successful or not.
Hello,
I want to install this library on a micro-controller (STM32H7) with RTOS.
I saw some RTOS having the POSIX and ANSI standard, would that be enough to use the library as is ?
If not, is it possible for you to tell me the reason why ?
Sincerely,
Clancys74.
The use of DLT_CHECK_RCV_DATA_SIZE()
in a if condition as in src/daemon/dlt_daemon_client.c
and src/gateway/dlt_gateway.c
is non-standard C++ code. The if condition must be either an expression or a declaration of a single non-array variable.
Nevertheless, many compilers seem to accept this code. Try this yourself on godbolt. However, compiling with -pedantic
results even with gcc in the following warning:
<source>:2:1: warning: ISO C++ forbids braced-groups within expressions [-Wpedantic]
MSVC also fails to compile this code.
The use of non-standard C++ makes it more difficult to port this DLT implementation to other platforms like Windows and proprietary embedded.
A possible solution could be to change this macro to a static inline function.
In GDP, we are moving from services running as root, to them running as a (special) system user:
https://at.projects.genivi.org/jira/browse/GDP-722
Seems dlt developers have already thought of this and made the service user configurable. Kudos for that! However, dlt-dbus.service seems to have user hardcoded, even though it's generated like the rest of the .service files. I'm guessing it was a simple mistake and not by design. Hence this bug.
Additional comments:
zeenix147 Zeeshan Ali added a comment - 18/Sep/17 7:56 AM
Actually I have to take my praises back if I'm reading this correctly and DLT is hardcoding the user from CMake, instead of in the templates:
https://github.com/GENIVI/dlt-daemon/blob/master/CMakeLists.txt#L73
The question is why? This should really be a configurable option.
Jeremiah Foster added a comment - Yesterday
Should this get transfered to GitHub? The only reason it wouldn't in my view is because it can be closed.
Permalink Edit Delete
clipka Christoph Lipka added a comment - 3 minutes ago - edited
The issue still exists. If I read Zeeshan Ali comment correctly, the additionally wants the user configurable from outside, right? Not set as "genivi" inside the CMake script.
Issue moved from GENIVI Jira to here
Hi,
When is the next release planned which includes all the fixes post v.2.17.0 release.
Latest commit on master (b2ce65d) breaks compilation by using a constant that is not defined.
22:43:15 + make dlt
22:43:15 Scanning dependencies of target dlt
22:43:15 [ 14%] Building C object src/lib/CMakeFiles/dlt.dir/dlt_user.c.o
22:43:16 [ 28%] Building C object src/lib/CMakeFiles/dlt.dir/dlt_client.c.o
22:43:16 [ 42%] Building C object src/lib/CMakeFiles/dlt.dir/dlt_filetransfer.c.o
22:43:17 [ 57%] Building C object src/lib/CMakeFiles/dlt.dir/dlt_env_ll.c.o
22:43:17 [ 71%] Building C object src/lib/CMakeFiles/dlt.dir/__/shared/dlt_common.c.o
22:43:17 /opt/jenkins/SI01/workspace/build_libdlt/src/shared/dlt_common.c: In function \91dlt_receiver_init_unix_socket\92:
22:43:17 /opt/jenkins/SI01/workspace/build_libdlt/src/shared/dlt_common.c:2166:33: error: \91DLT_APP_RCV_BUF_MAX\92 undeclared (first use in this function)
22:43:17 *buffer = (char*)malloc(DLT_APP_RCV_BUF_MAX);
22:43:17 ^
22:43:17 /opt/jenkins/SI01/workspace/build_libdlt/src/shared/dlt_common.c:2166:33: note: each undeclared identifier is reported only once for each function it appears in
22:43:17 make[3]: *** [src/lib/CMakeFiles/dlt.dir/__/shared/dlt_common.c.o] Error 1
22:43:17 make[2]: *** [src/lib/CMakeFiles/dlt.dir/all] Error 2
22:43:17 make[1]: *** [src/lib/CMakeFiles/dlt.dir/rule] Error 2
22:43:17 make: *** [dlt] Error 2
Currently Travic CI from a fork repo is used (jardous/dlt-daemon). The upstream should have own instance connected to upstream repo and used for building. Link in the README.md has to be updated.
Linked issue: #42
Please start using annotated tags instead of the light ones.
Or is there any reason to use the lights tags instead of an annotated ones?
Using lightweight tags makes it impossible to fetch package version directly.
For example in Yocto, we could just update the SRCREV to get the release tag automatically.
It is not possible to compile the documentation after specifying -DWITH_DOC=ON and running make
But it still fails on asciidoc errors
It seems that running make doc passes
I am using the dlt-receive command with a filter as well but when some dlt log line which is enormously huge than normal, it crashes.
Is there a way to increase the buffer size for the streaming of logs.
The application that registered the injection callback receives only truncated message. Running following command:
$ dlt-control localhost -a APID -c CTID -s 12345 -m all
results that the application receives only "al". One character at the end is always missing.
Most of the project depends on the reliable file transfer mechanism (for eg. core dump, screenshots etc), but unfortunately current genivi dlt implimentation does not support a reliable mechanism. A high trace load or a client connect/disconnect could cause file transfer data to be lost. Same time after deleting the file from .tosend directory a shutdown trigger can happen before the buffered traces reach logger/dlt-viewer. In short, there is no hand shake protocol/confirmation message from logger device/dlt-viewer back to dlt-system to assure the file has reached (from ECU to Logger) fully. This must be improved.
The build fails with clang 7-9
[ 55%] Building C object src/console/logstorage/CMakeFiles/dlt-logstorage-ctrl.dir/dlt-logstorage-ctrl.c.o
/home/luke/deb-test/dlt-daemon/src/console/logstorage/dlt-logstorage-ctrl.c:166:13: error: explicitly assigning value of variable of type 'void *' to itself [-Werror,-Wself-assign]
payload = payload;
~~~~~~~ ^ ~~~~~~~
/home/luke/deb-test/dlt-daemon/src/console/logstorage/dlt-logstorage-ctrl.c:167:9: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign]
len = len;
~~~ ^ ~~~
2 errors generated.
This issue was also reported on Debian:
https://clang.debian.net/logs/2019-01-09-7.0.1/dlt-daemon_2.17.0-3_unstable_clang.log
Using the settings detailed in Issue #52
There are several warnings, the most serious being these:
.../dlt_client.c: In function 'dlt_client_connect':
.../dlt_client.c:263:21: warning: passing argument 2 of 'connect' from incompatible pointer type [-Wincompatible-pointer-types]
(struct sockaddr_un *)&addr,
^
In file included from .../dlt_client.c:76:0:
/opt/toolchains/qnx700_gm/target/qnx7/usr/include/sys/socket.h:596:5: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_un *'
int connect(int, const struct sockaddr *, socklen_t);
^
Building C object src/daemon/CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o
.../dlt-daemon.c: In function 'dlt_daemon_process_control_connect':
.../dlt-daemon.c:1792:41: warning: passing argument 2 of 'accept' from incompatible pointer type [-Wincompatible-pointer-types]
if ((in_sock = accept(receiver->fd, &ctrl, &ctrl_size)) < 0) {
^
In file included from .../dlt-daemon.c:33:0:
/opt/toolchains/qnx700_gm/target/qnx7/usr/include/sys/socket.h:594:5: note: expected 'struct sockaddr * restrict' but argument is of type 'struct sockaddr_un *'
int accept(int, struct sockaddr * __restrict, socklen_t * __restrict);
^
.../dlt-daemon.c: In function 'dlt_daemon_process_app_connect':
.../dlt-daemon.c:1845:41: warning: passing argument 2 of 'accept' from incompatible pointer type [-Wincompatible-pointer-types]
if ((in_sock = accept(receiver->fd, &app, &app_size)) < 0) {
^
In file included from .../dlt-daemon.c:33:0:
/opt/toolchains/qnx700_gm/target/qnx7/usr/include/sys/socket.h:594:5: note: expected 'struct sockaddr * restrict' but argument is of type 'struct sockaddr_un *'
int accept(int, struct sockaddr * __restrict, socklen_t * __restrict);
^
.../dlt_client.c:263:21: warning: passing argument 2 of 'connect' from incompatible pointer type [-Wincompatible-pointer-types]
(struct sockaddr_un *)&addr,
^
In file included from .../dlt_client.c:76:0:
/opt/toolchains/qnx700_gm/target/qnx7/usr/include/sys/socket.h:596:5: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_un *'
int connect(int, const struct sockaddr *, socklen_t);
^
`
Hi,
We making trying to compile with DLT with QNX 7 and succeessful except for the two items, usage of epoll and hsearch_r.
To workaround we are using 2.13.0, the last version without epoll and disabled offline log storage.
Do you have any recommendation on what we should do for epoll? I'd like to keep the changes to minimum to follow the latest udpates but this seem to require updates to a lot of files.
Best regards,
Karthik
hello
we are currently using DLT logging system for our C++ application and for navigation purposes we are depending on PRETTY_FUNCTION C++ macro.
problem rises when we have several layer classes. in that case, some times buffer size reaches and nothing is logged( even 1390 first characters)
is there a way to increase the size of this buffer or a way around this problem?
Regards
Rasekh
#dlt_user.h
#116
Is it possible to compile this with windows and create a dll instead of so file.
Environment:
dlt daemon 2.16.0
dlt viewer 2.18.0 RELEASE
dlt_logstorage.conf stored at PATH:
[FILTER0]
LogAppName=XXXX #(fill in something relevant)
ContextName=XXXX #(fill in something relevant)
LogLevel=DLT_LOG_ERROR
File=filter0
FileSize=20000000
NOFiles=5
#SyncBehavior=ON_DEMAND ON_DAEMON_EXIT
SyncBehavior=ON_MSG
Repro steps:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.