Skip to content

jvm_max_memory parameter is not utilized when signing #38

@billenx

Description

@billenx

I'm trying to sign a >1GB EXE in my github workflow. Here's the relevant section from my YML file:

    # Sign the production Installer
    - name: Sign Countable.Control.Software.Bundle.Setup (SSL.com eSigner)
      uses: sslcom/esigner-codesign@develop
      with:
        command: sign
        username: ${{ secrets.ES_USERNAME }}
        password: ${{ secrets.ES_PASSWORD }}
        totp_secret: ${{ secrets.ES_TOTP_SECRET }}
        credential_id: ${{ secrets.ES_CREDENTIAL_ID }}
        file_path: Countable.Control.Software.Bundle\bin\x64\Release\Countable.Control.Software.Bundle.Setup_${{ steps.versions.outputs.buildVer }}.exe
        override: true
        malware_block: false
        jvm_max_memory: 2048M
        clean_logs: true

I using the jvm_max_memory parameter to increase the amount of memory available to the JVM from 1GB to 2GB, because the signing fails when using the default 1GB of memory with a java.lang.OutOfMemoryError error. However, it seems like the jvm_max_memory parameter is being ignored, because the signing still fails after making the change. Here's the log from the github run:

Run sslcom/esigner-codesign@develop
  with:
    command: sign
    username: ***
    password: ***
    totp_secret: ***
    credential_id: ***
    file_path: Countable.Control.Software.Bundle\bin\x64\Release\Countable.Control.Software.Bundle.Setup_2.1.0.1990.exe
    override: true
    malware_block: false
    jvm_max_memory: 2048M
    clean_logs: true
    environment_name: PROD
    signing_method: v1
  env:
    Solution_Name: Countable.Control.Software.Bundle.sln
    Project_Name_Installer: Countable.Control.Software.Bundle/
    Project_Name_Demo_Installer: Countable.Control.Software.Demo.Bundle/
    JAVA_HOME: C:\hostedtoolcache\windows\Java_Corretto_jdk\11.0.30.7.1\x64
    JAVA_HOME_11_X64: C:\hostedtoolcache\windows\Java_Corretto_jdk\11.0.30.7.1\x64
    JAVA_VERSION: 11
    CODESIGNTOOL_PATH: D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0
    CODE_SIGN_TOOL_PATH: D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0
Input Commands: sign -username="***" -*** -credential_id="***" -totp_secret="***" -input_file_path="Countable.Control.Software.Bundle\bin\x64\Release\Countable.Control.Software.Bundle.Setup_2.1.0.1990.exe" -override=true -malware_block=false
JDK home: C:\hostedtoolcache\windows\Java_Corretto_jdk\11.0.30.7.1\x64
JDK version: 11
JDK is already installed C:\hostedtoolcache\windows\Java_Corretto_jdk\11.0.30.7.1\x64
Archive name: CodeSignTool-v1.3.0, D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0
Write CodeSignTool config file CLIENT_ID=kaXTRACNijSWsFdRKg_KAfD3fqrBlzMbWs6TwWHwAn8
OAUTH2_ENDPOINT=https://login.ssl.com/oauth2/token
CSC_API_ENDPOINT=https://cs.ssl.com/
TSA_URL=http://ts.ssl.com/
TSA_LEGACY_URL=http://ts.ssl.com/legacy to D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0\conf\code_sign_tool.properties
Set CODE_SIGN_TOOL_PATH env variable: D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0
Exec Cmd Content: @echo OFF

set code_sign_tool_path=%CODE_SIGN_TOOL_PATH%

if defined code_sign_tool_path (
%code_sign_tool_path%\jdk-11.0.2\bin\java -Xmx1024M -jar %code_sign_tool_path%\jar\code_sign_tool-1.3.0.jar %*
) else (
.\jdk-11.0.2\bin\java -Xmx1024M -jar .\jar\code_sign_tool-1.3.0.jar %*
)
Shell Cmd: 
Exec Cmd : D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0\CodeSignTool.bat
CodeSigner Command: D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0\CodeSignTool.bat sign -username="***" -*** -credential_id="***" -totp_secret="***" -input_file_path="Countable.Control.Software.Bundle\bin\x64\Release\Countable.Control.Software.Bundle.Setup_2.1.0.1990.exe" -override=true -malware_block=false
Malware scan is: disabled
C:\Windows\system32\cmd.exe /D /S /C "D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0\CodeSignTool.bat sign "-username=***" "-***" "-credential_id=***" "-totp_secret=***" "-input_file_path=Countable.Control.Software.Bundle\bin\x64\Release\Countable.Control.Software.Bundle.Setup_2.1.0.1990.exe" "-override=true" "-malware_block=false""
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.base/java.nio.file.Files.read(Files.java:3152)
	at java.base/java.nio.file.Files.readAllBytes(Files.java:3212)
	at com.ssl.code.signing.tool.commands.SignCommand.run(SignCommand.java:242)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at com.ssl.code.signing.tool.CodeSignTool.main(CodeSignTool.java:39)
Error: The process 'D:\a\Countable.Control.Software.Bundle\Countable.Control.Software.Bundle\codesign\CodeSignTool-v1.3.0\CodeSignTool.bat' failed with exit code 1

Note that the jvm_max_memory parameter is not included in the the Input Commands.

Can you fix this so that the JVM max memory can be increased from the build step?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions