View Issue Details

IDProjectCategoryView StatusLast Update
0015484LazarusIDEpublic2011-12-01 11:22
ReporterCraig McGrawAssigned ToDmitry Boyarintsev 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version0.9.30 
Summary0015484: 8-Cypher exception message
DescriptionThis exception occurs after Lazarus has been built, and is running. When I try to create a new project, a box displays the following message:

Name '' is not a valid 8-cypher hex sequence.

The project cannot compile because it cannot save either the project files or other IDE data. Clicking "Cancel" on the popup box kills Lazarus completely.
Additional InformationSVN 23401, FPC 2.4.0

I call it 'major' since it is not crashing Lazarus outright, but it does prevent me from actually using it.

Built via the command line, "make clean install"...

AMD Athlon, Win7RC.
TagsNo tags attached.
Fixed in Revision23418
LazTarget0.9.30
WidgetsetWin32/Win64
Attached Files
  • Cypher-8.png (18,115 bytes)
    Cypher-8.png (18,115 bytes)
  • versioninfo.patch (3,780 bytes)
    Index: projectresources.pas
    ===================================================================
    --- projectresources.pas	(revision 23415)
    +++ projectresources.pas	(working copy)
    @@ -114,6 +114,7 @@
         'lrs',
         'res'
       );
    +
     function StrToResourceType(const s: string): TResourceType;
     
     implementation
    @@ -493,8 +494,8 @@
         SetDeleteValue(Path+'VersionInfo/CurrentMinorRevNr/Value', VersionInfo.MinorRevNr,0);
         SetDeleteValue(Path+'VersionInfo/CurrentBuildNr/Value', VersionInfo.BuildNr,0);
         SetDeleteValue(Path+'VersionInfo/ProjectVersion/Value', VersionInfo.ProductVersionString,'1.0.0.0');
    -    SetDeleteValue(Path+'VersionInfo/Language/Value', VersionInfo.HexLang,'0409');
    -    SetDeleteValue(Path+'VersionInfo/CharSet/Value', VersionInfo.HexCharSet,'04E4');
    +    SetDeleteValue(Path+'VersionInfo/Language/Value', VersionInfo.HexLang,DefaultLanguage);
    +    SetDeleteValue(Path+'VersionInfo/CharSet/Value', VersionInfo.HexCharSet,DefaultCharset);
         SetDeleteValue(Path+'VersionInfo/Comments/Value', VersionInfo.CommentsString,'');
         SetDeleteValue(Path+'VersionInfo/CompanyName/Value', VersionInfo.CompanyString,'');
         SetDeleteValue(Path+'VersionInfo/FileDescription/Value', VersionInfo.DescriptionString,'');
    @@ -523,8 +524,8 @@
         VersionInfo.MinorRevNr := GetValue(Path+'VersionInfo/CurrentMinorRevNr/Value', 0);
         VersionInfo.BuildNr := GetValue(Path+'VersionInfo/CurrentBuildNr/Value', 0);
         VersionInfo.ProductVersionString := GetValue(Path+'VersionInfo/ProjectVersion/Value', '1.0.0.0');
    -    VersionInfo.HexLang := GetValue(Path+'VersionInfo/Language/Value', '0409');
    -    VersionInfo.HexCharSet := GetValue(Path+'VersionInfo/CharSet/Value', '04E4');
    +    VersionInfo.HexLang := GetValue(Path+'VersionInfo/Language/Value', DefaultLanguage);
    +    VersionInfo.HexCharSet := GetValue(Path+'VersionInfo/CharSet/Value', DefaultCharset);
         VersionInfo.CommentsString := LineBreaksToSystemLineBreaks(GetValue(Path+'VersionInfo/Comments/Value', ''));
         VersionInfo.CompanyString := LineBreaksToSystemLineBreaks(GetValue(Path+'VersionInfo/CompanyName/Value', ''));
         VersionInfo.DescriptionString := LineBreaksToSystemLineBreaks(GetValue(Path+'VersionInfo/FileDescription/Value', ''));
    Index: w32versioninfo.pas
    ===================================================================
    --- w32versioninfo.pas	(revision 23415)
    +++ w32versioninfo.pas	(working copy)
    @@ -116,6 +116,10 @@
     function MSCharacterSets: TStringList;
     function MSHexCharacterSets: TStringList;
     
    +const
    +  DefaultLanguage  = '0409';
    +  DefaultCharSet   = '04E4';
    +
     implementation
     
     var
    @@ -275,6 +279,8 @@
       ARes: TVersionResource;
       st: TVersionStringTable;
       ti: TVerTranslationInfo;
    +  lang: String;
    +  charset: String;
     begin
       Result := True;
       if UseVersionInfo then
    @@ -284,7 +290,12 @@
         ARes.FixedInfo.FileVersion := FVersion;
         ARes.FixedInfo.ProductVersion := ExtractProductVersion;
     
    -    st := TVersionStringTable.Create(HexLang + HexCharSet);
    +    lang:=HexLang;
    +    if lang='' then lang:=DefaultLanguage;
    +    charset:=HexCharSet;
    +    if charset='' then charset:=DefaultCharSet;
    +
    +    st := TVersionStringTable.Create(lang + charset);
         st.Add('Comments', Utf8ToAnsi(CommentsString));
         st.Add('CompanyName', Utf8ToAnsi(CompanyString));
         st.Add('FileDescription', Utf8ToAnsi(DescriptionString));
    @@ -297,8 +308,8 @@
         st.Add('ProductVersion', StringReplace(Utf8ToAnsi(ProductVersionString), ',', '.', [rfReplaceAll]));
         ARes.StringFileInfo.Add(st);
     
    -    ti.language := StrToInt('$'+HexLang);
    -    ti.codepage := StrToInt('$'+HexCharSet);
    +    ti.language := StrToInt('$'+lang);
    +    ti.codepage := StrToInt('$'+charset);
         ARes.VarFileInfo.Add(ti);
         AResources.AddSystemResource(ARes);
       end;
    
    versioninfo.patch (3,780 bytes)

