View Issue Details

IDProjectCategoryView StatusLast Update
0027760LazarusIDEpublic2015-04-01 18:23
ReporterMario BonatiAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindoWs XP SP3OS VersionSP3
Product Version1.5 (SVN)Product BuildLazarus 1.5 r48507M FPC 2.6.4 i3 
Target Version1.4Fixed in Version1.5 (SVN) 
Summary0027760: Cant' use TSynMemo / TJITComponentList.AddJITChildComponentFromStream
Description- Create a new project
- Add a TSynMemo to the form

This give the error "Invalid type cast"

The same error exit when you serach to open a project that uses TSynMemo, for example the one in "C:\Lazarus\examples\SynEdit\SynAnyHighlighter"

Thanks in advance, Mario
TagsNo tags attached.
Fixed in Revision48563
LazTarget1.4
WidgetsetWin32/Win64
Attached Files
  • log.txt (4,097 bytes)
    TMainIDE.ParseCmdLineOptions:
      PrimaryConfigPath="C:\Users\bonmario\AppData\Local\lazarus"
      SecondaryConfigPath="C:\Lazarus"
    Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32 New=i386-win32-win32 FPC=True LCL=False
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    [TJITComponentList.ReaderError] "Invalid type cast" ignoring=False
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    [TJITComponentList.AddJITChildComponentFromStream] ERROR reading form stream of Class "TForm1" Error: Invalid type cast
      Stack trace:
      $00B18FA8
      $00A0D22F
      $00494F95
      $00495525
      $0048F5FB
      $00496CD9
      $0078F808
      $0078F2F1
      $007AF7EE
      $0099EC14
      $0099E1B0
      $0098A9C1
      $0098C48E
      $009899DA
      $00994AD8
      $0045C30A
      $00996252
    TCustomFormEditor.JITListException List.CurReadStreamClass=TForm1 TUnitInfo
    ERROR: streaming failed lfm="C:\Lazarus\examples\SynEdit\SynAnyHighlighter\unit1.lfm"
    TCustomFormEditor.FindDefineProperty Persistent is NOT registered
    FindLFMIdentifier ERROR ancestor of SynMemo/Lines.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    FindLFMIdentifier ERROR ancestor of SynMemo/SelectedColor.OnChange not found: Node=Property PropName="OnChange" File=C:\Lazarus\components\synedit\synedithighlighter.pp(158,5) IdentName=OnChange
    TCustomFormEditor.FindDefineProperty Persistent is NOT registered
    FindLFMIdentifier ERROR ancestor of CheckListBoxKeys/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    TDefinePropertiesReader.AddPropertyName Name="Data"
    TCustomFormEditor.FindDefineProperty Class=TCheckListBox DefineProps="Data
    "
    FindLFMIdentifier ERROR ancestor of CheckListBoxObjects/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    FindLFMIdentifier ERROR ancestor of CheckListBoxConstants/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    FindLFMIdentifier ERROR ancestor of SynAnySyn/Objects.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    TDefinePropertiesReader.AddPropertyName Name="left"
    TDefinePropertiesReader.AddPropertyName Name="top"
    TCustomFormEditor.FindDefineProperty Class=TSynAnySyn DefineProps="left
    top
    "
    FindLFMIdentifier ERROR ancestor of SynMemo/Lines.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    FindLFMIdentifier ERROR ancestor of SynMemo/SelectedColor.OnChange not found: Node=Property PropName="OnChange" File=C:\Lazarus\components\synedit\synedithighlighter.pp(158,5) IdentName=OnChange
    FindLFMIdentifier ERROR ancestor of CheckListBoxKeys/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    FindLFMIdentifier ERROR ancestor of CheckListBoxObjects/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    FindLFMIdentifier ERROR ancestor of CheckListBoxConstants/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    FindLFMIdentifier ERROR ancestor of SynAnySyn/Objects.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
    TFileOpener.OpenResource LoadLFM failed
    TFileOpener.OpenEditorFile failed OpenResource: C:\Lazarus\examples\SynEdit\SynAnyHighlighter\unit1.pas
    LAZARUS END - cleaning up ...
    [TMainIDE.Destroy] A 
    [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
    [TMainIDE.Destroy] END
    
    log.txt (4,097 bytes)
  • synedit.diff (1,056 bytes)
    Index: components/synedit/lazsynimm.pas
    ===================================================================
    --- components/synedit/lazsynimm.pas	(revision 48486)
    +++ components/synedit/lazsynimm.pas	(working copy)
    @@ -457,7 +457,7 @@
       FImeMarkupSelection2.MarkupInfo.FrameStyle := slsSolid;
       FImeMarkupSelection2.MarkupInfo.FrameEdges := sfeBottom;
     
    -  FImeMarkupSelection3.MarkupInfo.Assign(TSynEdit(FriendEdit).SelectedColor);
    +  FImeMarkupSelection3.MarkupInfo.Assign(TCustomSynEdit(FriendEdit).SelectedColor);
     
       TCustomSynEdit(FriendEdit).RegisterStatusChangedHandler(@DoStatusChanged, [scCaretX, scCaretY, scModified]);
       TCustomSynEdit(FriendEdit).RegisterCommandHandler(@DoOnCommand, nil, [hcfInit]);
    @@ -841,7 +841,7 @@
       FHasPersistLock := True;
       {$ENDIF}
     
    -  FImeMarkupSelection3.MarkupInfo.Assign(TSynEdit(FriendEdit).SelectedColor);
    +  FImeMarkupSelection3.MarkupInfo.Assign(TCustomSynEdit(FriendEdit).SelectedColor);
       FImeBlockSelection.StartLineBytePos := CaretObj.LineBytePos;
       FInCompose := True;
       Msg.Result := 1;
    
    synedit.diff (1,056 bytes)

Activities

Mario Bonati

2015-03-31 13:30

reporter   ~0082492

I've upgraded at revision r48549M, but i have the same error

Martin Friebe

2015-03-31 17:41

manager   ~0082502

Can you run teh IDE with (command line option / modify desktop shortcut)) --debug-log=c:\log.txt

