Visual Studio memory violation detection duplication on Linux

I developed a C (non-GUI) C command-line program on Linux using QT Creator, which internally uses gdb as its debugger. When I debugged a program in Windows using Visual Studio, it reported that it was writing outside of the allocated memory (although it did not report a violation at the time it happened, so it was still difficult to track). In the end, I managed to find a place in the code where the malloc call allocated too little memory, and this solved the problem.

However, it bothers me that this problem was never detected on the Linux side. Are there any switches or something that would enable this detection feature in Linux?

+3
source share
1 answer

There are many memory fixes in the code that work for both Windows and Linux. Check out Wikipedia for your list. However, most Linux users use Valgrind as an ideal tool for debugging memory.

+3
source

Source: https://habr.com/ru/post/1768841/


All Articles