Project

General

Profile

Bug #648

QBGenerator crashes

Added by John Abbott over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Maths Bugs
Start date:
10 Nov 2014
Due date:
% Done:

100%

Estimated time:
4.00 h
Spent time:

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

Related to CoCoALib - Bug #232: No test for QBGeneratorNew2012-09-24

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).

Here's what I did to track down the bug (fairly obvious in retrospect):
  • compile with --threadsafe-hack which disables all MemPool allocators
  • run inside valgrind, and look carefully through the output (there was a message about an invalid write of size 4, but note that valgrind 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

Also available in: Atom PDF