mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-23 07:08:30 +00:00
another bug description
git-svn-id: svn+q:///qpdf/trunk@974 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
parent
7559934b02
commit
909d1d5602
44
TODO
44
TODO
@ -1,3 +1,47 @@
|
||||
Bug
|
||||
===
|
||||
|
||||
* There is a memory leak that happens whenever object A refers to
|
||||
object B which refers back to object A. We have the following
|
||||
pattern:
|
||||
|
||||
#include "PointerHolder.hh"
|
||||
|
||||
class A
|
||||
{
|
||||
public:
|
||||
PointerHolder<A> a;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
A a1;
|
||||
a1.a = new A();
|
||||
a1.a.getPointer()->a = new A();
|
||||
a1.a.getPointer()->a.getPointer()->a = a1.a;
|
||||
return 0;
|
||||
}
|
||||
|
||||
In order to fix this, we have to explicitly break circular
|
||||
references, but we have to do this at a time that doesn't
|
||||
completely destroy performance.
|
||||
|
||||
To debug, configure with
|
||||
|
||||
./configure --disable-shared --disable-test-compare-images \
|
||||
CFLAGS=-g CXXFLAGS=-g
|
||||
|
||||
Current code causes test failures. linearize segfaults on
|
||||
hybrid-xref.pdf, and the test suite fails in various places. Maybe
|
||||
because we don't do any kind of loop detection?
|
||||
|
||||
Use valgrind --leak-check=full to see leak details.
|
||||
|
||||
The file memory-leak.pdf is a minimal case that shows the problem.
|
||||
|
||||
Files in trace having tracing to show which objects haven't been
|
||||
allocated.
|
||||
|
||||
Next
|
||||
====
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user