How to get more info about 'bad_function_call' ?

Linda A. Walsh gcc@tlinx.org
Tue Jan 27 15:08:00 GMT 2015


I have prog that terminates:
terminate called after throwing an instance of 'std::bad_function_call'
  what():  bad_function_call
Aborted (core dumped).

on about the 8th call using it.  If it was a simple indirect function 
pointer,
I could, *possibly*, check to see if it was Null before the call or had an
address outside of my program area, but it's not, and trying to coerce 
it into
something to check hasn't been straightforward.

I am compiling with CFLAGS=-g3 -ggdb -Og -fstack-protector-all 
-D_GLIBCXX_DEBUG
CXXflags=$(CFLAGS) -std=c++11  -fno-rtti
and
LDFLAGS = -Og -ggdb
---
which are all the debug and range check flags I'm aware of.

Additionally have run it through valgrind with
full options and it doesn't seem to showup any
memory corruptions or overwrites that google
doesn't explain away...
(mostly unfree'd memory at program conclusion).

How can I check the validity of what I am about to call and find
out what is wrong with it before I make the call and am terminated?

Is there any debug information I'm missing?
tracing in gdb at that point shows a check of some
function against 0 (said it might be an inline function
as I couldn't print its value), and then the call to bad function.

As a library user and not a library-internals expert -- what
steps can a user take at this point to figure out what is going on?

Any hints would really be appreciated.

Thanks...
Linda Walsh



More information about the Libstdc++ mailing list