Re: using valgrind to debug uninitialized mem in servern

Tom Hughes via Valgrind-users <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>
On 04/02/2021 10:57, Matthias Apitz wrote:
> El día jueves, febrero 04, 2021 a las 09:48:23a. m. +0000, Tom Hughes escribió:
> 
>> On 04/02/2021 09:26, Matthias Apitz wrote:
>>
>>> At the moment we use the following "trick": the librarian runs in
>>> parallel to the client on the desktop a second window with a "tail -f ..."
>>> on valgrinds log file (STDOUT) and the full screen is recorded with
>>> Microsoft teams functionality. So we can use the timestamps in the log
>>> to go to the replay of the recording and can see what the user did
>>> exactly, which data was entered and which button pressed etc.
>>>
>>> Are there other ideas to bring together the valgrind log and the usage
>>> of the application?
>>
>> You could instrument the request processing logic to log details
>> of the request if any errors are detected while processing it, so
>> something like:
>>
>>    #include "valgrind/valgrind.h"
>>
>>    return_type process_request(...)
>>    {
>>      int errors = VALGRIND_COUNT_ERRORS;
>>
>>      // process request as normal
>>
>>      if (VALGRIND_COUNT_ERRORS > errors)
>>      {
>>        VALGRIND_PRINTF("Saw errors processing request %s", request_name);
>>      }
>>    }
>>
>> Obviously you can change it to log whatever details you want.
> 
> Thanks, this looks like a good plan!
> 
> The above are macros, are there additional shared libs to link with our
> process?

No - the valgrind client directives work by generating a special
sequence of assembly language instructions that is spotted by the
valgrind virtual machine and causes valgrind to generate a call to
an internal routine.

Tom

-- 
Tom Hughes ([email protected])
http://compton.nu/


_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.