discuss-gnustep
[Top][All Lists]
Advanced

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

Re: ProjectCenter Editor parenthesis highlighting segfault


From: address@hidden
Subject: Re: ProjectCenter Editor parenthesis highlighting segfault
Date: Sun, 31 Aug 2014 20:55:20 +0200

Hi,
 
>>Hi,
 
>>Ivan Vučica wrote:
>
> Hopefully you'll read Raymond Chen's blogpost I previously quoted as
> well, to see why your bug report against GCC may get rejected.
>
> This was an outright bug in PC code, and a violation of C standards,
> which let the compiler make some wild assumptions. It would be nice if
> a warning was generated, too. However, a compiler bug, this probably
> was not.
>
 
>>read here:
>>http://stackoverflow.com/questions/24296571/why-does-this-loop-produce-warning-iteration-3u-invokes-undefined-behavior-an
 
>>well, you could
>>1) compile without optimizations and see if the code works (or at least
>>"does not work in an expected way")
 
 
 
using debug=yes the old code works without crashing
 
 
 
>>2) reading the example posted above, we see gcc producing a warning , it
>> would be nice to get one too
 
 
whith messages=yes and -O2 I couldn't see any warnings during compilation
 
 
 
>>the code was buggy, now it is better. Though, again, at a first glance
>>the "-1" condition should always have caught, I fear we have here one
>>bug showing another...
 
>>So I ask
>>1) without optimizations, does it work for you (as it used to work for
>>us and continues to work)
>>2) with the fix and with optimiziation, do parentheses actually
>>highligh/unhighlight (both of them). Try () [] and {}. Try checking that
>>with parentheses close together, but also with some far-apart, like {}
>>of a block several lines apart
 
>>Riccardo
 
1) see above
2) it works in the same way with optimizations and the new revision
 
The old code and the new code work with highlighting but have antother
 
issue in common
 
when i do the following:
 
moving the cursor right before an opening parenthesis at the beginning of a 
line.
 
Pressing newline (3 times in following example) so that there is inserted at 
least one blank line above
 
Backspace pressing then leads to a freeze of ProjectCenter with the following 
output:

 
 
