Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split packages have different signatures #2335

Closed
kysmith-csg opened this issue Sep 11, 2024 · 8 comments
Closed

Split packages have different signatures #2335

kysmith-csg opened this issue Sep 11, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@kysmith-csg
Copy link

For licensing reasons, we must run an obfuscator in our code which goes through the bytecode of all our dependencies. After updating to the latest Eclipse 4.33 I am getting the following error:

java.lang.SecurityException: class "org.eclipse.jface.text.TextViewer"'s signer information does not match signer information of other classes in the same package
        at java.base/java.lang.ClassLoader.checkCerts(ClassLoader.java:1173)
        at java.base/java.lang.ClassLoader.preDefineClass(ClassLoader.java:917)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1025)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:714)
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
        at java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:872)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at java.base/java.lang.Class.getDeclaredFields0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3473)
        at java.base/java.lang.Class.getDeclaredFields(Class.java:2542)

This seems related to the discussion here: #2044.

The bundle org.eclipse.text hasn't had an update since the previous release 4.32 (build qualifier is 20240524), but org.eclipse.jface.text has (qualifier 20240816). I think this might've just been the first error that happened, but I expect that the same error would happen with the other split packages.

Is there anything we can do to fix this? Otherwise it seems we won't be able to update to the latest Eclipse.

@kysmith-csg kysmith-csg added the bug Something isn't working label Sep 11, 2024
@merks
Copy link
Contributor

merks commented Sep 11, 2024

I think you're kind of hosed. I was not keeping track that we have yet more split packages than I was considering, being focused mostly on the core runtime parts.

We really need some type of automated test for split-packages-with-different-signatures. 😭 But of course who wants to work on that or pay for that?

@mickaelistria
Copy link
Contributor

One possible solution is to just abandon jarsigner in Platform and go fully PGP.

@akurtakov
Copy link
Member

One possible solution is to just abandon jarsigner in Platform and go fully PGP.

I can only second that. Jarsigner is causing more trouble than it's worth.

@merks
Copy link
Contributor

merks commented Sep 12, 2024

A preliminary test suggests that the following packages are split across bundles with different signing certificates in the current 4.34 I-builds:

  • org.osgi.service.log:1.5.0
    • org.eclipse.osgi 3.21.0.v20240717-2103
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
    • org.eclipse.osgi.services 3.12.100.v20240327-0645
      • {CN=Eclipse.org Foundation, Inc., OU=IT, O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2022-05-02, to=2024-05-22}
  • org.eclipse.ui.internal:0.0.0
    • org.eclipse.ui 3.206.100.v20240720-1232
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
    • org.eclipse.ui.workbench 3.133.100.v20240904-0904
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
  • org.eclipse.jface.text.templates:0.0.0
    • org.eclipse.jface.text 3.25.200.v20240816-1151
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
    • org.eclipse.text 3.14.100.v20240524-2010
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.ui.views.properties:0.0.0
    • org.eclipse.ui.ide 3.22.400.v20240905-1133
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
    • org.eclipse.ui.views 3.12.400.v20240620-1945
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.test:0.0.0
    • org.eclipse.test 3.6.100.v20240321-1442
      • {CN=Eclipse.org Foundation, Inc., OU=IT, O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2022-05-02, to=2024-05-22}
    • org.eclipse.test.performance 3.20.200.v20240612-0620
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.compare.patch:0.0.0
    • org.eclipse.compare 3.11.100.v20240810-1416
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
    • org.eclipse.compare.core 3.8.500.v20240524-2010
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.jface.text.rules:0.0.0
    • org.eclipse.jface.text 3.25.200.v20240816-1151
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
    • org.eclipse.text 3.14.100.v20240524-2010
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.jface.text.link:0.0.0
    • org.eclipse.jface.text 3.25.200.v20240816-1151
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
    • org.eclipse.text 3.14.100.v20240524-2010
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.ui.internal.views.properties:0.0.0
    • org.eclipse.ui.ide 3.22.400.v20240905-1133
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
    • org.eclipse.ui.views 3.12.400.v20240620-1945
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.ui.browser:0.0.0
    • org.eclipse.ui.browser 3.8.300.v20240524-2010
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
    • org.eclipse.ui.workbench 3.133.100.v20240904-0904
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
  • org.eclipse.jface.text.source:0.0.0
    • org.eclipse.jface.text 3.25.200.v20240816-1151
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
    • org.eclipse.text 3.14.100.v20240524-2010
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.jface.text:0.0.0
    • org.eclipse.jface.text 3.25.200.v20240816-1151
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
    • org.eclipse.text 3.14.100.v20240524-2010
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
  • org.eclipse.ui.internal.browser:0.0.0
    • org.eclipse.ui.browser 3.8.300.v20240524-2010
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
    • org.eclipse.ui.workbench 3.133.100.v20240904-0904
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-07-22, to=2025-07-22}
  • org.eclipse.swt.tools.internal:0.0.0
    • org.eclipse.swt.tools 3.110.500.v20240620-1927
      • {CN=Eclipse.org Foundation, Inc., O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2024-03-20, to=2026-06-12}
    • org.eclipse.swt.tools.spies 3.109.400.v20240321-1321
      • {CN=Eclipse.org Foundation, Inc., OU=IT, O=Eclipse.org Foundation, Inc., L=Ottawa, ST=Ontario, from=2022-05-02, to=2024-05-22}

