question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Signing large MSI files fails

See original GitHub issue

Hi, I tried to use Jsign to sign a large MSI file (311MB), it fails with the following Exception:

[ec2-user@ip-172-31-35-244 original_jsign]$ jsign -s key.jks --storepass 123456 -storetype jks -a EKM ~/ekm-2.0_large.msi Adding Authenticode signature to /home/ec2-user/ekm-2.0_large.msi jsign: Couldn't sign /home/ec2-user/ekm-2.0_large.msi java.lang.RuntimeException: java.io.IOException: Map failed at net.jsign.poi.poifs.filesystem.POIFSStream$StreamBlockByteBufferIterator.next(POIFSStream.java:170) at net.jsign.poi.poifs.filesystem.POIFSStream$StreamBlockByteBufferIterator.next(POIFSStream.java:142) at net.jsign.msi.MSIFile.computeDigest(MSIFile.java:180) at net.jsign.msi.MSIFile.createIndirectData(MSIFile.java:199) at net.jsign.AuthenticodeSigner.createSignedData(AuthenticodeSigner.java:368) at net.jsign.AuthenticodeSigner.sign(AuthenticodeSigner.java:339) at net.jsign.SignerHelper.sign(SignerHelper.java:424) at net.jsign.JsignCLI.execute(JsignCLI.java:111) at net.jsign.JsignCLI.main(JsignCLI.java:40) Caused by: java.io.IOException: Map failed at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:938) at net.jsign.poi.poifs.nio.FileBackedDataSource.read(FileBackedDataSource.java:95) at net.jsign.poi.poifs.filesystem.POIFSFileSystem.getBlockAt(POIFSFileSystem.java:427) at net.jsign.poi.poifs.filesystem.POIFSStream$StreamBlockByteBufferIterator.next(POIFSStream.java:166) ... 8 more Caused by: java.lang.OutOfMemoryError: Map failed at sun.nio.ch.FileChannelImpl.map0(Native Method) at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:935) ... 11 more

Signing a small file of 4MB completes successfully. Is there any size limitation of MSI files that can be signed? If so, what is it? Thanks in advance

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ebourgcommented, Aug 13, 2021

Indeed the channel doesn’t work, my test case was incomplete. Thank you for checking. Let’s use two POIFSFileSystems then.

0reactions
yaegorcommented, Aug 13, 2021

I’ve tried the read/write separation solution and it works for me OK for large files under Linux. This solution also seems to fix signing MSI when running under 32 bit JVM under Windows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FIX: Error message when you try to install a large Windows ...
This problem occurs if the Windows Installer process has insufficient contiguous virtual memory to verify that the .msi package or the .msp package...
Read more >
Problem Signing Large MSI file | TechTalkz.com
I have created a large MSI database (1.32GB) using Installshield 2008 and it failed on signing the MSI. Fair enough, I thought, a...
Read more >
Error signing MSI package - Flexera Community
Recently I started getting errors about signing the .msi package when building installation. Before anyone suggests invalid certificate or.
Read more >
[WiX-users] cannot sign large .msi file
When I try to sign it using signtool.exe, I get this: The following certificate was selected: Issued to: MyCompany Inc. ... An error...
Read more >
When trying to install a MSI, the following error message ...
This is an issue with Microsoft. This problem occurs if the Windows Installer process has insufficient contiguous virtual memory to verify that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found