Recent

Author Topic: Problems with TMemo -> gtk or lazarus issue?  (Read 6870 times)

andi456

  • New Member
  • *
  • Posts: 18
Problems with TMemo -> gtk or lazarus issue?
« on: April 28, 2005, 10:19:01 pm »
Hi everybody,
while debugging a project containing a memo I received the following message after deleting some text in it using the keyboard:

Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0xb7e57755 in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0


The corresponding backtrace reads:

Code: [Select]
#0  0xb7e57755 in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0
#1  0xb7e57849 in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0
#2  0xb7e577ed in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0
#3  0xb7e52f62 in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0
#4  0xb7dd8ca8 in gtk_editable_set_position () from /usr/lib/libgtk-1.2.so.0
#5  0x0812cf14 in TGTKWSCUSTOMEDIT__SETSELSTART (ACUSTOMEDIT=0xb7bcf4b8, NEWSTART=-1, pvmt=0xb7b8bf34)
    at gtkwsstdctrls.pp:757
#6  0x080dfa7b in TCUSTOMEDIT__SETSELSTART (VAL=-1, this=0xb7bcf4b8) at customedit.inc:113
#7  0x0805e00d in TFORM1__TEXTMARKIEREN (S=0xb7bab53c, this=0xb7bcd668) at lernprog.pas:360
#8  0x08060bd5 in TFORM1__LOESUNGMEMOKEYUP (SENDER=0xb7bcf4b8, KEY=32, SHIFT=Invalid C/C++ type code 10 in symbol table.
) at lernprog.pas:1073
#9  0x080a06a5 in TWINCONTROL__KEYUP (KEY=32, SHIFT=Invalid C/C++ type code 10 in symbol table.
) at wincontrol.inc:2375
#10 0x080e01c5 in TCUSTOMEDIT__KEYUP (KEY=32, SHIFT=Invalid C/C++ type code 10 in symbol table.
) at customedit.inc:318
#11 0x080a0f33 in TWINCONTROL__DOKEYUPBEFOREINTERFACE (MESSAGE=
      {MSG = 48385, CHARCODE = 32, UNUSED = 0, KEYDATA = -1069481983, RESULT = 0}, this=0xb7bcf4b8)
    at wincontrol.inc:2705
#12 0x080a245f in TWINCONTROL__CNKEYUP (MESSAGE=
      {MSG = 48385, CHARCODE = 32, UNUSED = 0, KEYDATA = -1069481983, RESULT = 0}, this=0xb7bcf4b8)
    at wincontrol.inc:3516
#13 0x08131ad7 in SYSTEM_TOBJECT_$__DISPATCH$formal ()
#14 0x080a784c in TCONTROL__WNDPROC (THEMESSAGE=
      {MSG = 48385, WPARAM = 32, LPARAM = -1069481983, RESULT = 0, WPARAMLO = 32, WPARAMHI = 0, LPARAMLO = 1, LPARAMHI= 49217, RESULTLO = 0, RESULTHI = 0}, this=0xb7bcf4b8) at control.inc:1447
#15 0x080a0045 in TWINCONTROL__WNDPROC (MESSAGE=
      {MSG = 48385, WPARAM = 32, LPARAM = -1069481983, RESULT = 0, WPARAMLO = 32, WPARAMHI = 0, LPARAMLO = 1, LPARAMHI= 49217, RESULTLO = 0, RESULTHI = 0}, this=0xb7bcf4b8) at wincontrol.inc:2154
#16 0x08100ba1 in DELIVERMESSAGE (TARGET=0xb7bcf4b8, AMESSAGE=void) at gtkproc.inc:3242
#17 0x080feb80 in HANDLEGTKKEYUPDOWN (WIDGET=0x822e2a0, EVENT=0x824dc60, DATA=0xb7bcd668, BEFOREEVENT=true)
    at gtkproc.inc:2142
#18 0x08108aee in GTKKEYUPDOWN (WIDGET=0x822e2a0, EVENT=0x824dc60, DATA=0xb7bcd668) at gtkcallback.inc:529
#19 0xb7e09dbe in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
#20 0xb7e3d947 in gtk_signal_remove_emission_hook () from /usr/lib/libgtk-1.2.so.0
#21 0xb7e3cdba in gtk_signal_set_funcs () from /usr/lib/libgtk-1.2.so.0
#22 0xbfffebe0 in ?? ()
#23 0x0822e2a0 in ?? ()
#24 0xbfffec50 in ?? ()
#25 0x00000000 in ?? ()
#26 0x08233b14 in ?? ()
#27 0x00000001 in ?? ()
#28 0xbfffebdc in ?? ()
#29 0xb7e09dbe in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
Previous frame inner to this frame (corrupt stack?)


I'm not sure whether it is a problem/ bug in gtk+1.2 or in lazarus. My source code did work in Delphi where I converted the project from. I'm using lazarus 0.9.6 with fpc 1.9.8, gtk+-1.2.10.

Maybe someone has experienced similar problems and can give me some hint.

Thanks in advance.

Andreas

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2697
Problems with TMemo -> gtk or lazarus issue?
« Reply #1 on: May 02, 2005, 07:30:35 pm »
Wow, nice backtrace. It looks like it is a gtk bug.
I've added a check, so in current CVS it should be fixed
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

andi456

  • New Member
  • *
  • Posts: 18
Problems with TMemo -> gtk or lazarus issue?
« Reply #2 on: May 23, 2005, 05:25:31 pm »
Thanks,
I haven't checked the forum for quite some time and I'll try the latest CVS to find out, if it's fixed.

Andreas

andi456

  • New Member
  • *
  • Posts: 18
