Memory leak in http-client module
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
Paul J. Lucas |
Bug Description
The original output from valgrind:
==7222== at 0x4C274A8: malloc (vg_replace_
==7222== by 0xC136F21: ???
==7222== by 0xC1964AE: ???
==7222== by 0xC1878D4: ???
==7222== by 0xC1881D1: ???
==7222== by 0xC18BB9E: ???
==7222== by 0xC189D62: ???
==7222== by 0xB392D98: ???
==7222== by 0xB39BCF8: ???
==7222== by 0xB39BD37: ???
==7222== by 0xB162548: ???
==7222== by 0xB162C98: ???
==7222== by 0x58B0700: zorba::
==7222== by 0x5846103: zorba::
==7222== by 0x58DD68E: zorba::
==7222== by 0x5846103: zorba::
==7222== by 0x5F98818: zorba::
==7222== by 0x5F6C555: zorba::
==7222== by 0x5375BB9: zorba::
==7222== by 0x58FA66F: zorba::
Related branches
- Matthias Brantner: Approve
- Paul J. Lucas: Approve
-
Diff: 24 lines (+3/-0)1 file modifiedmodules/com/zorba-xquery/www/modules/http-client.xq.src/http_request_handler.cpp (+3/-0)
Changed in zorba: | |
status: | In Progress → Fix Released |
Using the following command:
LD_PRELOAD= ./LIB_PATH/ com/zorba- xquery/ www/modules/ libhttp- client_ 2.0.so valgrind --leak-check=full bin/zorba -f -i -r --trailing-nl -q ../test/ rbkt/Queries/ zorba/http- client/ put/put2_ integer. xq
produce more useful output:
==32761== HEAP SUMMARY: malloc. c:255) http_client: :HttpRequestHan dler::beginBody (zorba: :String, zorba::String, zorba:: ItemSequence* ) (http_request_ handler. cpp:170) http_client: :RequestParser: :handleBody( zorba:: Item const&) (request_ parser. cpp:213) http_client: :RequestParser: :parseItem( zorba:: Item const&) (request_ parser. cpp:74) http_client: :RequestParser: :handleRequest( zorba:: Item const&) (request_ parser. cpp:130) http_client: :RequestParser: :parseItem( zorba:: Item const&) (request_ parser. cpp:66) http_client: :RequestParser: :parse( zorba:: Item const&) (request_ parser. cpp:53) http_client: :general_ evaluate( std::vector< zorba:: ItemSequence* , std::allocator< zorba:: ItemSequence* > > const&, zorba:: StaticContext const*, zorba:: DynamicContext const*, zorba:: ItemFactory* ) (http_client. cpp:191) http_client: :HttpSendFuncti on::evaluate( std::vector< zorba:: ItemSequence* , std::allocator< zorba:: ItemSequence* > > const&, zorba:: StaticContext const*, zorba:: DynamicContext const*) const (http_client. cpp:233) ExtFunctionCall Iterator: :nextImpl( zorba:: store:: ItemHandle< zorba:: store:: Item>&, zorba::PlanState&) const (fncall_ iterator. cpp:788) Batcher< zorba:: ExtFunctionCall Iterator> ::produceNext( zorba:: store:: ItemHandle< zorba:: store:: Item>&, zorba::PlanState&) const (plan_iterator. h:531) PlanIterator: :consumeNext( zorba:: store:: ItemHandle< zorba:: store:: Item>&, zorba::PlanIterator const*, zorba::PlanState&) (plan_iterator. cpp:124) reachable= yes
==32761== in use at exit: 35,781 bytes in 2,408 blocks
==32761== total heap usage: 86,079 allocs, 83,671 frees, 10,166,929 bytes allocated
==32761==
==32761== 705 (180 direct, 525 indirect) bytes in 1 blocks are definitely lost in loss record 438 of 447
==32761== at 0x402641D: operator new(unsigned int) (vg_replace_
==32761== by 0x4048108: zorba::
==32761== by 0x403F2D6: zorba::
==32761== by 0x403E1CD: zorba::
==32761== by 0x403E88A: zorba::
==32761== by 0x403E0B8: zorba::
==32761== by 0x403E009: zorba::
==32761== by 0x404A904: zorba::
==32761== by 0x404AD88: zorba::
==32761== by 0x4D8D4FD: zorba::
==32761== by 0x4D952DE: zorba::
==32761== by 0x4D179E6: zorba::
==32761==
==32761== LEAK SUMMARY:
==32761== definitely lost: 180 bytes in 1 blocks
==32761== indirectly lost: 525 bytes in 1 blocks
==32761== possibly lost: 0 bytes in 0 blocks
==32761== still reachable: 35,076 bytes in 2,406 blocks
==32761== suppressed: 0 bytes in 0 blocks
==32761== Reachable blocks (those to which a pointer was found) are not shown.
==32761== To see them, rerun with: --leak-check=full --show-