1

I am currently working on a project that involves creating a toy shell replica with reading from a configuration file. I using Valgrind to check for memory leaks. The configuration file contains proper various linux commands, and a few invalid commands. My program needs to read them in order to function properly.

However, I have noticed that when the configuration file contains more than two illegal characters (ex. aa or bb), Valgrind enters an infinite loop and does not terminate.

I have tried to debug the issue by running Valgrind with various flags and options, but I have not been able to determine the root cause of the problem.

Has anyone else experienced a similar issue with Valgrind? Is there a workaround or solution to this problem? Any advice or guidance would be greatly appreciated.

I have tried to debug the issue by running Valgrind with various flags and options, but I have not been able to determine the root cause of the problem.

jphotis
  • 51
  • 4
  • 1
    It's not Valgrind who is entering the infinite loop, but your program. The fact it is looping only with valgrind is an evidence that your code has some undefined behavior. – Eugene Sh. Apr 06 '23 at 15:38
  • Can you post an example that reproduces the problem? I really can't tell what script or executable is running in Valgrind. – Paul Floyd Apr 06 '23 at 16:21

0 Answers0