Lazarus

Installation => Windows (32/64) => Topic started by: jstraarup on June 23, 2017, 12:30:47 pm

Title: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 23, 2017, 12:30:47 pm
Hello,

I have a couple of computers that cannot run the Lazarus IDE, or any executables build by Lazarus.

By cannot run, I mean: Nothing appears to be happening, when I run the program.

If I try to start the IDE, it just exits immediately, without anything happening on the screen. No errors, no nothing.
I have tried building an executable with Lazarus, and running it on 6 computers where it works perfectly - and on two machines, where nothing happens at all. All these computers have similar configurations, which confuses the matters even more.

I cannot see anything in "Event viewer", and it does not seem to be blocked by McAfee.

I guess these computers miss some dependencies, or the app is shut down by a security mechanism in my company.

Does anybody have a suggestion on how to proceed?
Are there any relevant log files, or switches I can turn on, to see what is happening?

All the machines run Windows 7 Enterprise 64 bit.

Thank you in advance.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: Handoko on June 23, 2017, 12:41:34 pm
Hello jstraarup,
Welcome to the forum.

Try:
- (Temporary) disable any antivirus and run Lazarus, can it start?
- Restart your computer to safe mode and run Lazarus, can it start?
- Make sure you computer is virus-free.
- What Lazarus version did you use? Try other versions, maybe 32-bit.
- Make sure the checksum of your Lazarus installer never changed. If it changed, your computer may already infected by virus.

Read more:
http://forum.lazarus.freepascal.org/index.php/topic,37244.msg249767.html#msg249767
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: wp on June 23, 2017, 01:07:09 pm
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 23, 2017, 01:23:58 pm
Hi Handoko,

Thank you for the welcome, and thank very much for your quick reply :-)

Unfortunately, I cannot (even temporarily) disable antivirus. This part is outsourced, and out of my management.

Safe mode, might be possible to enter (it varies) - this is a good suggestion. I will try this, when one of the machines are available.

It is unlikely - but of cause not impossible - that the machines are infected with virus, as they have up-to-date antivirus.
And one of the machines where it didn't work, has been locked down since being imaged, without any admin privileges until recently where I removed it, in attempt to debug the problem.

I have also tried with fresh profiles.

I have tried both 32-bit and 64-bit, of the home build executables - but only the mixed package of the IDE.
I will try both individually, but I suspect that I will see the same result.

Regarding the checksum of the installer. I will check it out, but I'm 99.9% sure that it has not been modified.

Thanks again for your suggestions.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 23, 2017, 01:47:03 pm
Hi wp,

I have not installed any additional components on the failing PC's. I have just installed the Lazarus IDE (mixed 32/64bit), and no special configuration of any kind. There are installed other scientific applications, that might ship with different versions of sqlite for instance.

I will take look for packages requiring external DLLs. I think it is very likely that it tries to load wrong DLL, but I did not know about the packagefiles.xml file.

When I have access to a machine, I will also try to run it with the debug switch, and copy the exe from a good machine - to a bad machine.

Excellent suggestions. Thank you very much.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 23, 2017, 01:54:45 pm
Another important point, is that it is not really the IDE that I want to get running.

It is just an application build with Lazarus that needs to run on several machines.

In an attempt to get the app to run, I have installed the Lazarus IDE, because of the hypothesis, that the app was missing a dependency, that would be bundled with the IDE. But then when installing the IDE - it itself would not even run on these machines.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: avra on June 23, 2017, 02:06:01 pm
IDE - it itself would not even run on these machines.
Ask admin to setup antivirus in a way that one directory is excluded from antivirus check. Then test your executables from there. People have experience with all sort of antivirus issues, so it would also help if you say what antivirus is there.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: rvk on June 23, 2017, 02:06:38 pm
Unfortunately, I cannot (even temporarily) disable antivirus. This part is outsourced, and out of my management.
And can you look at the logs of that antivirus to see if it has done something to block Lazarus or your other program?
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: garlar27 on June 23, 2017, 02:34:34 pm
Just a few questions:
It was a fresh install?
Did you have this problem from the first install or did you have the chance to run it once and after installing some components?
Did you try to launch it from console? (sometimes an error message appears)

I'm sorry for not having more ideas but the only thing I can think now are:
   1- problem with previous versions (bad installation).
   2- missing libraries.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 23, 2017, 02:56:52 pm
Yes, I can look at the antivirus logs (McAfee VirusScan Enterprise), to see if it blocks anything, and it does not appear to block anything.
But I can not change any anti-virus settings - and getting a folder excluded, is next to impossible (believe me).