2014-08-31 20:36:56.307 ProjectCenter[3779] Build tool found: (null)
2014-08-31 20:36:56.827 ProjectCenter[3779] NSDocumentClass PCProjectDocument 
not found
2014-08-31 20:36:56.827 ProjectCenter[3779] NSDocumentClass PCProjectDocument 
not found
2014-08-31 20:36:56.827 ProjectCenter[3779] NSDocumentClass PCClassDocument not 
found
2014-08-31 20:36:56.827 ProjectCenter[3779] NSDocumentClass PCHeaderDocument 
not found
2014-08-31 20:36:56.828 ProjectCenter[3779] NSDocumentClass PCCDocument not 
found
2014-08-31 20:37:03.680 ProjectCenter[3779] [click] category: Classes 
forProject: TestPCColors fileName: (null)
2014-08-31 20:37:04.918 ProjectCenter[3779] [click] category: Classes 
forProject: TestPCColors fileName: AppController.m
2014-08-31 20:37:04.918 ProjectCenter[3779] [click] category: Classes filePath: 
/Classes/AppController.m/
2014-08-31 20:37:04.918 ProjectCenter[3779] Opening new editor. Editor: 
ProjectCenter
2014-08-31 20:37:04.929 ProjectCenter[3779] PCProjectEditor editorDidOpen!
2014-08-31 20:37:05.069 ProjectCenter[3779] PCPE: categoryPath - 
/Classes/AppController.m/
2014-08-31 20:37:05.069 ProjectCenter[3779] PCEditor: asked for browser items 
for: AppController.m
2014-08-31 20:37:05.069 ProjectCenter[3779] Class> {ClassBodyRange = 
"{location=193, length=988}"; ClassName = "@AppController"; ClassNameRange = 
"{location=179, length=13}"; }
2014-08-31 20:37:05.382 ProjectCenter[3779] ClassHandler: dealloc
2014-08-31 20:37:13.014 ProjectCenter[3779] ---i:0---
2014-08-31 20:37:13.014 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:671
2014-08-31 20:37:13.014 ProjectCenter[3779] ---i:1---
2014-08-31 20:37:13.014 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:691
2014-08-31 20:37:13.592 ProjectCenter[3779] ---i:0---
2014-08-31 20:37:13.592 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:6722014-08-31 20:36:56.307 
ProjectCenter[3779] final candidate path is: /usr/lib/GNUstep/Developer/bin/make
2014-08-31 20:37:13.592 ProjectCenter[3779] ---i:1---
2014-08-31 20:37:13.592 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:692
2014-08-31 20:37:14.449 ProjectCenter[3779] ---i:0---
2014-08-31 20:37:14.449 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:673
2014-08-31 20:37:14.449 ProjectCenter[3779] ---i:1---
2014-08-31 20:37:14.449 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:693
2014-08-31 20:37:14.963 ProjectCenter[3779] ---i:0---
2014-08-31 20:37:14.963 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:674
2014-08-31 20:37:14.963 ProjectCenter[3779] ---i:1---
2014-08-31 20:37:14.963 ProjectC2014-08-31 20:36:56.307 ProjectCenter[3779] 
final candidate path is: /usr/lib/GNUstep/Developer/bin/makeenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:694
2014-08-31 20:37:14.964 ProjectCenter[3779] GSHorizontalTypesetter - 
-[GSLayoutManager(glyphs) characterIndexForGlyphAtIndex:] glyph index out of 
range
2014-08-31 20:37:14.964 ProjectCenter[3779] GSHorizontalTypesetter - 
-[GSLayoutManager(glyphs) characterRangeForGlyphRange:actualGlyphRange:] glyph 
range out of range
2014-08-31 20:37:15.406 ProjectCenter[3779] GSHorizontalTypesetter - 
-[GSLayoutManager(glyphs) characterRangeForGlyphRange:actualGlyphRange:] glyph 
range out of range
2014-08-31 20:37:15.406 ProjectCenter[3779] *** NSTimer ignoring exception 
'NSRangeException' (reason '-[GSLayoutManager(glyphs) 
characterRangeForGlyphRange:actualGlyphRange:] glyph range out of range') 
raised during posting of timer with target 0x8c37660 and selector '_blink:'
2014-08-31 20:37:15.906 ProjectCenter[3779] GSHorizontalTypesetter - 
-[GSLayoutManager(glyphs) characterRangeForGlyphRange:actualGlyphRange:] glyph 
range out of range
2014-08-31 20:37:15.906 ProjectCenter[3779] *** NSTimer ignoring exception 
'NSRangeException' (reason '-[GSLayoutManager(glyphs) 
characterRangeForGlyphRange:actualGlyphRange:] glyph range out of range') 
raised during posting of timer with target 0x8c37660 and selector '_blink:'
2014-08-31 20:37:17.059 ProjectCenter[3779] ---i:0---
2014-08-31 20:37:17.059 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:672
2014-08-31 20:37:17.059 ProjectCenter[3779] ---i:1---
2014-08-31 20:37:17.059 ProjectCenter[3779] 
--addAttr:NSFontAttributeName--value:<NSFont: 0x8c28118> FreeMono 12.000 0.000 
0.000 12.000 0.000 0.000 P 6--range:692
2014-08-31 20:37:20.886 ProjectCenter[3779] PCEditor: asked for browser items 
for: AppController.m
2014-08-31 20:37:20.886 ProjectCenter[3779] Class> {ClassBodyRange = 
"{location=193, length=989}"; ClassName = "@AppController"; ClassNameRange = 
"{location=179, length=13}"; }
 

 
I've put another NSLog in the method 
 
 
- (void)unhighlightCharacter: (NSTextView *)editorView
 
...
 
if (previousFont != nil)
 {
 NSLog(@"--addAttr:%@--value:%@--range:%i",NSFontAttributeName,previousFont,r);
 [textStorage addAttribute:NSFontAttributeName
 value:previousFont
 range:r];
 }
 
...

 Markus
 
 








reply via email to

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