vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[openssl] Build error: Access violation

Open john-hen opened this issue 3 years ago • 8 comments

Package: openssl[core]:x64-windows -> 3.0.5#2 Host Environment

  • Host: x64-windows
  • Compiler: MSVC 19.29.30133.0
  • vcpkg-tool version: 2022-07-21-a0e87e227afb536c62188c11ad029954f28fdb22 vcpkg-scripts version: 52b660425 2022-08-04 (14 hours ago)

To Reproduce vcpkg install openssl:x64-windows

Failure logs

-- Using cached openssl-openssl-openssl-3.0.5.tar.gz.
-- Extracting source C:/temp/repos/vcpkg/downloads/openssl-openssl-openssl-3.0.5.tar.gz
-- Applying patch C:/temp/repos/vcpkg/ports/openssl/windows/flags.patch
-- Using source at C:/temp/repos/vcpkg/buildtrees/openssl/src/nssl-3.0.5-df50913d32.clean
-- Found external ninja('1.10.2').
-- Getting CMake variables for x64-windows
-- Copying openssl release source files...
-- Copying openssl release source files... done
-- Configure x64-windows-rel
-- Configure x64-windows-rel done
-- Build x64-windows-rel
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:96 (message):
    Command failed: C:/temp/repos/vcpkg/downloads/tools/jom/jom-1.1.3/jom.exe -j 1 -f makefile install_sw install_ssldirs
    Working Directory: C:/temp/repos/vcpkg/buildtrees/openssl/x64-windows-rel
    Error code: Access violation
    See logs for more information:
      C:\temp\repos\vcpkg\buildtrees\openssl\build-x64-windows-rel-1-err.log

Call Stack (most recent call first):
  ports/openssl/windows/portfile.cmake:104 (vcpkg_execute_required_process)
  ports/openssl/portfile.cmake:36 (include)
  scripts/ports.cmake:147 (include)



C:\temp\repos\vcpkg\buildtrees\openssl\build-x64-windows-rel-1-err.log

jom 1.1.3 - empower your cores

Additional context

john-hen avatar Aug 05 '22 16:08 john-hen

Check your antivirus software

Osyotr avatar Aug 05 '22 20:08 Osyotr

It's Windows Defender, if anything. I have no other anti-virus software installed.

I get the same error as above on two different machines. One, my PC laptop with Windows 10 running natively. The other, a Windows 10 virtual machine running via Parallels Desktop on my Intel-based Mac from work.

The latter Windows installation in particular is basically pristine. I only set it up recently and have barely any software installed other than what ships with the system, plus Visual Studio. And Git (for Windows) of course, needed to install vcpkg, and which does come with its own OpenSSL library when accepting the default installation options.

john-hen avatar Aug 05 '22 23:08 john-hen

Thanks for posting this issue. Could you please confirm that your problem is the same as #25097?

LilyWangLL avatar Aug 08 '22 06:08 LilyWangLL

@LilyWangLL Thanks for your feedback. Yes, I also get a build error if I try to install tesseract as in the other issue. The build error I get then is the same as here (Error code: Access violation), whereas for the user there it said Error code: 2. I already have the TMP environment variable set, it points to LOCAL\TEMP in my %APPDATA% folder, so the Stack Overflow question linked there was no help.

john-hen avatar Aug 08 '22 09:08 john-hen

@LilyWangLL Thanks for your feedback. Yes, I also get a build error if I try to install tesseract as in the other issue. The build error I get then is the same as here (Error code: Access violation), whereas for the user there it said Error code: 2. I already have the TMP environment variable set, it points to LOCAL\TEMP in my %APPDATA% folder, so the Stack Overflow question linked there was no help.

If this, you could close Windows Defender and try install openssl again.

LilyWangLL avatar Aug 08 '22 09:08 LilyWangLL

Also no joy. I deactivated the built-in virus protection, and it still fails. The problem seems to be that

C:\vcpkg\downloads\tools\jom\jom-1.1.3\jom.exe -j 1 -f makefile install_sw

crashes with an access violation.

john-hen avatar Aug 08 '22 11:08 john-hen

So I checked out an earlier release tag, 2022.02.23, and with that it worked fine.

git clean -xfd
git switch 2022.02.23 --detach
bootstrap-vcpkg.bat
vcpkg install openssl:x64-windows

I had turned virus protection back on, that didn't interfere. Curiously, this also uses this jom tool in version 1.1.3. So it's not the tool itself, maybe something in the makefile? Anyway, I'll go with the earlier vcpkg release.

john-hen avatar Aug 08 '22 12:08 john-hen

I can be sure that this issue is related to the anti-virus or some other process.

The reason that earlier versions didn't have this issue may be that some unsafe code (which can caused the AV blocked this process) was not added to the source code.

JackBoosY avatar Aug 09 '22 07:08 JackBoosY

Ping @Osyotr for response, does this issue resolved by closing the anti-virus?

LilyWangLL avatar Aug 30 '22 06:08 LilyWangLL

Ping @Osyotr for response, does this issue resolved by closing the anti-virus?

I don't have the issue. I was just pointing out that access violation errors usually come from antivirus software. Issue author confirmed that this is not the case.

Osyotr avatar Aug 30 '22 09:08 Osyotr

Sorry, I ping the wrong person.😔 The correct is: Ping @john-hen for response, does this issue resolved by closing the anti-virus?

LilyWangLL avatar Aug 30 '22 09:08 LilyWangLL

No, it didn't. See my earlier comment:

Also no joy. I deactivated the built-in virus protection, and it still fails.

john-hen avatar Aug 30 '22 09:08 john-hen

I can be sure that this issue is related to the anti-virus or some other process.

