#1 2016-11-16 10:23:58

bic_223
Member
Registered: 2016-11-15
Posts: 8

AV at uninstall RTL package that include SynPdf loading gdiplus.dll

An very serious AV error when uninstall packages which I meet in our RTL libraries, which also include SnyPdf.pas/SynGDIPlus.pas;
because SynPdf's initialization loading gdiplus.dll.

My suggestion it's to include an condition about ModuleIsPackage at least or ModuleIsLib in SynPdf.pas initialization for that loading of GdiPls.dll, to avoid loading gdiplus.dll library in IDE design time, but just in runtime:
initialization
  {$ifdef USE_SYNGDIPLUS}
  // initialize the Gdi+ library if necessary
  if not ModuleIsPackage then // or if not ModuleIsLib <<<<<< Here <<<<<<<<<<<<<<<<<<<<<<<<<<<<
    if Gdip=nil then
      Gdip := TGDIPlus.Create('gdiplus.dll');
  {$endif}


Details:
Rare but annoying error which happens occasionally, but only in IDE, not also in runtime execution, just when package uninstall so also when recompile/open projects(which also have checked or not some installed packages).
But error, also even in those cases, it happens time by time; so hard to find which code source file do this, because the error apparent changes/removing programming code which cause the it moves at times in another place, as error are running from me, making me loose a lot of time ti find it. And anyway the real cause even isn't there, in my code which I delete to make error disappear, anytime another part of code.
Until I found without cut the code, but revert versions, until the exact day 12.06.2015: when our SynPdf was updated again at Version 1.18 +, after I repaired it once 2 years ago, after another 5 months of errors, but I forgot about it, and now we had same error since 1 year and 5 months, since last our update I said previous.
To avoid error in without change your code again and loose it at next update, I was needed to include NO_USE_SYNGDIPLUS directive in my packaged. But it isn't normal and who don't know about and don't know how to find it, will have more trouble cutting the own code and don't find it.

Offline

#2 2016-11-16 16:02:32

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: AV at uninstall RTL package that include SynPdf loading gdiplus.dll

Did you try to set the USE_PACKAGE?

Offline

#3 2016-11-18 08:23:51

bic_223
Member
Registered: 2016-11-15
Posts: 8

Re: AV at uninstall RTL package that include SynPdf loading gdiplus.dll

I don't see any USE_PACKAGE, but, as I said, I just used NO_USE_SYNGDIPLUS.
But it's still a bug, as I said: I didn't knew about and I overstayed because this issue.
I said:  But it isn't normal and who don't know about and don't know how to find it, will have more trouble cutting the own code and don't find it. Means everyone who are using it in package will have same issue and will can't find cutting own code until error disappear, because error move time by time and then don't find it because the cause it is in totally another place, in your SynPdf loading gdiplus.dll.
I just proposed to include an if ModuleIsLib there or at least ModuleIsLibary for all those who don't know about.

Thank you.

Offline

#4 2016-11-18 12:17:23

bic_223
Member
Registered: 2016-11-15
Posts: 8

Re: AV at uninstall RTL package that include SynPdf loading gdiplus.dll

Oh.
I see.
I looked for .inc files, I find synopse.inc and there not any USE_PACKAGES, but USEPACKAGES.

1: But this USEPACKAGES isn't do what need: to avoid SynPdf load of gdiplus.dll. I't don't avoit this, just  NO_USE_SYNGDIPLUS are doing this, but WHO KNOW ABOUT, because who don't know will search an error where it appear but it isn't there.

I read a lot of your synopse.inc and syncommons.pas files for directives and I found that:

2: Shortly: DOPATCHRTL isn't default, so I didn't knew that I don't use it for System.FillChar, Move,CopyRecord, FinalizeRecord/InitializeRecord optimisations.

3: The fact that, if not defined DOPATCHRTL, it is also defines EXPECTSDELPHIRTLRECORDCOPYCLEAR it's normal;
But the fact that EXPECTSDELPHIRTLRECORDCOPYCLEAR it is also defined for defined UsePackages isn't good for implementation of RecordClear/RecordCopy if I want use DOPATHCRTL also , because implements same functions twice. All those because of 4:.

4: Also I can't use it SynPdf in my library if I use only dcu of my library in compile of my projects (as Delphi/Lib for dcu's and Source/Rtl or vcl for .pas), to compile them often quicker.
This is so as long as DOPATCHRTL don't work packaged, only if NOVARCOPYPROC to avoid "[DCC Error] E2201 Need imported data reference ($G) to access 'VarCopyProc' from unit 'SynCommons'" you said, actually: "from unit 'System'", compiler error, which already loose direct use of VarCopyProc optimization, if it is used in package,.. and also let rest of patches in packages which I don't know if it works.
4': But much more: UsePachages actually don't avoid any: "[DCC Error] E2201 Need imported data reference ($G) to access 'VarCopyProc from unit 'System'" compiler error, just NOVARCOPYPROC.

5: In plus, ENHANCEDRTL don't cancel the redirects of in memory patch from SynCommons.RedirectCode for System.FillChar, Move, CopyRecord, FinalizeRecord/InitializeRecord, even it this means they already optimized directly hooked in system.dcu, which also give me another errors, but I'll post them in Enanced RTL category.

Offline

#5 2016-11-24 14:14:36

bic_223
Member
Registered: 2016-11-15
Posts: 8

Re: AV at uninstall RTL package that include SynPdf loading gdiplus.dll

No one answer to me?
Sorry If I wrote so.

Offline

Board footer

Powered by FluxBB