And see if there is a stacktrace?
If there is and it does NOT have unitnames/filenames in it, then you must first recompile the IDE with debug info -gl -gw

I have no issues on win32/vista. I can not reproduce this.

Mario Bonati

2015-03-31 19:00

reporter  

log.txt (4,097 bytes)
TMainIDE.ParseCmdLineOptions:
  PrimaryConfigPath="C:\Users\bonmario\AppData\Local\lazarus"
  SecondaryConfigPath="C:\Lazarus"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=i386-win32-win32 New=i386-win32-win32 FPC=True LCL=False
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[TJITComponentList.ReaderError] "Invalid type cast" ignoring=False
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[TJITComponentList.AddJITChildComponentFromStream] ERROR reading form stream of Class "TForm1" Error: Invalid type cast
  Stack trace:
  $00B18FA8
  $00A0D22F
  $00494F95
  $00495525
  $0048F5FB
  $00496CD9
  $0078F808
  $0078F2F1
  $007AF7EE
  $0099EC14
  $0099E1B0
  $0098A9C1
  $0098C48E
  $009899DA
  $00994AD8
  $0045C30A
  $00996252
TCustomFormEditor.JITListException List.CurReadStreamClass=TForm1 TUnitInfo
ERROR: streaming failed lfm="C:\Lazarus\examples\SynEdit\SynAnyHighlighter\unit1.lfm"
TCustomFormEditor.FindDefineProperty Persistent is NOT registered
FindLFMIdentifier ERROR ancestor of SynMemo/Lines.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
FindLFMIdentifier ERROR ancestor of SynMemo/SelectedColor.OnChange not found: Node=Property PropName="OnChange" File=C:\Lazarus\components\synedit\synedithighlighter.pp(158,5) IdentName=OnChange
TCustomFormEditor.FindDefineProperty Persistent is NOT registered
FindLFMIdentifier ERROR ancestor of CheckListBoxKeys/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
TDefinePropertiesReader.AddPropertyName Name="Data"
TCustomFormEditor.FindDefineProperty Class=TCheckListBox DefineProps="Data
"
FindLFMIdentifier ERROR ancestor of CheckListBoxObjects/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
FindLFMIdentifier ERROR ancestor of CheckListBoxConstants/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
FindLFMIdentifier ERROR ancestor of SynAnySyn/Objects.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
TDefinePropertiesReader.AddPropertyName Name="left"
TDefinePropertiesReader.AddPropertyName Name="top"
TCustomFormEditor.FindDefineProperty Class=TSynAnySyn DefineProps="left
top
"
FindLFMIdentifier ERROR ancestor of SynMemo/Lines.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
FindLFMIdentifier ERROR ancestor of SynMemo/SelectedColor.OnChange not found: Node=Property PropName="OnChange" File=C:\Lazarus\components\synedit\synedithighlighter.pp(158,5) IdentName=OnChange
FindLFMIdentifier ERROR ancestor of CheckListBoxKeys/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
FindLFMIdentifier ERROR ancestor of CheckListBoxObjects/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
FindLFMIdentifier ERROR ancestor of CheckListBoxConstants/Items.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
FindLFMIdentifier ERROR ancestor of SynAnySyn/Objects.Strings not found: Node=Property PropName="Strings" File=C:\Lazarus\fpc\2.6.4\source\rtl\objpas\classes\classesh.inc(694,5) IdentName=Strings
TFileOpener.OpenResource LoadLFM failed
TFileOpener.OpenEditorFile failed OpenResource: C:\Lazarus\examples\SynEdit\SynAnyHighlighter\unit1.pas
LAZARUS END - cleaning up ...
[TMainIDE.Destroy] A 
[TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
[TMainIDE.Destroy] END
log.txt (4,097 bytes)

Mario Bonati

2015-03-31 19:01

reporter   ~0082503

I've uploaded the log.
Now i'm at home, on windows 7 64 bit
Lazarus 1.5 r48550 FPC 2.6.4 i386-win32-win32/win64

Thanks, Mario

Martin Friebe

2015-03-31 21:48

manager   ~0082510

Updated Subject:

Looks like an issue in the JIT reader. No idea why it affect SynMemo. This needs to be looked after by somebody else.

Mario Bonati

2015-03-31 22:05

reporter   ~0082511

I do not know if it can be useful, but with an old project in which I used a TSynMemo I tried to open the source .pas, .lfm and .lrs with another editor, and replaced TSynMemo with TSynEdit. I saved them, and so I open the project without errors.

Thanks, Mario

Bart Broersma

2015-03-31 22:44

developer   ~0082513

Last edited: 2015-03-31 22:48

View 3 revisions

I disected the issue, it's r48486 that breaks it: SynEdit: win, IME Handler: added markup for ATTR_TARGET_NOTCONVERTED.

Suspects:
Line 457
FImeMarkupSelection3.MarkupInfo.Assign(TSynEdit(FriendEdit).SelectedColor);

and
Line 841
FImeMarkupSelection3.MarkupInfo.Assign(TSynEdit(FriendEdit).SelectedColor);

Bart Broersma

2015-03-31 22:52

developer  

synedit.diff (1,056 bytes)
Index: components/synedit/lazsynimm.pas
===================================================================
--- components/synedit/lazsynimm.pas	(revision 48486)
+++ components/synedit/lazsynimm.pas	(working copy)
@@ -457,7 +457,7 @@
   FImeMarkupSelection2.MarkupInfo.FrameStyle := slsSolid;
   FImeMarkupSelection2.MarkupInfo.FrameEdges := sfeBottom;
 
-  FImeMarkupSelection3.MarkupInfo.Assign(TSynEdit(FriendEdit).SelectedColor);
+  FImeMarkupSelection3.MarkupInfo.Assign(TCustomSynEdit(FriendEdit).SelectedColor);
 
   TCustomSynEdit(FriendEdit).RegisterStatusChangedHandler(@DoStatusChanged, [scCaretX, scCaretY, scModified]);
   TCustomSynEdit(FriendEdit).RegisterCommandHandler(@DoOnCommand, nil, [hcfInit]);
@@ -841,7 +841,7 @@
   FHasPersistLock := True;
   {$ENDIF}
 
-  FImeMarkupSelection3.MarkupInfo.Assign(TSynEdit(FriendEdit).SelectedColor);
+  FImeMarkupSelection3.MarkupInfo.Assign(TCustomSynEdit(FriendEdit).SelectedColor);
   FImeBlockSelection.StartLineBytePos := CaretObj.LineBytePos;
   FInCompose := True;
   Msg.Result := 1;
synedit.diff (1,056 bytes)

Bart Broersma

2015-03-31 22:53

developer   ~0082514

Patch attached, seems to resolve the issue of loading: please review.

Martin Friebe

2015-04-01 00:30

manager   ~0082517

Thanks Bart.

Indeed the fix is correct. I fixed the other 10 wrong casts as well.

Mario Bonati

2015-04-01 18:23

reporter   ~0082534

Now it's perfect.

Thanks, Mario

Issue History

Date Modified Username Field Change
2015-03-31 10:08 Mario Bonati New Issue
2015-03-31 13:30 Mario Bonati Note Added: 0082492
2015-03-31 17:41 Martin Friebe Note Added: 0082502
2015-03-31 19:00 Mario Bonati File Added: log.txt
2015-03-31 19:01 Mario Bonati Note Added: 0082503
2015-03-31 21:48 Martin Friebe LazTarget => -
2015-03-31 21:48 Martin Friebe Note Added: 0082510
2015-03-31 21:48 Martin Friebe Summary Cant' use TSynMemo => Cant' use TSynMemo / TJITComponentList.AddJITChildComponentFromStream
2015-03-31 22:05 Mario Bonati Note Added: 0082511
2015-03-31 22:44 Bart Broersma Note Added: 0082513
2015-03-31 22:47 Bart Broersma Note Edited: 0082513 View Revisions
2015-03-31 22:48 Bart Broersma Note Edited: 0082513 View Revisions
2015-03-31 22:48 Bart Broersma Assigned To => Martin Friebe
2015-03-31 22:48 Bart Broersma Status new => assigned
2015-03-31 22:52 Bart Broersma File Added: synedit.diff
2015-03-31 22:53 Bart Broersma Note Added: 0082514
2015-04-01 00:30 Martin Friebe Fixed in Revision => 48563
2015-04-01 00:30 Martin Friebe LazTarget - => 1.4
2015-04-01 00:30 Martin Friebe Note Added: 0082517
2015-04-01 00:30 Martin Friebe Status assigned => resolved
2015-04-01 00:30 Martin Friebe Fixed in Version => 1.5 (SVN)
2015-04-01 00:30 Martin Friebe Resolution open => fixed
2015-04-01 00:30 Martin Friebe Target Version => 1.4
2015-04-01 18:23 Mario Bonati Note Added: 0082534
2015-04-01 18:23 Mario Bonati Status resolved => closed