The reason that earlier versions didn't have this issue may be that some unsafe code (which can caused the AV blocked this process) was not added to the source code.

Could you please use process monitor to double check which process is blocking this?

LilyWangLL avatar Aug 30 '22 09:08 LilyWangLL

I have no idea how to do that. Also, so far nobody has commented that they could reproduce the error. In light of that, I would suggest to close this issue as "not reproducible".

john-hen avatar Aug 30 '22 09:08 john-hen

There's also #25107

Osyotr avatar Aug 30 '22 09:08 Osyotr

Thanks for your reply. I temporarily closed this issue as "not reproducible", if anyone has better suggestions, you can reopen this issue.

LilyWangLL avatar Aug 30 '22 09:08 LilyWangLL

There's also #25107

Yep, this is identical to the situation I was having. For some reason jom really hates ConEmu based terminals. For reproducing the error, just run vcpkg install openssl under ConEmu or Cmder.

whamer100 avatar Sep 17 '22 07:09 whamer100

So I checked out an earlier release tag, 2022.02.23, and with that it worked fine.

git clean -xfd
git switch 2022.02.23 --detach
bootstrap-vcpkg.bat
vcpkg install openssl:x64-windows

I had turned virus protection back on, that didn't interfere. Curiously, this also uses this jom tool in version 1.1.3. So it's not the tool itself, maybe something in the makefile? Anyway, I'll go with the earlier vcpkg release.

This is a good way for now building error in openssl, just back to 1.1.1m.

xyc19970716 avatar Sep 18 '22 15:09 xyc19970716

Now i find that we do not use chinese username on windows, everything well.

xyc19970716 avatar Sep 21 '22 10:09 xyc19970716

Now i find that we do not use chinese username on windows, everything well.

Oh, I remember jom has an issue about using temp path (%TEMP%) that contains non-ascii or blank space.

JackBoosY avatar Sep 22 '22 02:09 JackBoosY

I have the same problem

yuanbaopapa avatar Oct 18 '22 10:10 yuanbaopapa

vcpkg install openssl

Computing installation plan... The following packages will be built and installed: openssl[core]:x64-windows -> 3.0.5#5 Detecting compiler hash for triplet x64-windows... -- Using HTTP(S)_PROXY in environment variables. Restored 0 package(s) from C:\Users\owner\AppData\Local\vcpkg\archives in 460.1 us. Use --debug to see more details. Installing 1/1 openssl:x64-windows... Building openssl[core]:x64-windows... -- Using cached openssl-openssl-openssl-3.0.5.tar.gz. -- Cleaning sources at E:/dev/common/tools/vcpkg/buildtrees/openssl/src/nssl-3.0.5-df50913d32.clean. Use --editable to skip cleaning for the packages you specify. -- Extracting source E:/dev/common/tools/vcpkg/downloads/openssl-openssl-openssl-3.0.5.tar.gz -- Applying patch E:/dev/common/tools/vcpkg/ports/openssl/windows/flags.patch -- Using source at E:/dev/common/tools/vcpkg/buildtrees/openssl/src/nssl-3.0.5-df50913d32.clean -- Found external ninja('1.10.2'). -- Getting CMake variables for x64-windows -- Copying openssl release source files... -- Copying openssl release source files... done -- Configure x64-windows-rel -- Configure x64-windows-rel done -- Build x64-windows-rel CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:96 (message): Command failed: E:/dev/common/tools/vcpkg/downloads/tools/jom/jom-1.1.3/jom.exe -j 1 -f makefile install_sw install_ssldirs Working Directory: E:/dev/common/tools/vcpkg/buildtrees/openssl/x64-windows-rel Error code: Access violation See logs for more information: E:\dev\common\tools\vcpkg\buildtrees\openssl\build-x64-windows-rel-1-err.log

Call Stack (most recent call first): ports/openssl/windows/portfile.cmake:104 (vcpkg_execute_required_process) ports/openssl/portfile.cmake:36 (include) scripts/ports.cmake:147 (include)

error: building openssl:x64-windows failed with: BUILD_FAILED error: Please ensure you're using the latest port files with git pull and vcpkg update. Then check for known issues at: https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+openssl You can submit a new issue at: https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[openssl]+Build+error Include '[openssl] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above. vcpkg-tool version: 2022-10-12-b586c2752f75bcc3f6a243749e9a0d94d0d93ccd vcpkg-scripts version: 79fa9d85c 2022-10-17 (19 hours ago)

Please use the prefilled template from E:\dev\common\tools\vcpkg\installed\vcpkg\issue_body.md when reporting your issue.

yuanbaopapa avatar Oct 18 '22 10:10 yuanbaopapa

E:\dev\common\tools\vcpkg\buildtrees\openssl\build-x64-windows-rel-1-err.log has the following content:

jom 1.1.3 - empower your cores

yuanbaopapa avatar Oct 18 '22 11:10 yuanbaopapa

@yuanbaopapa see https://github.com/microsoft/vcpkg/issues/25107

Osyotr avatar Oct 18 '22 17:10 Osyotr

I have the same problem when build Qt with vcpkg. Any tool included in vcpkg is buggy.

goodguysoft avatar Nov 15 '22 10:11 goodguysoft

Now i find that we do not use chinese username on windows, everything well.

Oh, I remember jom has an issue about using temp path (%TEMP%) that contains non-ascii or blank space.

Can someone transform this into a reproducable copy-and-paste example with a minimal synthetical Makefile? I tried and failed, with a European PC setup.

Note that openssl now falls back to nmake again when jom fails in certain ways. And you can even avoid jom with VCPKG_MAX_CONCURRENCY=1. But AFAICT this pattern doesn't apply to Qt.

dg0yt avatar Nov 15 '22 19:11 dg0yt