Mitchel Humpherys | 5 Apr 17:58 2011
Picon

semantic cache errors (invalid escape character syntax)

Hi,

I've been trying out cedet and have been really impressed with its
capabilities with the small toy projects I've tried it out on. However,
I'm now trying to use it with a larger project at work and have been
experiencing really poor performance with the semantic db. It seems like
it never "remembers" things it has already parsed (I have to re-parse
includes each time I open emacs), which makes it a bit sluggish. I've
been getting the following error in my mini-buffer/*Messages* :

Cache Error:
[/home/mgalgs/.semanticdb/!media!sf_mee!mh_NCWPLUS_stuffdev!<etc..etc>!ArowAcknowledgementManager!semantic.cache]
(error Invalid escape character syntax), Restart [2 times]
Cache Error:
[/home/mgalgs/.semanticdb/!media!sf_mee!mh_NCWPLUS_stuffdev!<etc..etc>!Components!Utility!TimerCallback!semantic.cache]
(error Invalid escape character syntax), Restart

Note: I replaced some of the path name with <etc..etc> to mask sensitive
company information (yes, even path names are sensitive around
here :) ). It's just more of the same '!' delimited directory names (no
spaces or anything funky like that).

Any ideas what's going on? I don't think the problem is in cedet, since
that error message together with cedet barely even make it in to a
google search[1], yet it seems like a fairly common emacs error
message[2]...

Emacs version: 23.3.1
           OS: Arch Linux
Cedet version: [3]
(Continue reading)

David Engster | 5 Apr 18:47 2011
Picon

Re: semantic cache errors (invalid escape character syntax)

Mitchel Humpherys writes:
> I've been trying out cedet and have been really impressed with its
> capabilities with the small toy projects I've tried it out on. However,
> I'm now trying to use it with a larger project at work and have been
> experiencing really poor performance with the semantic db. It seems like
> it never "remembers" things it has already parsed (I have to re-parse
> includes each time I open emacs), which makes it a bit sluggish. I've
> been getting the following error in my mini-buffer/*Messages* :
>
> Cache Error:
[/home/mgalgs/.semanticdb/!media!sf_mee!mh_NCWPLUS_stuffdev!<etc..etc>!ArowAcknowledgementManager!semantic.cache]
(error Invalid escape character syntax), Restart [2 times]
> Cache Error:
[/home/mgalgs/.semanticdb/!media!sf_mee!mh_NCWPLUS_stuffdev!<etc..etc>!Components!Utility!TimerCallback!semantic.cache]
(error Invalid escape character syntax), Restart

It seems like the cache files cannot be loaded because of some invalid
escapes. Since you probably cannot provide those cache files, I'm afraid
you'll have to look into those files and search for somewhat 'weird'
characters. I'm not sure why this is happening; maybe some coding-system
problems.

> Note: I replaced some of the path name with <etc..etc> to mask sensitive
> company information (yes, even path names are sensitive around
> here :) ). It's just more of the same '!' delimited directory names (no
> spaces or anything funky like that).

I don't think it's the path. It's probably in the files itself.

> Any ideas what's going on? I don't think the problem is in cedet, since
(Continue reading)

Mitchel Humpherys | 5 Apr 20:37 2011
Picon

Re: semantic cache errors (invalid escape character syntax)

Okay, I think I'm on to something...

I'm now on the development version, but after clearing out my cache and
trying everything again I was still getting the same cache errors. So I
started poking through one of the cache files and noticed that there
were a bunch of unescaped backslashes. Our code has a lot of silly
history behind it, so we have #include statements that use backslashes
instead of forward slashes, i.e.

#include "..\..\SomeFile.h"

instead of

#include "../../SomeFile.h"

It looks like semantic was just sucking those up and not escaping them,
but after doing a replace '\'->'\\' on the file I was able to evaluate
the semanticdb-project-database-file statement without the cache error
(I just did a C-x e on the closing paren, which was giving me the
aforementioned "invalid escape syntax" error before the replace, and it
ran without error).

Here's a few lines from my cache:

;; Object ArowAcknowledgementManager/
;; SEMANTICDB Tags save file
(semanticdb-project-database-file "ArowAcknowledgementManager/"
  :tables (list 
   (semanticdb-table "ArowAcknowledgementManager.cpp"
    :major-mode 'c++-mode
(Continue reading)

David Engster | 6 Apr 00:01 2011
Picon

Re: semantic cache errors (invalid escape character syntax)

Mitchel Humpherys writes:
> #include "..\..\SomeFile.h"
>
> instead of
>
> #include "../../SomeFile.h"

> It looks like semantic was just sucking those up and not escaping them,
> but after doing a replace '\'->'\\' on the file I was able to evaluate
> the semanticdb-project-database-file statement without the cache error
> (I just did a C-x e on the closing paren, which was giving me the
> aforementioned "invalid escape syntax" error before the replace, and it
> ran without error).

Thanks for investigating this. Semantic very strictly adheres to the C99
standard, so backslashes in header names lead to undefined
behavior. Consider yourself lucky that it didn't do anything worse. ;-)

(I admit I had to peek in the C99 standard to be sure; see
6.4.7.3). That being said, I think this a bug in the tag writer. I'll
see to it that I fix this.

-David

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
(Continue reading)

Mitchel Humpherys | 6 Apr 05:58 2011
Picon

Re: semantic cache errors (invalid escape character syntax)

Cool! I've mentioned the non-standardness of the backslash to the
powers-that-be. The real fix here is for us to fix our code...

On Tue, Apr 5, 2011 at 3:01 PM, David Engster <deng <at> randomsample.de> wrote:
> Mitchel Humpherys writes:
>> #include "..\..\SomeFile.h"
>>
>> instead of
>>
>> #include "../../SomeFile.h"
>
>> It looks like semantic was just sucking those up and not escaping them,
>> but after doing a replace '\'->'\\' on the file I was able to evaluate
>> the semanticdb-project-database-file statement without the cache error
>> (I just did a C-x e on the closing paren, which was giving me the
>> aforementioned "invalid escape syntax" error before the replace, and it
>> ran without error).
>
> Thanks for investigating this. Semantic very strictly adheres to the C99
> standard, so backslashes in header names lead to undefined
> behavior. Consider yourself lucky that it didn't do anything worse. ;-)
>
> (I admit I had to peek in the C99 standard to be sure; see
> 6.4.7.3). That being said, I think this a bug in the tag writer. I'll
> see to it that I fix this.
>
> -David
>

------------------------------------------------------------------------------
(Continue reading)

David Engster | 6 Apr 20:12 2011
Picon

Re: semantic cache errors (invalid escape character syntax)

David Engster writes:
> Mitchel Humpherys writes:
>> #include "..\..\SomeFile.h"
>>
>> instead of
>
>>
>> #include "../../SomeFile.h"
>
>> It looks like semantic was just sucking those up and not escaping them,
>> but after doing a replace '\'->'\\' on the file I was able to evaluate
>> the semanticdb-project-database-file statement without the cache error
>> (I just did a C-x e on the closing paren, which was giving me the
>> aforementioned "invalid escape syntax" error before the replace, and it
>> ran without error).

[...]

> (I admit I had to peek in the C99 standard to be sure; see
> 6.4.7.3). That being said, I think this a bug in the tag writer. I'll
> see to it that I fix this.

I've now pushed a fix to the bzr repository.

-David

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
(Continue reading)

Eric M. Ludlam | 7 Apr 00:52 2011

Re: semantic cache errors (invalid escape character syntax)

On 04/06/2011 02:12 PM, David Engster wrote:
> David Engster writes:
>> Mitchel Humpherys writes:
>>> #include "..\..\SomeFile.h"
>>>
>>> instead of
>>
>>>
>>> #include "../../SomeFile.h"
>>
>>> It looks like semantic was just sucking those up and not escaping them,
>>> but after doing a replace '\'->'\\' on the file I was able to evaluate
>>> the semanticdb-project-database-file statement without the cache error
>>> (I just did a C-x e on the closing paren, which was giving me the
>>> aforementioned "invalid escape syntax" error before the replace, and it
>>> ran without error).
>
> [...]
>
>> (I admit I had to peek in the C99 standard to be sure; see
>> 6.4.7.3). That being said, I think this a bug in the tag writer. I'll
>> see to it that I fix this.
>
> I've now pushed a fix to the bzr repository.

Thanks David!

Eric

------------------------------------------------------------------------------
(Continue reading)

Mitchel Humpherys | 7 Apr 18:53 2011
Picon

Re: semantic cache errors (invalid escape character syntax)

That last update fixed the items in the :tags list, but there's still
"unescaped" \'s in the semanticdb-table constructor, like:

(semanticdb-table "..\..\Somefile.h"

I don't know if your fix was directed at some other bug and just
happened to fix our silly non-standard includes in the tags list but not
here, or if you were targeting the non-standard slashes specifically.
Anyways, no worries if it was some other bug, hopefully I'll be able to
convince people that it's worth switching our slashes around to comply
with the standard.

-Mitch
--

-- 
Mitch Humpherys
Embedded Software Engineer
L-3 Communications, Linkabit Division
3033 Science Park Road
San Diego, CA 92121

-----Original Message-----
From: Eric M. Ludlam <eric <at> siege-engine.com>
To: cedet-devel <at> lists.sourceforge.net
Subject: Re: [CEDET-devel] semantic cache errors (invalid escape
character syntax)
Date: Wed, 06 Apr 2011 18:52:41 -0400
Mailer: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.3a1pre)
Gecko/20091222 Shredder/3.1a1pre

On 04/06/2011 02:12 PM, David Engster wrote:
(Continue reading)

Dan Kruchinin | 7 Apr 16:16 2011

[RFC] bovinator improperly parses attributes at the end of function declaration

Hi, list.

I want to describe a problem with parsing of a lot of functions in
glibc and linux kernel that have custom attributes at the end of
function declaration.
I mean something like the following:
#define __my_attribute__ __attribute__(("somethig"))
int myfunc(void) __my_attribute__

Here is a very simple example:
% cat test.c
void f(int x) __myattribute__;

M-x bovinate
gives
(("__myattribute__" variable
  (:type "int")
  nil #<overlay from 15 to 31 in test.c>))

As you can see, parser recognized __myattribute__ as an int variable
and ignored the function f(int x)

But
% cat another_test.c
void f(int x) __THROW;

M-x bovinate
gives
(("f" function
  (:prototype-flag t :arguments
(Continue reading)

David Engster | 7 Apr 20:27 2011
Picon

Re: semantic cache errors (invalid escape character syntax)

Mitchel Humpherys writes:
> That last update fixed the items in the :tags list, but there's still
> "unescaped" \'s in the semanticdb-table constructor, like:
>
> (semanticdb-table "..\..\Somefile.h"
>
> I don't know if your fix was directed at some other bug and just
> happened to fix our silly non-standard includes in the tags list but not
> here, or if you were targeting the non-standard slashes specifically.

I only fixed it for the :tags slot. I don't really understand how those
relative names could wind up in the object name itself. Anyway, I pushed
another commit which should quote those names correctly.

-David

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev

Gmane