I do not believe this is caused by anti-virus anyway. We have very similar machines, where it works nicely.

I believe it is most likely some DLL mismatch, or deep surveillance software that affects it (but probably the first).

The computers are not available before Monday. So I'll return Monday, with new info.

@garlar27
It was a fresh install of Lazarus IDE - yes. Not the computers.
I have had this problem from the beginning. It never did run on these two machines.

I have not run Lazarus IDE from the console; normally Windows programs do not throw messages to the console in my experience, so I did not try it.
I have tried to run the app in question from the console. Nothing. It just quits.

I have also tried to run it through process explorer - but I have not been able to decipher anything from the output. Seems to just shut down.

I appreciate the surprising amount of nice response to my question :-)
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: taazz on June 23, 2017, 02:59:28 pm
Yes, I can look at the antivirus logs (McAfee VirusScan Enterprise), to see if it blocks anything, and it does not appear to block anything.
But I can not change any anti-virus settings - and getting a folder excluded, is next to impossible (believe me).

I do not believe this is caused by anti-virus anyway. We have very similar machines, where it works nicely.

I believe it is most likely some DLL mismatch, or deep surveillance software that affects it (but probably the first).

The computers are not available before Monday. So I'll return Monday, with new info.

@garlar27
It was a fresh install of Lazarus IDE - yes. Not the computers.
I have had this problem from the beginning. It never did run on these two machines.

I have not run Lazarus IDE from the console; normally Windows programs do not throw messages to the console in my experience, so I did not try it.
I have tried to run the app in question from the console. Nothing. It just quits.

I have also tried to run it through process explorer - but I have not been able to decipher anything from the output. Seems to just shut down.

