Code Monkey home page Code Monkey logo

Comments (8)

ebourg avatar ebourg commented on August 27, 2024

How large is the msi file signed? Did you get an exception?

from jsign.

borjafg avatar borjafg commented on August 27, 2024

The size of the file is 86 Mb. I signed it with a 32-bit jdk and the signing failed but it worked with a 64-bit jdk.

The ant task didn't print the cause of the error so I had to run the maven test to get the stacktrace.

Stacktrace (32-bit jdk):

java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1603)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:334)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
at org.apache.maven.surefire.booter.ForkedBooter.launchLastDitchDaemonShutdownThread(ForkedBooter.java:369)
at org.apache.maven.surefire.booter.ForkedBooter.acknowledgedExit(ForkedBooter.java:333)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:145)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)

Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1603)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:334)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
at org.apache.maven.surefire.booter.ForkedBooter.launchLastDitchDaemonShutdownThread(ForkedBooter.java:369)
at org.apache.maven.surefire.booter.ForkedBooter.exit(ForkedBooter.java:316)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:425)

from jsign.

ebourg avatar ebourg commented on August 27, 2024

The error comes from surefire not being able to create threads to tun the tests. Unless Apache POI, which is used for the msi signing, creates a ton of threads I fail to see what could cause this. Does it happen if you run the test in isolation (using mvn test -Dtest=*NameOfTheTestClass*#nameOfTheTest) ? What is your OS?

from jsign.

borjafg avatar borjafg commented on August 27, 2024

OS: Windows 10

32-bit JDK

image

Same error.

The ant task shows a default message for every error so I don't know if the cause of the error is the same in both cases ("maven test" and "ant execution").

from jsign.

ebourg avatar ebourg commented on August 27, 2024

Could you try closing your IDE and running the test from the command line?

from jsign.

borjafg avatar borjafg commented on August 27, 2024

Result of execution from the command line.

mvn -Dtest=MSISignerTest#testSign test


[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] MSISignerTest.testSign:57 ยป Runtime java.io.IOException: Map failed
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.595 s
[INFO] Finished at: 2020-03-05T10:55:56+01:00
[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project jsign-core: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\MY_USER\Documents\GitHub\jsign\jsign-core\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] Error occurred in starting fork, check output in log
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: Error occurred in starting fork, check output in log
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:622)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


Content of file "TEST-net.jsign.MSISignerTest"

java.lang.RuntimeException: java.io.IOException: Map failed
    at net.jsign.MSISignerTest.testSign(MSISignerTest.java:57)

Caused by: java.io.IOException: Map failed
    at net.jsign.MSISignerTest.testSign(MSISignerTest.java:57)

Caused by: java.lang.OutOfMemoryError: Map failed
    at net.jsign.MSISignerTest.testSign(MSISignerTest.java:57)

from jsign.

ebourg avatar ebourg commented on August 27, 2024

Did you try signing the same file from the command line, without using Maven?

from jsign.

borjafg avatar borjafg commented on August 27, 2024

java -jar .\JSign\jsign-3.1.jar --keystore "./Key Stores/mykeyStore.p12" --storepass ####### --storetype ##### --alias ##### test.msi

Result:

Adding Authenticode signature to test.msi
jsign: Couldn't sign test.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

Try `java -jar jsign.jar --help' for more information.

from jsign.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.