[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PC segmentation fault
From: |
Richard Frith-Macdonald |
Subject: |
Re: PC segmentation fault |
Date: |
Fri, 20 Sep 2013 18:01:05 +0100 |
On 20 Sep 2013, at 17:46, Riccardo Mottola <riccardo.mottola@libero.it> wrote:
> Hi,
>
> while working in PC, I got a segmentation fault. I tried to reproduce it
> within GDB, but I couldn't.
>
> I did a post-mortem check on the core and found this:
>
> Core was generated by `ProjectCenter'.
> Program terminated with signal 11, Segmentation fault.
>
> <...>
>
> #0 0x0fc7c5f6 in codeType (ch=0x8a05b000) at PCParser.m:99
> 99 if ( ((*ch > 0x40) && (*ch < 0x5B)) ||
> (gdb) bt
> #0 0x0fc7c5f6 in codeType (ch=0x8a05b000) at PCParser.m:99
> #1 0x0fc7cc73 in -[PCParser parse] (self=0x7d9c6728, _cmd=0x2fc7b4f8)
> at PCParser.m:162
> #2 0x0fc7c9c4 in -[PCParser classNames] (self=0x7d9c6728, _cmd=0x29788728)
> at PCParser.m:77
> #3 0x0978c988 in -[PCEditor browserItemsForItem:] (self=0x7c03e308,
> _cmd=0x232af690, item=0x8b39db48) at PCEditor.m:539
> #4 0x032c5b3b in -[PCProject(ProjectBrowser) contentAtCategoryPath:] (
> self=0x83a73308, _cmd=0x232c0510, categoryPath=0x8bf0e8e8)
> at PCProject.m:1795
> #5 0x032e1c9f in -[PCProjectBrowser(ProjectBrowserDelegate)
> browser:createRowsForColumn:inMatrix:] (self=0x8a3c6848, _cmd=0x2d9a4d68,
> sender=0x84c10608,
> column=2, matrix=0x7e241c08) at PCProjectBrowser.m:544
> #6 0x0da6ea4d in -[NSBrowser(Private) _performLoadOfColumn:] (
> self=0x84c10608, _cmd=0x2d9a48d8, column=2) at NSBrowser.m:3072
> #7 0x0da6c735 in -[NSBrowser reloadColumn:] (self=0x84c10608,
> _cmd=0x232c0428, column=2) at NSBrowser.m:1082
> #8 0x032e2810 in -[PCProjectBrowser reloadLastColumnAndNotify:] (
> self=0x8a3c6848, _cmd=0x232be670, yn=0 '\0') at PCProjectBrowser.m:337
> #9 0x032e070c in -[PCProjectEditor openEditorForCategoryPath:windowed:] (
> self=0x860dc3c8, _cmd=0x232c0480, categoryPath=0x81ed54a8,
> windowed=Variable "windowed" is not available.
> )
> at PCProjectEditor.m:241
> #10 0x032e3f27 in -[PCProjectBrowser click:] (self=0x8a3c6848,
> ---Type <return> to continue, or q <return> to quit---q
> _cmd=0x232c02b0, Quit
> ) at PCProjectBrowser.m:411
> #11 0x0da40b22 in -[NSApplication sendAction:to:from:] (self=0x7e833888,
> _cmd=0x2d9bde70, aSelector=0x232c02b0, aTarget=0x8a3c6848,
> sender=0x84c10608) at NSApplication.m:2230
> #12 0x0daaba34 in -[NSControl sendAction:to:] (self=0x84c10608,
> _cmd=0x2d9a4aa8, theAction=0x232c02b0, theTarget=0x8a3c6848)
> at NSControl.m:760
> #13 0x0da6b656 in -[NSBrowser sendAction] (self=0x84c10608, _cmd=0x2d9a4ae0)
> at NSBrowser.m:2100
> #14 0x0da6b45f in -[NSBrowser doClick:] (self=0x84c10608, _cmd=0x2d9a4d30,
> sender=0x7e243208) at NSBrowser.m:2182
> #15 0x0da40b22 in -[NSApplication sendAction:to:from:] (self=0x7e833888,
> _cmd=0x2d9bde70, aSelector=0x2d9a4d30, aTarget=0x84c10608,
> sender=0x7e243208) at NSApplication.m:2230
> #16 0x0daaba34 in -[NSControl sendAction:to:] (self=0x7e243208,
> _cmd=0x2d9e8188, theAction=0x2d9a4d30, theTarget=0x84c10608)
> at NSControl.m:760
> #17 0x0db07c17 in -[NSMatrix sendAction:to:] (self=0x7e243208,
> _cmd=0x2d9e8188, theAction=0x0, theTarget=0x0) at NSMatrix.m:2170
> #18 0x0db07d0a in -[NSMatrix sendAction] (self=0x7e243208, _cmd=0x2d9e8120)
> at NSMatrix.m:2146
> #19 0x0db0a5e0 in -[NSMatrix _mouseDownListMode:] (self=0x7e243208,
> _cmd=0x2d9e82e8, theEvent=0x7e940b88) at NSMatrix.m:2486
>
> the "ch" is:
> (gdb) p ch
> $1 = (unichar *) 0x8a05b000
>
>
> but how can I get a segmentation fault in the line shown in #0 ? it is only a
> comparison and the char value is apparently valid, I see no array access or
> other pointer usage.
The variable ch *is* a pointer and the code is dereferencing it.
That could be a problem if 0x8a05b000 is not actually in your processes address
space.
It could also be a problem if you were on a processor which is fussy about
alignment and the pointer was not to an aligned 16bit character (this isn't the
case here of course).