Problems with TMemo -> gtk or lazarus issue?
« Reply #3 on: June 15, 2005, 12:39:21 pm »
Well the problem still exists. By the way has there been any progress concerning the functionality of gtk2?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2697
Problems with TMemo -> gtk or lazarus issue?
« Reply #4 on: June 15, 2005, 01:47:03 pm »
Same backtrace or different ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

andi456

  • New Member
  • *
  • Posts: 18
Problems with TMemo -> gtk or lazarus issue?
« Reply #5 on: June 16, 2005, 10:30:29 am »
The backtrace is slightly different:

Code: [Select]
#0  0xb7e56755 in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0
#1  0xb7e56849 in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0
#2  0xb7e567ed in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0
#3  0xb7e51f62 in gtk_text_forward_delete () from /usr/lib/libgtk-1.2.so.0
#4  0xb7dd7ca8 in gtk_editable_set_position () from /usr/lib/libgtk-1.2.so.0
#5  0x08135bf8 in TGTKWSCUSTOMEDIT__SETSELSTART (ACUSTOMEDIT=0xb7bce4b8, NEWSTART=-1, pvmt=0xb7b8af34)
    at gtkwsstdctrls.pp:766
#6  0x080e3d92 in TCUSTOMEDIT__SETSELSTART (VAL=-1, this=0xb7bce4b8) at customedit.inc:114
#7  0x0805eadd in TFORM1__TEXTMARKIEREN (S=0xb7baa7fc, this=0xb7bcc668) at lernprog.pas:360
#8  0x080618a7 in TFORM1__LOESUNGMEMOKEYUP (SENDER=0xb7bce4b8, KEY=32, SHIFT=Invalid C/C++ type code 10 in symbol table.
) at lernprog.pas:1086
#9  0x080a1a69 in TWINCONTROL__KEYUP (KEY=32, SHIFT=Invalid C/C++ type code 10 in symbol table.
) at wincontrol.inc:2356
#10 0x080e4519 in TCUSTOMEDIT__KEYUP (KEY=32, SHIFT=Invalid C/C++ type code 10 in symbol table.
) at customedit.inc:325
#11 0x080a22f7 in TWINCONTROL__DOKEYUPBEFOREINTERFACE (MESSAGE=
      {MSG = 48385, CHARCODE = 32, UNUSED = 0, KEYDATA = -1069481983, RESULT = 0}, this=0xb7bce4b8)
    at wincontrol.inc:2686
#12 0x080a3853 in TWINCONTROL__CNKEYUP (MESSAGE=
      {MSG = 48385, CHARCODE = 32, UNUSED = 0, KEYDATA = -1069481983, RESULT = 0}, this=0xb7bce4b8)
    at wincontrol.inc:3489
#13 0x0813a937 in SYSTEM_TOBJECT_$__DISPATCH$formal ()
#14 0x080a8fae in TCONTROL__WNDPROC (THEMESSAGE=
      {MSG = 48385, WPARAM = 32, LPARAM = -1069481983, RESULT = 0, WPARAMLO = 32, WPARAMHI = 0, LPARAMLO = 1, LPARAMHI = 49217, RESULTLO = 0, RESULTHI = 0}, this=0xb7bce4b8) at control.inc:1481
#15 0x080a13f9 in TWINCONTROL__WNDPROC (MESSAGE=
      {MSG = 48385, WPARAM = 32, LPARAM = -1069481983, RESULT = 0, WPARAMLO = 32, WPARAMHI = 0, LPARAMLO = 1, LPARAMHI = 49217, RESULTLO = 0, RESULTHI = 0}, this=0xb7bce4b8) at wincontrol.inc:2135
#16 0x08106025 in DELIVERMESSAGE (TARGET=0xb7bce4b8, AMESSAGE=void) at gtkproc.inc:3366
#17 0x08103ac2 in HANDLEGTKKEYUPDOWN (WIDGET=0x823fe20, EVENT=0x825f770, DATA=0xb7bcc668, BEFOREEVENT=true)
    at gtkproc.inc:2205
#18 0x0810e022 in GTKKEYUPDOWN (WIDGET=0x823fe20, EVENT=0x825f770, DATA=0xb7bcc668) at gtkcallback.inc:536
#19 0xb7e08dbe in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
#20 0xb7e3c947 in gtk_signal_remove_emission_hook () from /usr/lib/libgtk-1.2.so.0
#21 0xb7e3bdba in gtk_signal_set_funcs () from /usr/lib/libgtk-1.2.so.0
#22 0xbfffea7c in ?? ()
#23 0x0823fe20 in ?? ()
#24 0xbfffeaec in ?? ()
#25 0x00000000 in ?? ()
#26 0xbfffeaf4 in ?? ()
#27 0x00000001 in ?? ()
#28 0x00000001 in ?? ()
#29 0xbfffea7c in ?? ()
#30 0xb7eadac8 in _gtk_private_n_signals () from /usr/lib/libgtk-1.2.so.0
#31 0x08239ca8 in ?? ()
#32 0xb7e7e8a0 in gtk_window_set_default_size () from /usr/lib/libgtk-1.2.so.0
Previous frame inner to this frame (corrupt stack?)


Btw. I'm using yesterday's cvs-version of lazarus, compiled with fpc-2.0.0 and fpc-2.0.0-sources installed. The problem occurs, because I make use of the SelStart and SelLength methods in combination with pos(), but I didn't take care of what happens, if pos returns 0, which causes the program to show the behaviour I reported. With Delphi this was no problem.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2697
Problems with TMemo -> gtk or lazarus issue?
« Reply #6 on: June 16, 2005, 11:21:03 am »
the TGTKWSCUSTOMEDIT__SETSELSTART should handle invalid values and afair I added such check
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018