Problem building cflow

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problem building cflow

Louis Bertrand

I'm stumped trying to build cflow, a utility to build a calling
tree from C sources

I get a segmentation fault even with the simplest input files
like hello.c. It looks like it's re-using a freed memory resource.
I'm building with the usual ./configure && make routine.
Tested on 3.9/macppc and 3.8/i386. It works fine on Mac OS X.

ktrace -t cns gives me (last few lines on macppc):
  18238 cflow    CALL  mprotect(0x2578f000,0x1000,0)
  18238 cflow    RET   mprotect 0
  18238 cflow    PSIG  SIGSEGV SIG_DFL code 1 addr=0x2578f000 trapno=2
  18238 cflow    NAMI  "cflow.core"

I can step through the program with gdb, but there's some strangeness
when I print the calling arguments and the parameter variable while in
the called function.

I can find where the SEGV occurs (output.c:39 called from line 414),
but where do I find where that last mprotect() is called from?

Is this happening because of the randomized memory allocation?
Any clues appreciated.