[TextEditor_mcc] Re: An example for the crash with hidden object

  • From: Ilkka Lehtoranta <ilkleht@xxxxxxxxxxx>
  • To: texteditor_mcc@xxxxxxxxxxxxx
  • Date: Tue, 2 Aug 2005 15:19:21 +0300 (EEST)

On Thu, 21 Jul 2005, Mathias PARNAUDEAU wrote:

> Hi,
> Sorry to be late, I was off for more than a week ... But I just wrote a
> small example to localize the problem. If the texteditor object is in a
> hidden page of a register group, the program freezes if you insert text. It
> works if you clear the text for example.
> I use MorphOS and compiled it with :
> gcc -noixemul -o testtexteditor testtexteditor.c
> I don't know if this special case will frequently happen but that seems to
> be a bug :-/

Okay. There seem to be nasty bug (or bugs?) in TextEditor.mcc. 

In InsertText method function call chain is following:

Dispatcher.c:546:Entering _Dispatcher
 Methods.c:344:Entering InsertText
  ImportText.c:39:Entering ImportText
   AllocFunctions.c:31:Entering MyAllocPooled
   AllocFunctions.c:40:Leaving MyAllocPooled (result 0x2046a2dc, 541500124)
  ImportText.c:114:Leaving ImportText (result 0x2046a2b0, 541500080)
  MixedFunctions.c:240:Entering VisualHeight
   MixedFunctions.c:191:Entering LineCharsWidth

But LineCharsWidth() doesnt work properly because data->rport is NULL 
(because object is not visible). As a consequence LineCharsWidth() always 
returns 0 and VisualHeight loops forever.

LineCharsWidth() is called from many other functions too and I'm not sure 
if all methods work properly when editor object is not visible...

I'm going to alter VisualHeight() function so it no longer calls 
LineCharsWidth() when data->rport is NULL but it is not proper fix.
There could be many other similar cases.

As a bonus I fixed debug output in MorphOS compile :)

TextEditor ML   - http://www.freelists.org/list/texteditor_mcc
Listserver help - mailto:texteditor_mcc-request@xxxxxxxxxxxxx?Subject=HELP
Bugtracker......: http://sourceforge.net/tracker/?atid=731469&group_id=135025

Other related posts: