Pb with Gtk 1.2 and gcc for Solaris 2.6



Hi,

I 've installed Gtk-1.2 source and compiled it with gcc
(version egcs-2.93.02) on my Sun sparc Solaris 2.6.
But every program using gtklabel.o is giving me a core dump !

For example, with the simple helloworld example, gdb says:

============================GDB==================================
(gdb) run
Starting program: helloworld

Program received signal SIGSEGV, Segmentation fault.
0xef642d68 in gtk_label_expose (widget=0x4efa0, event=0xefffea5a) at
gtk+/gtk+-1.2.0/gtk/gtklabel.c:966
966           x = floor (widget->allocation.x + (gint)misc->xpad

(gdb) info proc all

Information for /proc/13415.1:

Process status flags:           

        PR_STOPPED       Process is stopped.
        PR_ISTOP         Stopped on an event of interest.
        PR_RLC           Run-on-last-close is in effect.
        PR_ASYNC         Asynchronous stop is in effect.

Reason for stopping:            

        PR_FAULTED       Incurred a traced hardware fault.
        FLTBOUNDS        Memory bounds violation.

PC: 0xef642d68 <gtk_label_expose+648>
Additional signal/fault info:   

        SIGSEGV (11)     Segmentation Fault.
        SEGV_MAPERR      Address not mapped to object.
        0x2928           Address of faulting memory reference.

===========================END GDB===================================


the code of gtklabel.c where it segfaults is the following one:

966       x = floor (widget->allocation.x + (gint)misc->xpad
967                  + (((gint)widget->allocation.width - 
968                     (gint)label->max_width - 2*(gint)misc->xpad)
969                     * misc->xalign) + 0.5);


It returns a core dump when adding the final 0.5 !!!

The asm code at this point is the following one: 
  0xef642d68 <gtk_label_expose+648>:  ldd  [ %o2 + 0x128 ], %f4   
 
=> SIGSEGV !!!!!!!!                (register %o2=0x2800)
It seems that the pgr is trying to access a bad memory location,
where the value 0.5 is supposed to be stored (?).





When removing this + 0.5 and the one 4 lines below, and recompiling, 
everything works fine!

Did anybody have this pb too ?

Is it a bug from gtk ? gcc ? solaris ?

How to correct these lines of code without changing the  behaviour 
of the function ?

Thanks.

 Quentin.

-- 
==============================================================
Quentin Delamarre -- projet RobotVis -- INRIA Sophia-Antipolis
email: mailto:Quentin.Delamarre@sophia.inria.fr       (France)
URL: http://www.inria.fr/robotvis/personnel/qdelam/
==============================================================



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