Valgrind leakcheck error

46 views
Skip to first unread message

bherman

unread,
Aug 26, 2013, 9:19:05 AM8/26/13
to fox-d...@googlegroups.com
I am using FoX-DOM and the following valgrind error occurs. I am not sure if this is me or is it FoX itself. Please let me know if you get the same thing, I would like to get this resolved:

==5037==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5037==    by 0x54365A: __fox_m_fsys_array_str_MOD_str_vs (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x596073: __m_common_namespaces_MOD_checknamespaces (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x525F80: open_tag.2092 (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x510E3B: __m_sax_parser_MOD_sax_parse (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x509650: __m_dom_parse_MOD_runparser (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x5093AA: __m_dom_parse_MOD_parsefile (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x4BAECC: __xml_interface_MOD_open_xmldoc (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x46C586: __input_xml_MOD_read_settings_xml (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x47232D: __input_xml_MOD_read_input_xml (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x441E4C: __initialize_MOD_initialize_run (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x474C8D: MAIN__ (in /home/bherman/openmc_xml/src/openmc)
==5037==    by 0x474D28: main (in /home/bherman/openmc_xml/src/openmc)

Thanks!

Andrew Walker

unread,
Aug 28, 2013, 1:19:46 AM8/28/13
to fox-d...@googlegroups.com
Hi,

I cannot immediately reproduce this with a simple DOM program and it's hard to see from the data if this is an issue with FoX or with your code.

Could you compile with debugging symbols (configure --enable-debug for FoX and '-g' when you build and link your program) and run valgrind with --leak-check=full --show-reachable=yes and send the full output. 

Thanks,

Andrew


--
You received this message because you are subscribed to the Google Groups "FoX-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fox-discuss...@googlegroups.com.
To post to this group, send email to fox-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/fox-discuss.
For more options, visit https://groups.google.com/groups/opt_out.



--
Andrew Walker
School of Earth Sciences
University of Bristol

bherman

unread,
Sep 5, 2013, 2:57:40 PM9/5/13
to fox-d...@googlegroups.com
Hi Andrew,

Hopefully you can see it with this test code on Github:
https://github.com/bhermanmit/xml_check

All it does is open and closes a file.

Should compile by typing: make

When I run with valgrind: valgrind --leak-check=full --show-reachable=yes ./xml

I get the following output:

==17550== Memcheck, a memory error detector
==17550== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==17550== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==17550== Command: ./xml
==17550==
==17550==
==17550== HEAP SUMMARY:
==17550==     in use at exit: 1 bytes in 1 blocks
==17550==   total heap usage: 3,151 allocs, 3,150 frees, 416,679 bytes allocated
==17550==
==17550== 1 bytes in 1 blocks are definitely lost in loss record 1 of 1
==17550==    at 0x4C2B3F8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17550==    by 0x478B3A: __fox_m_fsys_array_str_MOD_str_vs (in /home/bherman/Documents/xml_check/xml)
==17550==    by 0x4C01A2: __m_common_namespaces_MOD_checknamespaces (in /home/bherman/Documents/xml_check/xml)
==17550==    by 0x45B35B: open_tag.2407 (in /home/bherman/Documents/xml_check/xml)
==17550==    by 0x446262: __m_sax_parser_MOD_sax_parse (in /home/bherman/Documents/xml_check/xml)
==17550==    by 0x43E8B2: __m_dom_parse_MOD_runparser (in /home/bherman/Documents/xml_check/xml)
==17550==    by 0x43E5F6: __m_dom_parse_MOD_parsefile (in /home/bherman/Documents/xml_check/xml)
==17550==    by 0x4013B9: MAIN__ (in /home/bherman/Documents/xml_check/xml)
==17550==    by 0x401404: main (in /home/bherman/Documents/xml_check/xml)
==17550==
==17550== LEAK SUMMARY:
==17550==    definitely lost: 1 bytes in 1 blocks
==17550==    indirectly lost: 0 bytes in 0 blocks
==17550==      possibly lost: 0 bytes in 0 blocks
==17550==    still reachable: 0 bytes in 0 blocks
==17550==         suppressed: 0 bytes in 0 blocks
==17550==
==17550== For counts of detected and suppressed errors, rerun with: -v
==17550== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)

Thanks,

Bryan

Andrew Walker

unread,
Sep 13, 2013, 8:19:09 AM9/13/13
to fox-d...@googlegroups.com
Hi Bryan,

I've finally had a chance to look at this properly and it turns out that the bug has already been fixed somewhere between the release of version 4.1.2 and the current tip of the development branch on github. (I can reproduce your leak in commit 1b9399b58d80, but not with the current commit f58d44d6e83bff or the commits immediately before that). 

I think it's about time I did a new release. I'll try and do this soon! In the meantime, you can grab the most up to date version direct from: https://github.com/andreww/fox

Regards,

Andrew

bherman

unread,
Sep 13, 2013, 9:11:19 AM9/13/13
to fox-d...@googlegroups.com
Thanks Andrew, I will pull those changes in. Is there anyway you can easily add integer(8) support for reading data for the next release? Then I can use your code without any modifications. I added the following routines and just changed integer to integer(8):

in module m_dom_extras:
extractDataContentLongSca
extractDataAttributeLongSca

in module fox_m_fsys_parse_input:
scalartolong

-Bryan
Reply all
Reply to author
Forward
0 new messages