Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in Vcl.Styles.Utils.SysStyleHook.pas #21

Closed
GoogleCodeExporter opened this issue Apr 30, 2015 · 7 comments
Closed

Memory leak in Vcl.Styles.Utils.SysStyleHook.pas #21

GoogleCodeExporter opened this issue Apr 30, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link


--------------------------------2014/1/18 
23:25:07--------------------------------
A memory block has been leaked. The size is: 36

This block was allocated by thread 0x1E80, and the stack trace (return 
addresses) at the time was:
4069D6 [System.pas][System][@GetMem$qqri][4316]
4087DB [System.pas][System][TObject.NewInstance$qqrv][15447]
8094EB 
[Vcl.Styles.Utils.SysStyleHook.pas][Vcl.Styles.Utils.SysStyleHook][Styles.Utils.
Sysstylehook.TSysStyleHook.DrawText$qqrp5HDC__rx32Vcl.Themes.TThemedElementDetai
ls20System.UnicodeStringr18System.Types.TRectx54System.%Set$t25Vcl.Graphics.TTex
tFormats$iuc$0
408FFE [System.pas][System][@ClassCreate$qqrpvzc][16757]
8094EB 
[Vcl.Styles.Utils.SysStyleHook.pas][Vcl.Styles.Utils.SysStyleHook][Styles.Utils.
Sysstylehook.TSysStyleHook.DrawText$qqrp5HDC__rx32Vcl.Themes.TThemedElementDetai
ls20System.UnicodeStringr18System.Types.TRectx54System.%Set$t25Vcl.Graphics.TTex
tFormats$iuc$0
431E5B 
[System.SysUtils.pas][System.SysUtils][Sysutils.Exception.$bctr$qqrx20System.Uni
codeString][21421]
8094EB 
[Vcl.Styles.Utils.SysStyleHook.pas][Vcl.Styles.Utils.SysStyleHook][Styles.Utils.
Sysstylehook.TSysStyleHook.DrawText$qqrp5HDC__rx32Vcl.Themes.TThemedElementDetai
ls20System.UnicodeStringr18System.Types.TRectx54System.%Set$t25Vcl.Graphics.TTex
tFormats$iuc$0
8094EB 
[Vcl.Styles.Utils.SysStyleHook.pas][Vcl.Styles.Utils.SysStyleHook][Styles.Utils.
Sysstylehook.TSysStyleHook.DrawText$qqrp5HDC__rx32Vcl.Themes.TThemedElementDetai
ls20System.UnicodeStringr18System.Types.TRectx54System.%Set$t25Vcl.Graphics.TTex
tFormats$iuc$0
4325C4 
[System.SysUtils.pas][System.SysUtils][Sysutils.ErrorHandler$qqrucpv][21667]
406B68 [System.pas][System][ErrorAt$qqrucpv][5249]
406BAB [System.pas][System][Error$qqr20System.TRuntimeError][5260]

The block is currently used for an object of class: ERangeError

The allocation number is: 577772

Current memory dump of 256 bytes starting at pointer address 7DCB80C0:
94 42 42 00 DC DD F7 7E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00
26 F8 02 8C E0 14 CA 00 00 00 00 00 A1 81 CB 7D 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00
BF 90 07 00 D6 69 40 00 DB 87 40 00 FE 8F 40 00 71 17 4C 00 55 04 B5 00 2F 7E 
49 00 2E 83 49 00
F9 63 49 00 1A 21 6D 00 AA 28 6D 00 06 FA 6C 00 80 1E 00 00 80 1E 00 00 F2 69 
40 00 F9 87 40 00
49 90 40 00 F4 11 4C 00 C7 89 40 00 1B 04 B5 00 C7 89 40 00 13 04 B5 00 C7 89 
40 00 7B 26 B4 00
C7 89 40 00 20 00 00 00 24 93 B3 00 75 12 9B 86 EC 11 CA 00 E0 14 CA 00 E0 14 
CA 00 E0 14 CA 00
E0 14 CA 00 E0 14 CA 00 E0 14 CA 00 E0 14 CA 00 8A ED 64 79 E0 14 CA 00 00 00 
00 00 51 82 CB 7D
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C0 90 07 00 D6 69 40 00 DB 87 
40 00 FE 8F 40 00
”  B  B  .  Ü  Ý  ÷  ~  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  
.  .  .  .  .  .  .
&  ø  .  Œ  à  .  Ê  .  .  .  .  .  ¡  �  Ë  }  .  .  .  .  .  .  .  .  
.  .  .  .  .  .  .  .
¿  �  .  .  Ö  i  @  .  Û  ‡  @  .  þ  �  @  .  q  .  L  .  U  .  µ  . 
 /  ~  I  .  .  ƒ  I  .
ù  c  I  .  .  !  m  .  ª  (  m  .  .  ú  l  .  €  .  .  .  €  .  .  .  
ò  i  @  .  ù  ‡  @  .
I  �  @  .  ô  .  L  .  Ç  ‰  @  .  .  .  µ  .  Ç  ‰  @  .  .  .  µ  
.  Ç  ‰  @  .  {  &  ´  .
Ç  ‰  @  .     .  .  .  $  “  ³  .  u  .  ›  †  ì  .  Ê  .  à  .  
Ê  .  à  .  Ê  .  à  .  Ê  .
à  .  Ê  .  à  .  Ê  .  à  .  Ê  .  à  .  Ê  .  Š  í  d  y  à  .  Ê 
 .  .  .  .  .  Q  ‚  Ë  }
.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  À  �  .  .  Ö  i  @  .  Û  
‡  @  .  þ  �  @  .



Original issue reported on code.google.com by KHJ1...@gmail.com on 18 Jan 2014 at 10:41

@GoogleCodeExporter
Copy link
Author

Please check again using the last revision (141)

Original comment by Rodrigo.Ruz.V@gmail.com on 19 Jan 2014 at 12:34

@GoogleCodeExporter
Copy link
Author

Downloaded Revision (141)
Started the application several times and failure happened only if I start to 
call the OpenFileDialog with theme.
See below the CallStack, FastMM-report and a hardcopy from Delphi.

Best regards
Karlheinz


:75fbc41f KERNELBASE.RaiseException + 0x58
:0069FA81 Jclhookexcept::HookedRaiseException(ExceptionCode=????, 
ExceptionFlags=????, NumberOfArguments=????, Arguments=:0018E410)
Vcl.Styles.Utils.SysStyleHook.TSysStyleHook.DrawText(4221867,((out of bound) 
124, 1631300, 1631276),???,(-1074659607, 871099391, 1499028160, 1745914212, 
(-1074659607, 871099391), (1499028160, 
1745914212)),[tfEditControl,tfEndEllipsis,tfExpandTabs,tfNoClip,tfRtlReading,tfS
ingleLine,tfTop,tfNoFullWidthCharBreak,tfPrefixOnly])
Vcl.Styles.Utils.SysStyleHook.TSysStyleHook.DrawText(385951019,(teComboBox, 0, 
0),'SKraft-Milling Files (*.SKF)',(3, 3, 227, 18, (3, 3), (227, 
18)),[tfLeft,tfSingleLine,tfVerticalCenter])
Vcl.Styles.Utils.StdCtrls.TSysComboBoxStyleHook.WMPaint(???)
Vcl.Styles.Utils.SysStyleHook.TSysStyleHook.WndProc((15, 0, 0, 0, 0, 0, (), 0, 
0, (), 0, 0, ()))
Vcl.Styles.Utils.StdCtrls.TSysComboBoxStyleHook.WndProc((15, 0, 0, 0, 0, 0, (), 
0, 0, (), 0, 0, ()))
System.Classes.StdWndProc(397192,15,0,0)
:760162fa ; C:\Windows\syswow64\USER32.dll
:76017316 USER32.GetDC + 0x52
:76016de8 ; C:\Windows\syswow64\USER32.dll
:76016e44 ; C:\Windows\syswow64\USER32.dll
:776f010a ntdll.KiUserCallbackDispatcher + 0x2e
:7603b992 ; C:\Windows\syswow64\USER32.dll
:7603cf4b USER32.DialogBoxIndirectParamAorW + 0xf7
:7603ce8a USER32.DialogBoxIndirectParamAorW + 0x36
:7603cc0e USER32.DialogBoxIndirectParamW + 0x1b
:7567597b ; C:\Windows\syswow64\comdlg32.dll
:756b1b50 ; C:\Windows\syswow64\comdlg32.dll
:756b29d0 ; C:\Windows\syswow64\comdlg32.dll
:756b2b15 ; C:\Windows\syswow64\comdlg32.dll
:756b2b71 ; C:\Windows\syswow64\comdlg32.dll
:756a9a9b ; C:\Windows\syswow64\comdlg32.dll
:756aa33f comdlg32.GetOpenFileNameW + 0x6a
Vcl.Dialogs.TCommonDialog.TaskModalDialog(???,???)
Vcl.Dialogs.TOpenDialog.DoExecute($56A06C,722910)
Vcl.Dialogs.TOpenDialog.Execute(722910)
Vcl.Dialogs.TCommonDialog.Execute
uSkFileTypes.TSKraftBaseFile.Open
DM_Milling.TMillingInputData.Open
fMillingMain.Tf_MillingMain.LocalOpen(???)
fMillingMain.Tf_MillingMain.Open(???)
fSKraftMain.Tf_SKraftMain.actFileMillingOpenExecute(???)
System.Classes.TBasicAction.Execute
Vcl.ActnList.TCustomAction.Execute
System.Classes.TBasicActionLink.Execute(???)
Vcl.ActnMenus.TCustomActionMenuBar.ExecAction(???)
Vcl.ActnMenus.TCustomActionMenuBar.TrackMenu
Vcl.ActnMenus.TCustomActionMainMenuBar.TrackMenu
Vcl.ActnMenus.TCustomActionMenuBar.CMItemClicked(???)
Vcl.Controls.TControl.WndProc((46083, 0, 2128972080, 0, 0, 0, (), 35120, 32485, 
(), 0, 0, ()))
Vcl.Controls.TWinControl.WndProc((46083, 0, 2128972080, 0, 0, 0, (), 35120, 
32485, (), 0, 0, ()))
Vcl.ActnMenus.TCustomActionMenuBar.WndProc((46083, 0, 2128972080, 0, 0, 0, (), 
35120, 32485, (), 0, 0, ()))
Vcl.Controls.TWinControl.MainWndProc(???)
System.Classes.StdWndProc(528248,46083,0,2128972080)
:760162fa ; C:\Windows\syswow64\USER32.dll
:76016d3a USER32.GetThreadDesktop + 0xd7
:760177c4 ; C:\Windows\syswow64\USER32.dll
:7601788a USER32.DispatchMessageW + 0xf
Vcl.Forms.TApplication.ProcessMessage(???)





--------------------------------2014/1/19 
8:11:24--------------------------------
A memory block has been leaked. The size is: 36

This block was allocated by thread 0x16F4, and the stack trace (return 
addresses) at the time was:
4069D6 [System.pas][System][@GetMem$qqri][4316]
4087DB [System.pas][System][TObject.NewInstance$qqrv][15447]
80A9F7 
[Vcl.Styles.Utils.SysStyleHook.pas][Vcl.Styles.Utils.SysStyleHook][Styles.Utils.
Sysstylehook.TSysStyleHook.DrawText$qqrp5HDC__rx32Vcl.Themes.TThemedElementDetai
ls20System.UnicodeStringr18System.Types.TRectx54System.%Set$t25Vcl.Graphics.TTex
tFormats$iuc$0
408FFE [System.pas][System][@ClassCreate$qqrpvzc][16757]
80A9F7 
[Vcl.Styles.Utils.SysStyleHook.pas][Vcl.Styles.Utils.SysStyleHook][Styles.Utils.
Sysstylehook.TSysStyleHook.DrawText$qqrp5HDC__rx32Vcl.Themes.TThemedElementDetai
ls20System.UnicodeStringr18System.Types.TRectx54System.%Set$t25Vcl.Graphics.TTex
tFormats$iuc$0
431E5B 
[System.SysUtils.pas][System.SysUtils][Sysutils.Exception.$bctr$qqrx20System.Uni
codeString][21421]
80A9F7 
[Vcl.Styles.Utils.SysStyleHook.pas][Vcl.Styles.Utils.SysStyleHook][Styles.Utils.
Sysstylehook.TSysStyleHook.DrawText$qqrp5HDC__rx32Vcl.Themes.TThemedElementDetai
ls20System.UnicodeStringr18System.Types.TRectx54System.%Set$t25Vcl.Graphics.TTex
tFormats$iuc$0
80A9F7 
[Vcl.Styles.Utils.SysStyleHook.pas][Vcl.Styles.Utils.SysStyleHook][Styles.Utils.
Sysstylehook.TSysStyleHook.DrawText$qqrp5HDC__rx32Vcl.Themes.TThemedElementDetai
ls20System.UnicodeStringr18System.Types.TRectx54System.%Set$t25Vcl.Graphics.TTex
tFormats$iuc$0
4325C4 
[System.SysUtils.pas][System.SysUtils][Sysutils.ErrorHandler$qqrucpv][21667]
406B68 [System.pas][System][ErrorAt$qqrucpv][5249]
406BAB [System.pas][System][Error$qqr20System.TRuntimeError][5260]

The block is currently used for an object of class: ERangeError

The allocation number is: 633771

Current memory dump of 256 bytes starting at pointer address 7DCBED10:
94 42 42 00 DC DD F7 7E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00
CC 89 21 93 E0 54 CA 00 00 00 00 00 11 FD CB 7D 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00
D0 A4 09 00 D6 69 40 00 DB 87 40 00 FE 8F 40 00 FE 5C 52 00 AF A5 80 00 9E A6 
80 00 47 B8 80 00
DF 2A 81 00 F1 B5 80 00 0F 23 81 00 A0 84 81 00 F4 16 00 00 F4 16 00 00 F2 69 
40 00 F9 87 40 00
49 90 40 00 66 5D 52 00 C7 89 40 00 2C A7 80 00 A4 B8 80 00 22 2B 81 00 C7 89 
40 00 E5 2B 7F 00
3C A0 40 00 1C 00 00 00 C8 EF 51 00 D7 65 99 86 EC 51 CA 00 E0 54 CA 00 E0 54 
CA 00 E0 54 CA 00
E0 54 CA 00 E0 54 CA 00 E0 54 CA 00 28 9A 66 79 E0 54 CA 00 E0 54 CA 00 00 00 
00 00 11 E7 CB 7D
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A3 C8 09 00 D6 69 40 00 BF A6 
40 00 F0 A8 40 00
”  B  B  .  Ü  Ý  ÷  ~  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  
.  .  .  .  .  .  .
Ì  ‰  !  “  à  T  Ê  .  .  .  .  .  .  ý  Ë  }  .  .  .  .  .  .  .  . 
 .  .  .  .  .  .  .  .
Ð  ¤  .  .  Ö  i  @  .  Û  ‡  @  .  þ  �  @  .  þ  \  R  .  ¯  ¥  
€  .  ž  ¦  €  .  G  ¸  €  .
ß  *  �  .  ñ  µ  €  .  .  #  �  .     „  �  .  ô  .  .  .  ô  .  
.  .  ò  i  @  .  ù  ‡  @  .
I  �  @  .  f  ]  R  .  Ç  ‰  @  .  ,  §  €  .  ¤  ¸  €  .  "  +  � 
 .  Ç  ‰  @  .  å  +  �  .
<     @  .  .  .  .  .  È  ï  Q  .  ×  e  ™  †  ì  Q  Ê  .  à  T  Ê 
 .  à  T  Ê  .  à  T  Ê  .
à  T  Ê  .  à  T  Ê  .  à  T  Ê  .  (  š  f  y  à  T  Ê  .  à  T  Ê  
.  .  .  .  .  .  ç  Ë  }
.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  £  È  .  .  Ö  i  @  .  ¿  
¦  @  .  ð  ¨  @  .

--------------------------------2014/1/19 
8:11:24--------------------------------
A memory block has been leaked. The size is: 52

This block was allocated by thread 0x16F4, and the stack trace (return 
addresses) at the time was:
4069D6 [System.pas][System][@GetMem$qqri][4316]
40A6BF [System.pas][System][@NewUnicodeString$qqri][23630]
40A8F0 
[System.pas][System][@UStrFromPWCharLen$qqrr20System.UnicodeStringpbi][24302]
40EFA5 [System.pas][System][LoadResString$qqrp20System.TResStringRec][37127]
630065 
[Vcl.ImgList.pas][Vcl.ImgList][Imglist.TCustomImageList.InsertImage$qqrip20Vcl.G
raphics.TBitmapt221System.Uitypes.TColor][895]
7771A8D7 [Unknown function at RtlDetermineDosPathNameType_U]
77713CD3 [Unknown function at RtlImageNtHeader]
77713CFE [Unknown function at RtlImageNtHeader]
776FFABA [ZwQueryValueKey]
7624D713 [Unknown function at CreateMemoryResourceNotification]
7624D730 [Unknown function at CreateMemoryResourceNotification]

The block is currently used for an object of class: UnicodeString

The allocation number is: 38

Current memory dump of 256 bytes starting at pointer address 7EF7DDD0:
B0 04 02 00 01 00 00 00 11 00 00 00 52 00 61 00 6E 00 67 00 65 00 20 00 63 00 
68 00 65 00 63 00
6B 00 20 00 65 00 72 00 72 00 6F 00 72 00 00 00 F5 16 53 B5 E0 54 CA 00 00 00 
00 00 91 DC F7 7E
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 D6 69 40 00 BF A6 
40 00 F0 A8 40 00
A5 EF 40 00 D7 A8 71 77 D3 3C 71 77 FE 3C 71 77 BA FA 6F 77 13 D7 24 76 30 D7 
24 76 A2 D6 24 76
F4 16 00 00 F4 16 00 00 F2 69 40 00 79 A7 40 00 01 A3 40 00 B3 28 42 00 3C A0 
40 00 F2 A4 40 00
9C 40 C8 00 6A 33 24 76 72 9F 71 77 45 9F 71 77 00 00 00 00 2E 00 00 00 B0 04 
02 00 78 31 84 27
EC 51 CA 00 E0 54 CA 00 E0 54 CA 00 E0 54 CA 00 E0 54 CA 00 E0 54 CA 00 E0 54 
CA 00 E0 54 CA 00
E0 54 CA 00 E0 54 CA 00 E0 54 CA 00 E0 54 87 CE 7B D8 CA 00 E0 54 CA 00 00 00 
00 00 51 E0 F7 7E
°  .  .  .  .  .  .  .  .  .  .  .  R  .  a  .  n  .  g  .  e  .     .  c  .  
h  .  e  .  c  .
k  .     .  e  .  r  .  r  .  o  .  r  .  .  .  õ  .  S  µ  à  T  Ê  .  .  
.  .  .  ‘  Ü  ÷  ~
.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  '  .  .  .  Ö  i  @  .  ¿  ¦ 
 @  .  ð  ¨  @  .
¥  ï  @  .  ×  ¨  q  w  Ó  <  q  w  þ  <  q  w  º  ú  o  w  .  ×  $  v 
 0  ×  $  v  ¢  Ö  $  v
ô  .  .  .  ô  .  .  .  ò  i  @  .  y  §  @  .  .  £  @  .  ³  (  B  .  < 
    @  .  ò  ¤  @  .
œ  @  È  .  j  3  $  v  r  Ÿ  q  w  E  Ÿ  q  w  .  .  .  .  .  .  .  .  °  
.  .  .  x  1  „  '
ì  Q  Ê  .  à  T  Ê  .  à  T  Ê  .  à  T  Ê  .  à  T  Ê  .  à  T  Ê 
 .  à  T  Ê  .  à  T  Ê  .
à  T  Ê  .  à  T  Ê  .  à  T  Ê  .  à  T  ‡  Î  {  Ø  Ê  .  à  T  
Ê  .  .  .  .  .  Q  à  ÷  ~

--------------------------------2014/1/19 
8:11:24--------------------------------
This application has leaked memory. The small block leaks are (excluding 
expected leaks registered by pointer):

21 - 36 bytes: ERangeError x 1
37 - 52 bytes: UnicodeString x 1

Note: Memory leak detail is logged to a text file in the same folder as this 
application. To disable this memory leak check, undefine 
"EnableMemoryLeakReporting".

Original comment by KHJ1...@gmail.com on 19 Jan 2014 at 7:35

Attachments:

@GoogleCodeExporter
Copy link
Author

I have a Major datamodule where I handle my Major program Settings.
Inside of the datamodule i have the uses clause like below.
and ONLY WITH  Vcl.Styles.Utils.StdCtrls IN the uses the failure happened. I 
tried to comment out each Vcl.Styles unit step by step and only if 
Vcl.Styles.Utils.StdCtrls is NOT inside the uses the failure did not happen.

implementation

{ %CLASSGROUP 'Vcl.Controls.TControl' }

uses
  // Delphi
  Vcl.Themes,
  Vcl.Styles,
  // Styles
  Vcl.Styles.Hooks,
  Vcl.Styles.Utils.Menus,
  Vcl.Styles.Utils.Forms,
  Vcl.Styles.Utils.StdCtrls,  // creates a failure in a FileOpenDialog
  Vcl.Styles.Utils.ComCtrls,
  Vcl.Styles.Utils.SysStyleHook,
  Vcl.Styles.Utils.ScreenTips,
  Vcl.Styles.Utils.SysControls,
  Vcl.Styles.FormStyleHooks,
  // GNU
  JvGnuGetText,
  // JCL
  JclSysInfo, JclFileUtils, JvJCLUtils,
  // SKraft
  uSkRes, uSkUtils, fKHJBaseForm, DM_Werkstoff;

Original comment by KHJ1...@gmail.com on 19 Jan 2014 at 7:57

@GoogleCodeExporter
Copy link
Author

I cannot reproduce your issue, please attach a minimal sample App to reproduce 
the issue.

Original comment by Rodrigo.Ruz.V@gmail.com on 19 Jan 2014 at 4:38

@GoogleCodeExporter
Copy link
Author

Original comment by Rodrigo.Ruz.V@gmail.com on 20 Jan 2014 at 3:27

  • Changed title: Memory leak in Vcl.Styles.Utils.SysStyleHook.pas

@GoogleCodeExporter
Copy link
Author

With one of the last updates the bug ist solved.
You can close this issue.

Original comment by KHJ1...@gmail.com on 22 Jan 2014 at 4:53

@GoogleCodeExporter
Copy link
Author

Original comment by Rodrigo.Ruz.V@gmail.com on 22 Jan 2014 at 4:54

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant