[genivi-dlt] [patch] Bugfixes and improvements

Vacek, Stefan stefan.vacek at intel.com
Tue Jun 14 03:17:44 EDT 2016


Hi Christoph,

That's a good point. I will provide an update.

Best regards,
Stefan

From: genivi-diagnostic-log-and-trace-bounces at lists.genivi.org [mailto:genivi-diagnostic-log-and-trace-bounces at lists.genivi.org] On Behalf Of Lipka, Christoph (ADITJ/SWG)
Sent: Tuesday, June 14, 2016 8:16 AM
To: genivi-diagnostic-log-and-trace at lists.genivi.org
Subject: Re: [genivi-dlt] [patch] Bugfixes and improvements

Hi Stefan,

I like the way you reworked library initialization and cleanup (0001).

But 0003 should be implemented as "static inline" function to avoid function call in macro as Alex already asked me to change for a patch I send some time ago.

Best regards

Christoph Lipka
Software Group (ADITJ/SWG)

Tel. +81-(0)566 61-5124

From: genivi-diagnostic-log-and-trace-bounces at lists.genivi.org<mailto:genivi-diagnostic-log-and-trace-bounces at lists.genivi.org> [mailto:genivi-diagnostic-log-and-trace-bounces at lists.genivi.org] On Behalf Of Vacek, Stefan
Sent: Friday, June 03, 2016 9:48 PM
To: genivi-diagnostic-log-and-trace at lists.genivi.org<mailto:genivi-diagnostic-log-and-trace at lists.genivi.org>
Subject: [genivi-dlt] [patch] Bugfixes and improvements

Hi Alex, list,

Please find attached patches to fix bugs and internal improvements.

The patches are:

0001: Rework of initialization and cleanup of the dlt-user-library. We introduced a state-machine in dlt_init()to keep track of what has been initialized and to allow proper cleanup in case an error occurs while initializing the library. Furthermore, we replaced the Booleans dlt_user_initialised and dlt_user_freeing with an enum value representing the current state of the library. The access to this state value is done using atomic builtins to ensure thread-safety. Lastly, the indentation of dlt_user.c was converted from tabs to four spaces per tab.

0002: There was a buffer overflow in DLT_MSG_READ macro which led to out-of-bound writes of the provided buffer.

0003: Fixes usage of DltContext that was not registered before. That required extend the api with an additional function dlt_user_check_context_registered() and to modify the macros DLT_LOG, DLT_LOG_ID, DLT_TRACE_NETWORK and DLT_TRACE_NETWORK_TRUNCATED

0004: In dlt_user_trace_network_truncated() if payload==NULL and length==0, do not throw an error

0005: Fix priority inversion problem on the internally used mutex. Use pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT)

0006: Fix buffer overflows when writing string that exceed the size of the message. The tests are also adapted. One is a fix of the script to test the environment variable that controls the initial log-level (src/tests/dlt-test-change-ll-through-env.sh). Another one is an additional unit-test in tests/gtest_dlt_user.cpp to test if the environment variable was correctly used to determine the initial log-level. And since I got confused how the log-level of a context is derived I added some description (currently part of gtest_dlt_user.cpp) to summarize how the log-level of a context is changed/adapted.

Any feedback is very appreciated.


Best regards,
Stefan





   Best regards / Mit freundlichem Gruß

   Dr.-Ing. Stefan Vacek
   Transportation Solution Division TSD
   Automotive Innovation & Product Development Center
   Intel Corp. | Emmy-Noether-Str. 9 | Technologiepark | 76131 Karlsruhe | Germany
   Tel: +49 (0)721 6269 5258 | Email: mailto:Stefan.Vacek at intel.com





Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de<http://www.intel.de>
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genivi.org/pipermail/genivi-diagnostic-log-and-trace_lists.genivi.org/attachments/20160614/0764f6c4/attachment.html>


More information about the genivi-diagnostic-log-and-trace mailing list