discuss-gnustep
[Top][All Lists]
Advanced

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

Re: CodeEditor


From: Richard Frith-Macdonald
Subject: Re: CodeEditor
Date: Thu, 25 Feb 2010 04:36:02 +0000

On 24 Feb 2010, at 22:45, Fred Kiefer wrote:

> Am 24.02.2010 18:09, schrieb J. Jordan:
>> Does anyone know of any patches for CodeEditor that might prevent it
>> from crashing as soon as you type a letter into a new document?  I filed
>> a bug report and tried to email the developer but have not gotten any
>> response.  I have seen this bug talked about on the web but no solution
>> was offered.
>> 
>> debugapp shows:
>> 
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00007ffff7896231 in -[NSLayoutManager(layout)
>> _insertionPointRectForCharacterIndex:textContainer:] (self=0xc64280,
>> _cmd=0x7ffff7d014d0, cindex=1,
>>    textContainer=0x7fffffffcfec) at NSLayoutManager.m:846
>> 846         for (j = 0, lp = lf->points; j < lf->num_points; j++, lp++)
>> 
>> consistently when it crashes.
>> 
>> I would really like to use this while I am learning C, project center
>> does not have line numbers and is really cantankerous about saving files.
> 
> This is clearly a bug in NSLayoutManager. We are accessing a variable
> that hasn't been set. I will investigate this and try to fix it. But it
> may take some time and will require that you follow SVN.

I'm not so sure ... when I got the latest (2004) code and built it, I got a 
crash in _insertionPointRectForCharacterIndex:textContainer: because it was 
trying to do r = lf->used_rect when lf was 0.  The obvious fix in the context 
of an empty document was 'r = (lf == 0) ? NSZeroRect : lf->used_rect; so I 
tried that.

Then I got an unresponsive application (I pressed keys and nothing happened), 
which confused me for a bit until I realised that the application main loop was 
catching and hiding exceptions ... and it turned out that:

CEViewTypesetter was sending a _generateGlyphsForRun:at: message to 
CEViewLayoutManager
CEViewLayoutManager was then sending _generateGlyphsForRun:at: to it's 
superclass (NSLayoutManager)
and NSLayoutManager doesn't implement that method, so it raised an exception.

I think the trouble here is that the code is using private methods (and 
internal data structures) of GSLayoutManager rather than keeping to the public 
API, and the way the internals of the text system works has changed over the 
(several) years since the application was written and last maintained.

So it's not sufficient to fix a bug in NSLayout manager (indeed I'm not 
completely certain the crash in NSLayoutManager can happen if you stick to the 
public API) ... someone needs to have the time to look at CodeEditor and fix 
issues there.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]