I appreciate the surprising amount of nice response to my question :-)
use https://github.com/robertmaynard/DependsTester for a bit of more insight.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 23, 2017, 03:19:18 pm
I have tried depends.exe ( http://www.dependencywalker.com/ ), and it did not report any missing DLL's (besides the few, it always says is missing). The result was identical on both a working machine, and a bad machine.

I will give DependsTester a shot though.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: taazz on June 23, 2017, 03:32:05 pm
if it refuses to start and all dependencies are in place then some sort of exception before the main exception handler is in place? In any case I can try to upload somewhere an exe of lazarus 1.4 or 1.6.4 debug build to see if that makes any difference and if it does then you can try to open and debug the IDE it self from lazarus to see where it fails.

By the way there is fpcUpDeluxe (search the forum) as well that can download and build fpc and lazarus from svn you could try that too.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: Handoko on June 23, 2017, 03:45:05 pm
Another important point, is that it is not really the IDE that I want to get running.

It is just an application build with Lazarus that needs to run on several machines.

So did you mean, the applications build using your Lazarus installation cannot run on (some of) the computers?

In this Lazarus Application Gallery, has a list of software built using Lazarus. Some of them provide executable binary, you may try to download the exe and test running on your computer:
http://wiki.freepascal.org/Lazarus_Application_Gallery
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: rvk on June 23, 2017, 03:50:19 pm
I have tried depends.exe ( http://www.dependencywalker.com/ ), and it did not report any missing DLL's (besides the few, it always says is missing). The result was identical on both a working machine, and a bad machine.
It could also be that the DLL's are not missing but the bitness are mismatching.

I just ran dependencywalker on a Lazarus 1.6.4 64 bit with sqlite2laz and I removed the sqlite3.dll from C:\Windows\System32.
To my surprise the one in c:\program files (x86)\embarcadero\studio\18.0\bin\SQLITE3.DLL showed up :D
And that's a 32 bit one  >:D

So check dependencywalker again and make sure all the found DLL's have x64 in the CPU column.
(x86 will be red in that column if a 32 bit version is found, you'll also get the error "Error: Modules with different CPU types were found" in the box below)
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: Thaddy on June 23, 2017, 05:30:53 pm
Again. This is a known problem in the sqlite component that does not load the dll dynamically. I filed a bug some weeks ago.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: Handoko on June 23, 2017, 05:53:50 pm
The OP said he also cannot start Lazarus IDE. Will SQLite dll issue cause Lazarus fails to start?
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: taazz on June 23, 2017, 05:58:07 pm
Again. This is a known problem in the sqlite component that does not load the dll dynamically. I filed a bug some weeks ago.
not really a default installation shows no sqlite3 dependancy. See attachment.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: rvk on June 23, 2017, 06:02:23 pm
Again. This is a known problem in the sqlite component that does not load the dll dynamically. I filed a bug some weeks ago.
Even if this is fixed, it needs to give a proper error message when loading the wrong dll. I see that Delphi is in my search path and that contains the 32 bit version of sqlite3.dll. So even with dynamic loading this would be an issue (although the ide would start).

The OP said he also cannot start Lazarus IDE. Will SQLite dll issue cause Lazarus fails to start?
Yes, an issue with static loading of sqlite3.dll will keep the ide from starting.

Again. This is a known problem in the sqlite component that does not load the dll dynamically. I filed a bug some weeks ago.
not really a default installation shows no sqlite3 dependancy. See attachment.
The default installation shows a lot of other dlls being used. I saw a lot of dlls in the TortoiseSVN directory being used for my installation. And when the wrong bitness is used, this will be an issue too.

Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: taazz on June 23, 2017, 06:11:08 pm
Again. This is a known problem in the sqlite component that does not load the dll dynamically. I filed a bug some weeks ago.
Even if this is fixed, it needs to give a proper error message when loading the wrong dll. I see that Delphi is in my search path and that contains the 32 bit version of sqlite3.dll. So even with dynamic loading this would be an issue (although the ide would start).

The OP said he also cannot start Lazarus IDE. Will SQLite dll issue cause Lazarus fails to start?
Yes, an issue with static loading of sqlite3.dll will keep the ide from starting.

Again. This is a known problem in the sqlite component that does not load the dll dynamically. I filed a bug some weeks ago.
not really a default installation shows no sqlite3 dependancy. See attachment.
The default installation shows a lot of other dlls being used. I saw a lot of dlls in the TortoiseSVN directory being used for my installation. And when the wrong bitness is used, this will be an issue too.
Really? I'm going to uninstall 164 and reinstall it just to be sure but, is it possible what you see is not the default installation but a full installation with all your extra packages? Keep in mind that lazarus does not have dynamic packages yet.

Edit:
  No Sorry a new installation of 1.6.4 shows only those 14 dlls on the first level of linking. Anything beyond that has nothing to do with the IDE check your extra packages.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: avra on June 23, 2017, 11:01:22 pm
Default Lazarus installation does not work, and it does not use DLLs. So your problem is not related to DLLs. If you are not trying to execute 64bit binaries on 32bit Windows, then your antivirus probably finds executables not known to other antivirus users. This is normal since you are a developer and depending on your settings there are too many variations to expect that antivirus knows them all. Even if you change a single component or compile settings your Lazarus IDE or Lazarus built executables will be quite different. That's why antivirus heuristics trigger and that's why some bad antivirus products flag such unknown executables as potential threat and flag them as dangerous preventing their execution. Solution: change antivirus or exclude Lazarus directory and Lazarus built executables from antivirus check.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 26, 2017, 05:06:37 pm
So, now I have played a bit more with one of the machines.

I have tried to boot in "Fail safe" mode, and no luck; same behavior.

Tried to execute lazarus.exe from a Console window. No output.

Tried appending --debug-log=name_of_log_file.txt , but it just outputs an empty file.

The exe files was identical on a working and a non-working machine.

I have tried downloading the "Advanced Password Generator" ( http://wiki.freepascal.org/Lazarus_Application_Gallery#Advanced_Password_Generator ) to test another application. It does not start either.

Tried 64 and 32 bit. No difference.

Did run Dependency Walker again. The bitness of loaded DLLs and Application matches when it is 64 bit (everything is 64 bit).

Disabling/changing antivirus, or excluding a directory is unfortunately not an option. It wouldn't surprise me much, if this was the cause, despite the logs showing nothing relevant.

I cannot afford to spend more time on this issue. So we just agreed, that the users will use the application on a computer, where it works - even though it bugs me a lot, that I could not find a solution :-( and everything, besides Lazarus applications (and Lazarus), seem to work fine.

The application I wanted to run, is a small app that a student at our company wrote. If it turns out they will use it a lot, we will probably just buy new PCs for the users. Or I will rewrite it in a language that I know (it is 450 lines) - then I would be able to support it as well.

Thank you everybody for your suggestions - you are a very friendly and helpful community.

If I can give back with a bug report, or a stack trace (that I can make in a simple way) - I can do that.
I can follow up in my spare time, but I can not borrow the PCs much more.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: Handoko on June 26, 2017, 05:32:35 pm
Do you think it is a hardware issue? Hardware problem doesn't mean it totally blank and cannot start. Sometimes it can start normally, it just a bit weird than normal.

I am a computer technician, if I were in front of that computer I will do:

- Do a disk check, drive C: only is enough. I ever encountered some weird cases, which are similar than yours. I solved them by running disk check (scandisk) and let it fix the file allocation error. To do it:
Right-click on your C: drive > Properties > Tools  > Check Now > Schedule disk check.

- Try running some programs on that computer to see if it runs them properly. You can run Winamp, playing some music, watching some videos, running some MS Office programs, etc. Are all the programs able to run properly?

- Do you have Linux live CD? You can download it easily from Internet. Burn it to a CD and start you computer by booting from that CD. Most computers are capable to run Linux live CD without problem, except (but very rare) some hardwares (usually VGA) have problem with the Linux. If you can start the live CD properly, your computer is okay on the hardware side.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: Thaddy on June 26, 2017, 05:33:29 pm
The OP said he also cannot start Lazarus IDE. Will SQLite dll issue cause Lazarus fails to start?
YES!
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 26, 2017, 06:20:13 pm
No, I am absolutely positive that this is a software issue.

All other programs works fine. Even though I have not tried, a check disk is unlikely to help in this case.

I am not going to test with a Linux live image - but it would work fine (I use Linux exclusively on my private computers, so nothing against it).

@Thaddy
A program compiled with FPC from Lazarus (complete default settings), which does not have any use what-so-ever for sqlite - will it require, or try to load sqlite? If so, can I disable it?
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: Thaddy on June 26, 2017, 06:25:34 pm
No, I am absolutely positive that this is a software issue.

All other programs works fine. Even though I have not tried, a check disk is unlikely to help in this case.

I am not going to test with a Linux live image - but it would work fine (I use Linux exclusively on my private computers, so nothing against it).

@Thaddy
A program compiled with FPC from Lazarus (complete default settings), which does not have any use what-so-ever for sqlite - will it require, or try to load sqlite? If so, can I disable it?

If you enabled it in the IDE at some point and you don't have it installed, yes, you should disable the sqlite components. ALL of them. Or install sqlite properly on a path.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: taazz on June 26, 2017, 06:26:47 pm
have you tried different folders? If not, try something extremely simple like "c:\laz" use only english characters with out spaces.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 26, 2017, 07:01:00 pm
...
If you enabled it in the IDE at some point and you don't have it installed, yes, you should disable the sqlite components. ALL of them. Or install sqlite properly on a path.
I have not enabled it. Everything is out-of-the-box default settings. I don't even know, where the components section is in the IDE :-)

When I go to work tomorrow, I'll try to find it, and disable it if it is enabled. And maybe disable as many components as possible.
I assume a component represents the possibility to use some specific features, and by enabling a component, you dynamically link to a specific shared library implicitly. Some components, can probably also by compiled in?!

have you tried different folders? If not, try something extremely simple like "c:\laz" use only english characters with out spaces.
I have tried to run the program I want to run, from many different places , but not the IDE.
I assume the IDE and the Lazarus program suffers from the same underlying issue, and the main issue is getting the app to run.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: Martin_fr on June 26, 2017, 07:10:45 pm
In any order, maybe start with 2...

1) Try to copy your lazarus install (the entire lazarus dir) into c:\program files or wherever win 7 expects software.

2) See if you can run gdb (from commandline)

in the lazarus directory, run
mingw\i386-win32\bin\gdb.exe lazarus.exe

then (at the gdb prompt) type
r

See what happens, and or if you get any error.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 26, 2017, 07:44:02 pm
@Martin_fr
Thank you very much. I will try this.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: jstraarup on June 27, 2017, 05:36:57 pm
Finally! I have found the problem :-)

GDB immediately told me that it could not load some DLLs, and segfaulted.

The non-existing DLLs appears to be leftovers, from an old version of the surveillance application called "Digital Guardian".
It is some crap-ware that injects itself deep into the OS, and monitors all sort of stuff, like file transference.

It is very likely that a white-list exists, and this could be why all our "normal" programs was working perfectly.

I have yet to find a way to fix it, but now I can at least blame a borked installation of "Digital Guardian".

In any case, it is reason enough to justify giving any user with the problem a new PC. Which is likely to be the solution.

Thanks to everybody for the input, and especially to you Martin, for pointing me in the right direction. Much appreciated.
Title: Re: Lazarus IDE won't start on Windows 7 64bit
Post by: rvk on June 28, 2017, 10:44:06 am
It is some crap-ware that injects itself deep into the OS, and monitors all sort of stuff, like file transference.
And your state of the art "unmanageable" anti-virusscanner didn't pick up on that?  :P :P

Glad we now have a method to debug such things.
That was a good idea Martin.

TinyPortal © 2005-2018