|
From: Ethan M. <merritt@u.washington.edu> - 2008-03-04 00:45:11
|
On Monday 03 March 2008 16:30, Mojca Miklavec wrote: > > A minimal example includes downloading this code: > http://cheminfo.informatics.indiana.edu/~rguha/code/cc++/gnuplot_i++.tgz > (from http://jijo.cjb.net/) > and unzipping, making it and running an example > > > cd gnuplot_i++ > /tmp/gnuplot_i++> make > g++ -c -ggdb -DDEBUGGA example.cc > g++ -c -ggdb -DDEBUGGA gnuplot_i.cc > g++ -o example -ggdb example.o gnuplot_i.o -lstdc++ > /tmp/gnuplot_i++> ./example I may be missing something, but what makes you think this fault involves gnuplot? It's the example.cc program that is faulting, isn't it? > *** example of gnuplot control through C++ *** > > Segmentation fault > > ------ > > If I run gdb, then I get a problem in fputs reported: > > Program received signal EXC_BAD_ACCESS, Could not access memory. > Reason: KERN_INVALID_ADDRESS at address: 0x2f706dac > 0x9002990c in fputs () That's not nearly enough information. Do one or both of the following: 1) Make sure the program is compiled with the -g option Run under gdb as before When is faults, type "where" and inspect the resulting call chain 2) Run the program under valgrind: valgrind --tool=memcheck --leak-check=yes --num-callers=20 --leak-resolution=med --log-file=valgrind your-normal-command-line-goes-here and inspect the resulting valgrind log file -- Ethan A Merritt |