Bug #648
QBGenerator crashes
Description
I have a program which causes QBGenerator
to produce a SEGV.
Even just printing the QBGenerator
causes a SEGV:
QBG=QBGenerator(QB=[1, x[2], x[1], x[2]^2, x[1]*x[2], x[1]^2, x[2]^3, x[1]*x[2]^2, x[1]^2*x[2]], corners=[x[1]^3, x[2]^4 Process cocoa5 segmentation fault
Related issues
History
#1 Updated by John Abbott over 9 years ago
Trying to find a simple program which produces the bug; first attempts failed.
Also trying valgrind
.
#2 Updated by John Abbott over 9 years ago
Still not tracked down the bug :-(
The bug vanishes when I use valgrind
-- how can that be?
The bug persists after make veryclean; make
(which is Good News, I suppose).
I'll try with MemPoolDebug
, and perhaps also disabling MemPool
altogether.
#3 Updated by John Abbott over 9 years ago
- % Done changed from 0 to 10
The bug did not show up on a (32-bit) Linux VM; nor on a 32-bit Linux netbook.
The bug does not arise when compiled with --threadsafe-hack
(which disables MemPool
).
So maybe it is a MemPool
problem?
#4 Updated by John Abbott over 9 years ago
- Status changed from New to Resolved
- % Done changed from 10 to 60
I think I may have solved the issue: my code wrote one place beyond the end of a vector (and presumably this overwrote something inside the QBGenerator
).
- compile with
--threadsafe-hack
which disables allMemPool
allocators - run inside
valgrind
, and look carefully through the output (there was a message about an invalid write of size 4, but note thatvalgrind
lets execution continue!)
Actually locating the line which triggered the bad write was rather ad hoc; I had hoped for more help from valgrind
here.
If you do not have valgrind
, you can try relinking with debug_new.o
(it is inside src/AlgebraicCore
). An easy way to do this is to make
your executable again; copy the compilation line which make
prints out, an append src/AlgebraicCore/debug_new.o
to the end of the line; then execute the resulting command.
Marking as closed.
#5 Updated by John Abbott over 9 years ago
- Status changed from Resolved to Closed
- % Done changed from 60 to 100