Activities

Craig McGraw

2010-01-08 19:49

reporter   ~0033518

Last edited: 2010-01-08 22:22

This message also occurs when I try to 'rebuild Lazarus' using the build.

Correction to command-line build: Should have read "make clean all"...

Craig McGraw

2010-01-10 00:06

reporter   ~0033532

Last edited: 2010-01-10 00:18

I just tried building 23414, and I'm still getting the same exception box when I try to compile an existing project. Lazarus appears to run in all other respects. It is not crashing outright, just throwing this exception.

Just tried a new project with no content, and it compiled without the exception. Very strange bug.

Question: Are there any differences in the formats of the created project files between version 23335 and 23414 that might account for the exception?

Craig McGraw

2010-01-10 01:16

reporter   ~0033533

Last edited: 2010-01-10 01:34

Something new to add...

If I do not include version numbering, the new projects build correctly. When I try to include Version Info, the exception message gets thrown. If I uncheck the option and go back to a no-info-version build, it builds correctly.

I captured a screenshot of the error message and attached it above...

2010-01-10 01:33

 

Cypher-8.png (18,115 bytes)
Cypher-8.png (18,115 bytes)

2010-01-10 07:33

 

versioninfo.patch (3,780 bytes)
Index: projectresources.pas
===================================================================
--- projectresources.pas	(revision 23415)
+++ projectresources.pas	(working copy)
@@ -114,6 +114,7 @@
     'lrs',
     'res'
   );
+
 function StrToResourceType(const s: string): TResourceType;
 
 implementation
@@ -493,8 +494,8 @@
     SetDeleteValue(Path+'VersionInfo/CurrentMinorRevNr/Value', VersionInfo.MinorRevNr,0);
     SetDeleteValue(Path+'VersionInfo/CurrentBuildNr/Value', VersionInfo.BuildNr,0);
     SetDeleteValue(Path+'VersionInfo/ProjectVersion/Value', VersionInfo.ProductVersionString,'1.0.0.0');