It's easy enough to force a new qualifier which forces a new signature. But when we publish to Maven Central the minor version needs to be incremented (different from what's already been published before) in order to publish a new version.

merks added a commit to eclipse-oomph/oomph that referenced this issue Sep 14, 2024
- The RepositoryIntegrityAnalyzer supports a -packages option to enable
the reporting and testing of provided packages.
- Improve the setup and target platform to avoid the older unsigned
version of org.apache.commons.collections.

eclipse-platform/eclipse.platform.releng.aggregator#2335
@merks
Copy link
Contributor

merks commented Sep 14, 2024

There are now generated reports:

https://download.eclipse.org/oomph/archive/reports/download.eclipse.org/eclipse/updates/4.34-I-builds/index.html

with details about split packages with difference signatures:

image

image

There are also junit test results:

Each test result provides details about the IUs and the certificates involved:

image

Now we will need to bump versions to eliminate the problems.

Going forward, we will detect new problems within a day, i.e., long before we publish to Maven Central.

merks added a commit to eclipse-oomph/oomph that referenced this issue Sep 14, 2024
- Both org.eclipse.equinox.supplement and org.eclipse.osgi.services
can't really have inconsistent signatures because they don't really
contain the provided packages.

eclipse-platform/eclipse.platform.releng.aggregator#2335
merks added a commit to merks/eclipse.platform.swt that referenced this issue Sep 15, 2024
- Both need to be bumped because neither is signed by the latest
available signing certificate.

eclipse-platform/eclipse.platform.releng.aggregator#2335
merks added a commit to merks/eclipse.platform.releng.aggregator that referenced this issue Sep 15, 2024
- Both need to be bumped because neither is signed by the latest
available signing certificate.

eclipse-platform#2335
merks added a commit to eclipse-platform/eclipse.platform.swt that referenced this issue Sep 15, 2024
- Both need to be bumped because neither is signed by the latest
available signing certificate.

eclipse-platform/eclipse.platform.releng.aggregator#2335
merks added a commit to merks/eclipse.platform.releng.aggregator that referenced this issue Sep 15, 2024
- Both need to be bumped because neither is signed by the latest
available signing certificate.

eclipse-platform#2335
@HannesWell
Copy link
Member

There are also junit test results:

* https://ci.eclipse.org/oomph/job/repository-analyzer/lastCompletedBuild/testReport/

* https://ci.eclipse.org/oomph/job/repository-analyzer/lastCompletedBuild/testReport/eclipse.updates._4_34_I_builds.I20240912_2100/

Each test result provides details about the IUs and the certificates involved:

Thank you Ed for this!

Ideally this test would be added e.g. to the platform-releng-aggregator repository and makes the I-build fail if there are inconsistent signatures. Maybe the report could be created and evaluated as part of the aggregation of the SDK p2-repo?

Otherwise I fear you'll be the only one paying attention to those tests and and taking care of failures, because most of the SDK committers won't have a look at Oomph's tests. But if the I-build fails the audience should be much wider.

@merks
Copy link
Contributor

merks commented Sep 15, 2024

This job does the work:

https://ci.eclipse.org/oomph/job/repository-analyzer

Any ci instance could define their own job for doing the work, e.g., like SimRel does:

https://ci.eclipse.org/simrel/job/simrel.oomph.repository-analyzer.test/

It's easy to give/get attention for failure regardless of where the job is hosted:

image

E.g., for this job I make sure that it gets my personal attention if there is a failure:

https://ci.eclipse.org/releng/view/Publish%20to%20Maven/job/CBIaggregator

image

The application is primarily focused on generating the report, with junit support added later, but it could be tailored only to generate junit test results...

I think with the increments done now, we're mostly done until the certificate renews in July of next year, except for this split triplet:

image

merks added a commit that referenced this issue Sep 15, 2024
- Both need to be bumped because neither is signed by the latest
available signing certificate.

#2335
@merks
Copy link
Contributor

merks commented Sep 16, 2024

The latest nightly build is free of split packages with inconsistent signatures:

https://download.eclipse.org/oomph/archive/reports/download.eclipse.org/eclipse/updates/4.34-I-builds/https___download.eclipse.org_eclipse_updates_4.34-I-builds_I20240915-1800.html

For what it's worth, SNAPSHOT publishing is done nightly:

https://repo.eclipse.org/content/repositories/eclipse-snapshots/

The tests should ensure that a recurrence of this problem will be noticed with 24 hours and will be fixed before publishing to Maven Central.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants