Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Issues
  • #2712
Closed
Open
Issue created Jun 15, 2022 by reevesg@reevesg

zip64 self executing jar issue

We've run into an issue where are jars no longer work if they cross the zip64 threshold and also use a self executing bash script that is appended to the start of the archive. When trying to inspect the contents of the archive we get an error such as

jar -tf  buck-out/gen/src/myselfexecutingjar                                                          
java.util.zip.ZipException: invalid CEN header (bad signature)                                                                                                                                            
        at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1607)                                                                                                                               
        at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1557)                                                                                                                              
        at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1308)                                                                                                                               
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1271)                                                                                                                                  
        at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:733)                                                                                                                     
        at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850)                                                                                                                        
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:248)                                                                                                                                       
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:177)                                                                                                                                       
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:148)

zip-info highlights the problem as

zipinfo -v buck-out/gen/src/myselfexecutingjar  | less                                                                                                   
[buck-out/gen/src/od-transform/od-transform]                                                                                                                                                              
error: End-of-centdir-64 signature not where expected (prepended bytes?)                                                                                                                                  
  (attempting to process anyway)                                                                                                                                                                          
warning [buck-out/gen/src/myselfexecutingjar]:  1020 extra bytes at beginning or within zipfile 
...

1020 bytes is what we are prepending to the archive and if I add this to the offset in the zip64 EOCD record it works.

Assignee
Assign to
Time tracking