-    SetDeleteValue(Path+'VersionInfo/Language/Value', VersionInfo.HexLang,'0409');
-    SetDeleteValue(Path+'VersionInfo/CharSet/Value', VersionInfo.HexCharSet,'04E4');
+    SetDeleteValue(Path+'VersionInfo/Language/Value', VersionInfo.HexLang,DefaultLanguage);
+    SetDeleteValue(Path+'VersionInfo/CharSet/Value', VersionInfo.HexCharSet,DefaultCharset);
     SetDeleteValue(Path+'VersionInfo/Comments/Value', VersionInfo.CommentsString,'');
     SetDeleteValue(Path+'VersionInfo/CompanyName/Value', VersionInfo.CompanyString,'');
     SetDeleteValue(Path+'VersionInfo/FileDescription/Value', VersionInfo.DescriptionString,'');
@@ -523,8 +524,8 @@
     VersionInfo.MinorRevNr := GetValue(Path+'VersionInfo/CurrentMinorRevNr/Value', 0);
     VersionInfo.BuildNr := GetValue(Path+'VersionInfo/CurrentBuildNr/Value', 0);
     VersionInfo.ProductVersionString := GetValue(Path+'VersionInfo/ProjectVersion/Value', '1.0.0.0');
-    VersionInfo.HexLang := GetValue(Path+'VersionInfo/Language/Value', '0409');
-    VersionInfo.HexCharSet := GetValue(Path+'VersionInfo/CharSet/Value', '04E4');
+    VersionInfo.HexLang := GetValue(Path+'VersionInfo/Language/Value', DefaultLanguage);
+    VersionInfo.HexCharSet := GetValue(Path+'VersionInfo/CharSet/Value', DefaultCharset);
     VersionInfo.CommentsString := LineBreaksToSystemLineBreaks(GetValue(Path+'VersionInfo/Comments/Value', ''));
     VersionInfo.CompanyString := LineBreaksToSystemLineBreaks(GetValue(Path+'VersionInfo/CompanyName/Value', ''));
     VersionInfo.DescriptionString := LineBreaksToSystemLineBreaks(GetValue(Path+'VersionInfo/FileDescription/Value', ''));
Index: w32versioninfo.pas
===================================================================
--- w32versioninfo.pas	(revision 23415)
+++ w32versioninfo.pas	(working copy)
@@ -116,6 +116,10 @@
 function MSCharacterSets: TStringList;
 function MSHexCharacterSets: TStringList;
 
+const
+  DefaultLanguage  = '0409';
+  DefaultCharSet   = '04E4';
+
 implementation
 
 var
@@ -275,6 +279,8 @@
   ARes: TVersionResource;
   st: TVersionStringTable;
   ti: TVerTranslationInfo;
+  lang: String;
+  charset: String;
 begin
   Result := True;
   if UseVersionInfo then
@@ -284,7 +290,12 @@
     ARes.FixedInfo.FileVersion := FVersion;
     ARes.FixedInfo.ProductVersion := ExtractProductVersion;
 
-    st := TVersionStringTable.Create(HexLang + HexCharSet);
+    lang:=HexLang;
+    if lang='' then lang:=DefaultLanguage;
+    charset:=HexCharSet;
+    if charset='' then charset:=DefaultCharSet;
+
+    st := TVersionStringTable.Create(lang + charset);
     st.Add('Comments', Utf8ToAnsi(CommentsString));
     st.Add('CompanyName', Utf8ToAnsi(CompanyString));
     st.Add('FileDescription', Utf8ToAnsi(DescriptionString));
@@ -297,8 +308,8 @@
     st.Add('ProductVersion', StringReplace(Utf8ToAnsi(ProductVersionString), ',', '.', [rfReplaceAll]));
     ARes.StringFileInfo.Add(st);
 
