limelect 48 Posted September 28, 2023 Okay guys I am still very curious so I made this program information here https://www.swissdelphicenter.ch/en/showcode.php?id=1302 Same source different PE data I do not really know why the compiler makes 2 different execute on the same source but definitely, there is a difference As you can see.. Share this post Link to post
DelphiUdIT 176 Posted September 28, 2023 When you build a project, every build (exe) is different (may be some fuzzy data ? or some timestamp inside ?). I think that should be some $DEF or some magic setting to send to compiler or linker to produce the same "exe". Share this post Link to post
Sherlock 663 Posted September 28, 2023 The larger is a debug build, the smaller isn't. Why the debug build does not run as expected, whereas the release build does, is just a matter of checking the different build settings. Share this post Link to post
Anders Melander 1783 Posted September 28, 2023 5 minutes ago, limelect said: I do not really know why the compiler makes 2 different execute on the same source but definitely, there is a difference Do you use madExcept, Eurekalog, or something like that? It could be that something modifies the exe post-link. It could also just be something not so nice adding its own payload to your application... Share this post Link to post
limelect 48 Posted September 28, 2023 The time stamp is reasonable. Both projects are debug Share this post Link to post
limelect 48 Posted September 28, 2023 No. the project has basically the 2 lines shown in the beginning Nothing special. Guys be aware that the source is the SAME. Nothing else procedure TForm1.fillLists; var i, k: Integer; str, str2: TStringList; begin ListBox1.Clear; ListBox2.Clear; str := TStringList.Create; str2 := TStringList.Create; FDConnection1.GetTableNames('', '', '', str, [osMy, osOther], [tkTable], False); for I := 0 to str.Count - 1 do begin ListBox1.Items.Add(str); ListBox2.Items.Add('Fields of Table ' + str); ListBox2.Items.Add('---------------'); FDConnection1.GetFieldNames('', '', str, '', Str2); for k := 0 to str2.Count - 1 do ListBox2.Items.Add(Str2[k]); ListBox2.Items.Add(''); end; str.Free; str2.Free; end; So simple it baffled me. Share this post Link to post
Anders Melander 1783 Posted September 28, 2023 Just now, Anders Melander said: It could be that something modifies the exe post-link If you can, try to determine the type and content of the extra PE section. Share this post Link to post
limelect 48 Posted September 28, 2023 How ? in the IDE? the whole thing started by compiling the same source Into 2 different directories. P.S. very important. The problematic directory originally worked without any problems I came back to it after a few weeks then it happened. Furthermore, the program was on the backup so I could check. Share this post Link to post
Anders Melander 1783 Posted September 28, 2023 https://petoolse.github.io/petools/ Share this post Link to post
limelect 48 Posted September 28, 2023 Everybody says that Delphi IDE is almost foolproof and the source is the problem. I say no. Since it never happened to me I say the compiler is the problem. Why? I do not know. Share this post Link to post
limelect 48 Posted September 28, 2023 (edited) Thanks throw std::exception(“PE Tools source code is not available”); maybe there is No files No source Too simple what I did is much better Edited September 28, 2023 by limelect Share this post Link to post
Anders Melander 1783 Posted September 28, 2023 18 minutes ago, limelect said: Thanks throw std::exception(“PE Tools source code is not available”); maybe there is No files No source Too simple what I did is much better I have no idea about what you are trying to say here. I don't speak Haiku... 1 Share this post Link to post
DelphiUdIT 176 Posted September 28, 2023 (edited) These are the differences between two builds ( near 30 seconds between): Like I told every builds produce different executables (release profile). Edited September 28, 2023 by DelphiUdIT Share this post Link to post
Anders Melander 1783 Posted September 28, 2023 3 minutes ago, DelphiUdIT said: Like I told every builds produce different executables. Yes, but not that different. There's a difference of 14,307,328 bytes between his two files and one of them has an extra PE section... Anyway, if he can't be bothered to compare the files in a proper tool and tell us what that extra section contains, then I think I'll spend my time on something else; The lawn needs mowing. Share this post Link to post
limelect 48 Posted September 28, 2023 Guys all I say same source different directory One directory gives a bad exe that's it. I do not understand what is not so clear Share this post Link to post
limelect 48 Posted September 28, 2023 (edited) yes. It is a portable computer that goes with me everywhere. So it restarts for almost every few days. it is a Lenovo server very powerful. I started this program out of a need for a project. So it worked in this directory. Edited September 28, 2023 by limelect Share this post Link to post
Anders Melander 1783 Posted September 28, 2023 It is a portable computer that goes with me everywhere. So it restarts for almost every few days. it is a Lenovo server very powerful. One of these things is not like the other. One of these things doesn't belong... Share this post Link to post
limelect 48 Posted September 29, 2023 (edited) OK, guys good news and bad news. It is a window problem and Delphi Taking the bad program to a good location it works. Edited September 29, 2023 by limelect Share this post Link to post
limelect 48 Posted September 29, 2023 It seems that a window directory is the problem and Delphi does not help since this instruction FDConnection1.GetTableNames('', '', '', str, [osMy, osOther], [tkTable], false); return 0; The "bad" directory used to be the original directory Share this post Link to post
Attila Kovacs 629 Posted September 29, 2023 can you spot here your exe or path? Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers Share this post Link to post
Attila Kovacs 629 Posted September 29, 2023 What DB are you using? Does it have a logfile? Can it be turned into verbose mode? Share this post Link to post
limelect 48 Posted September 29, 2023 I am baffled. Now the bad is good. The original directory works.!!!!! If there is GOD he fixes things. And suddenly things work. what a field I chose. Thanks, everybody. Share this post Link to post