Re: Regarding segmentation fault while creating boxes



Hi Nisha,

without the code, this is hard to tell. I would still guess that you have some error in your pointer arithmetic.

Since you report "random" errors, the problem might also be in a completely different area of the code. Writing data outside array boundaries might cause such effects.

There is a nice open source tool called "valgrind" which we are using rather successfully in such situations in my current company. Calling

valgrind <your program>

you will get a lot of information about memory usage and lots of potential problems like uninitialized data, array boundaries etc.

Valgrind also works well with multi-threaded applications.


I have not used it on any gtk application yet, because I have learnt about that tool only recently. Using valgrind on gtkdatabox is one of the big issues on my list of TODOs before releasing the next version.


If valgrind does not lead you to the solution of your problems, I suggest you send the *complete code* of an very minimal example that reproduces the problem. Sniplets or error messages from the system or the debugger are much tougher to analyse (at least for me).

Regards,

Roland

PS: This also applies for the graph color problem and the resize issue.



nisha jain wrote:
Hi All,
I am trying to get multiple boxs using gtkdatabox APIs and then i am attaching with it multiple graphs doing so i am getting unexpected segmentation faults also these are random in nature. I tried checking all my pointer logic and started making from scratch again but i again received the segmentation fault. I finally checked it using gdb debugger after taking core dump and tried to backtrace my code i am attaching the result as follows --
[sbox-CHINOOK_X86: ~/Local_WorkSpace_Nisha/N800_DIR] > gdb N800App core
GNU gdb 6.4.90
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/scratchbox/host_shared/lib/libthread_db.so.1".

*Core was generated by `./N800App'.
Program terminated with signal 11, Segmentation fault.
#0  0x08049cb0 in signal_idle_func (box=0x806e800) at N800App.c:380
380        if (!GTK_IS_DATABOX (box))
(gdb)
*

Please let me know if some one can provide any idea why this is happening? Regards,
Nisha

------------------------------------------------------------------------

_______________________________________________
gtkdatabox-list mailing list
gtkdatabox-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkdatabox-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]