Closed craigsapp closed 3 years ago
Running again on a different computer, the current develop
commit b14a7aa is only reporting these problems:
==632252== Conditional jump or move depends on uninitialised value(s)
==632252== at 0x491E71: main (in /user/c/craig/git-cloud/verovio/tools/verovio)
==632252== Uninitialised value was created by a stack allocation
==632252== at 0x491180: main (in /user/c/craig/git-cloud/verovio/tools/verovio)
==632252==
==632252== Conditional jump or move depends on uninitialised value(s)
==632252== at 0x491EB6: main (in /user/c/craig/git-cloud/verovio/tools/verovio)
==632252== Uninitialised value was created by a stack allocation
==632252== at 0x491180: main (in /user/c/craig/git-cloud/verovio/tools/verovio)
==632252==
==632252== HEAP SUMMARY:
==632252== in use at exit: 0 bytes in 0 blocks
==632252== total heap usage: 321,835 allocs, 321,835 frees, 56,542,732 bytes allocated
==632252==
==632252== All heap blocks were freed -- no leaks are possible
==632252==
==632252== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
==632252==
==632252== 1 errors in context 1 of 2:
==632252== Conditional jump or move depends on uninitialised value(s)
==632252== at 0x491EB6: main (in /user/c/craig/git-cloud/verovio/tools/verovio)
==632252== Uninitialised value was created by a stack allocation
==632252== at 0x491180: main (in /user/c/craig/git-cloud/verovio/tools/verovio)
==632252==
==632252==
==632252== 1 errors in context 2 of 2:
==632252== Conditional jump or move depends on uninitialised value(s)
==632252== at 0x491E71: main (in /user/c/craig/git-cloud/verovio/tools/verovio)
==632252== Uninitialised value was created by a stack allocation
==632252== at 0x491180: main (in /user/c/craig/git-cloud/verovio/tools/verovio)
==632252==
==632252== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
In order to print the source-code line numbers in the valgrind output, I had to add the -g
compile option to verovio/tools/CMakeCache.txt
:
//Flags used by the CXX compiler during all build types.
CMAKE_CXX_FLAGS:STRING=-g
The two errors in the last valgrind report are caused by calling toolkit.GetOutputTo()
in main()
. The problem is that the return value Toolkit::m_outputTo
is undefined. It is not initialized in the Toolkit constructor and will not be set if the --output-to
option is not used on the command line. The problem could be related to issue https://github.com/rism-digital/verovio/issues/2398, but I did not bother checking. Instead in commit https://github.com/rism-digital/verovio/commit/07c3349a2019b5229ab644b26582cf709c0e0ff3, I added Toolkit::m_outputFrom = UNKOWN
in Toolkit::Toolkit
(where UNKNOWN
implicitly means svg
is the default output format (at least on the command-line)).
Now the valgrind report summary is:
==1395432== All heap blocks were freed -- no leaks are possible
==1395432==
==1395432== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
I cannot reproduce the initial error report, so I will close this issue until I come across it again.
There are a lot of memory leaks in the recent
develop
version of verovio that are probably related to the new branchdevelop-mdiv-leak
? There were no problems in August, the last time I checked. UnitializedFunctor
parameters may be a source of the problem.Below is a list of memory access errors reported by valgrind using this command (the the example data given further below).
valgrind output:
Test input file: