Hi All,

I'm getting a segmentation fault that I simply cannot understand. I run gdb and get the following message:


Program received signal SIGSEGV, Segmentation fault.
0x00000000004a91a5 in BDD::BandB (this=0x7ffffffe4e60, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:550
550 void BDD::BandB(set<int > fixedVars , bool valuesOfFixedVars[numberOfVariables] , int COSTS[numberOfVariables], int LB, int* UB, int Width){

I cannot understand what this means or how to go about fixing it. I'd appreciate any help at all. I just don't know how to interpret this.

I also used bt:

(gdb) bt
#0 0x00000000004a9155 in BDD::BandB (this=0x7ffffffe4e60, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:555
#1 0x00000000004aa9f8 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:749
#2 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#3 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#4 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#5 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#6 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#7 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#8 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#9 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#10 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#11 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#12 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#13 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#14 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#15 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#16 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#17 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#18 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#19 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#20 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#21 0x00000000004aaa96 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:764
#22 0x00000000004aa9f8 in BDD::BandB (this=<value optimized out>, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at BDD.cpp:749
#23 0x00000000004ab975 in main () at BDD.cpp:2775

THANKS SO MUCH FOR ANY HELP

Usually, a seg fault is the result of overruning the boundaries of an array or another similar container. Double-check all your container access statements to make sure your not accessing a subscript that is larger than (container::size - 1).

The error is a little difficult to understand, but it seems to have something to do with this array "bool valuesOfFixedVars[numberOfVariables]" near line 550 of BDD.cpp. Is there a loop near there that is iterating too many times?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.