-    ti.language := StrToInt('$'+HexLang);
-    ti.codepage := StrToInt('$'+HexCharSet);
+    ti.language := StrToInt('$'+lang);
+    ti.codepage := StrToInt('$'+charset);
     ARes.VarFileInfo.Add(ti);
     AResources.AddSystemResource(ARes);
   end;
versioninfo.patch (3,780 bytes)

Craig McGraw

2010-01-10 15:12

reporter   ~0033540

Last edited: 2010-01-10 15:17

Dmitry,

A silly question, but I'm still a novice with Lazarus. Am I supposed to drop this patch into a folder, or has it already been inserted into the SVN stack? I just updated to svn 23416, and it is still throwing the exception even before I can close the Project Options dialog (I hit OK, and this exception message immediately appears). If I need to save this patch to a folder myself, which one, and do I need to rename it to anything different?

Thanks.

Zeljan Rikalo

2010-01-10 15:32

developer   ~0033541

No, patch isn't applied yet. Task will be marked as "resolved" when patch is applied (or even not applied and marked as "won't fix" etc).Anyway, you can
apply this patch into your lazarus version and test it, after that write some feedback here.

Craig McGraw

2010-01-10 20:05

reporter   ~0033546

Thanks, Zeljan. That explains why 23416 has the same problem...

...Patch applied, and Lazarus has risen from the (near) dead!

I think this issue can be rendered 'resolved' and closed.

Vincent Snijders

2010-01-10 21:14

manager   ~0033549

It can be resolved, after the patch has been applied and committed.

Craig McGraw

2010-01-10 21:48

reporter   ~0033550

Thank you, everyone!

Dmitry Boyarintsev

2010-01-11 02:55

developer   ~0033551

there might other solutions for the bug.
I've just made a proposal. You can use the patch applied, but keep an eye on the issue.
If some other fix is made, you'll need to revert changed made by the patch and update the Lazarus.

Dmitry Boyarintsev

2010-01-11 03:34

developer   ~0033553

the patch has been applied.

test and close if ok.

Issue History

Date Modified Username Field Change
2010-01-08 19:45 Craig McGraw New Issue
2010-01-08 19:45 Craig McGraw Widgetset => Win32/Win64
2010-01-08 19:49 Craig McGraw Note Added: 0033518
2010-01-08 22:22 Craig McGraw Note Edited: 0033518
2010-01-10 00:06 Craig McGraw Note Added: 0033532
2010-01-10 00:18 Craig McGraw Note Edited: 0033532
2010-01-10 01:16 Craig McGraw Note Added: 0033533
2010-01-10 01:33 Craig McGraw File Added: Cypher-8.png
2010-01-10 01:34 Craig McGraw Note Edited: 0033533
2010-01-10 07:33 Dmitry Boyarintsev File Added: versioninfo.patch
2010-01-10 15:12 Craig McGraw Note Added: 0033540
2010-01-10 15:17 Craig McGraw Note Edited: 0033540
2010-01-10 15:17 Craig McGraw Note Edited: 0033540
2010-01-10 15:32 Zeljan Rikalo Note Added: 0033541
2010-01-10 20:05 Craig McGraw Note Added: 0033546
2010-01-10 21:14 Vincent Snijders Note Added: 0033549
2010-01-10 21:48 Craig McGraw Note Added: 0033550
2010-01-11 02:55 Dmitry Boyarintsev Note Added: 0033551
2010-01-11 03:34 Dmitry Boyarintsev Fixed in Revision => 23418
2010-01-11 03:34 Dmitry Boyarintsev LazTarget => 0.9.30
2010-01-11 03:34 Dmitry Boyarintsev Status new => resolved
2010-01-11 03:34 Dmitry Boyarintsev Fixed in Version => 0.9.30
2010-01-11 03:34 Dmitry Boyarintsev Resolution open => fixed
2010-01-11 03:34 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2010-01-11 03:34 Dmitry Boyarintsev Note Added: 0033553
2011-12-01 11:22 Marc Weustink Status resolved => closed