Re: Regarding segmentation fault while creating boxes



Hi Nisha,

I am not sure if I understand your intention correctly.

If you want to modify the size on the screen, you need to consult the gtk documentation. There are functions like gtk_widget_set_size_request.

If you want to change the scales within the gtkdatabox, you could use
gtk_databox_set_total_limits.


Regards,

Roland



nisha jain wrote:
Hi Ronald,
Thanks alot for information and you were absolutely correct it was problem with poiters only. I was not able to catch as there were two segmentation faults which were comming in different sequence. I resolved the problem using gdb debugger. I have now left with only one problem. I am reading and trying to find out how to decrease size of data box which i am not able to identify... I am looking at the gtkdatabox.c file and trying to identify the API to use to decrease the size of data boxes horizontally. I have this very basic requirement i don't have to do it again and again only once while creating but there are nothing like coordinates for box to specify.

Please let me know if you can provide some valuable information.
Thanks and Regards,
Nisha
On 4/6/08, *Roland Bock* <box2OO6 eudoxos de <mailto:box2OO6 eudoxos de>> wrote:

    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
    (valgrind and/or code for the former, code for the latter).



    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 <mailto:gtkdatabox-list gnome org>
     > http://mail.gnome.org/mailman/listinfo/gtkdatabox-list

    _______________________________________________
    gtkdatabox-list mailing list
    gtkdatabox-list gnome org <mailto: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]