Skip to content

fix: unsafe transformer disable system property#1681

Merged
derklaro merged 2 commits into
nightlyfrom
unsafe-transformer-disable-sys-prop
Jul 3, 2025
Merged

fix: unsafe transformer disable system property#1681
derklaro merged 2 commits into
nightlyfrom
unsafe-transformer-disable-sys-prop

Conversation

@derklaro

@derklaro derklaro commented Jul 2, 2025

Copy link
Copy Markdown
Member

Motivation

The unsafe transformer is registered in a different way than usual (usually transformers are registered via SPI), so disabling the transformer by throwing an exception is not a viable option as it results in a jvm crash.

Modification

Move the transformer disabled check into the premain class and don't try to construct/register the transformer if it is disabled.

Result

No more jvm crashes when the unsafe transformer is disabled using a system property.

@derklaro derklaro added this to the 4.0.0-RC14 milestone Jul 2, 2025
@derklaro derklaro requested a review from 0utplay July 2, 2025 22:20
@derklaro derklaro self-assigned this Jul 2, 2025
@derklaro derklaro added p: high This issue or pull request has a high priority. v: 4.X This pull should be included in the 4.0 release t: fix A pull request introducing a fix for a bug. in: wrapper An issue/pull request releated to the wrapper module code labels Jul 2, 2025
@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown

Test Results

 56 files  ±0   56 suites  ±0   2m 59s ⏱️ +5s
566 tests ±0  566 ✅ ±0  0 💤 ±0  0 ❌ ±0 
931 runs  ±0  931 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 404afb6. ± Comparison against base commit c357ab8.

This pull request removes 34 and adds 34 tests. Note that renamed tests count towards both.
eu.cloudnetservice.driver.impl.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"insane":"!","hello":"world","this":"is"}}, PRETTY
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 16:45:34.522219045
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 16:45:34.522326465Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 16:45:34.522347594Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 16:45:34.522370317+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 16:45:34.522384212-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2025-07-02T16:45:34.522551825
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2025-07-02T16:45:34.522710721Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2025-07-02T16:45:34.515533714Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [5] 2025-07-02T16:37:14.515537962Z
…
eu.cloudnetservice.driver.impl.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"hello":"world","insane":"!","this":"is"}}, PRETTY
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 22:22:51.462570874
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 22:22:51.462681811Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 22:22:51.462704694Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 22:22:51.462727657+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 22:22:51.462744128-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2025-07-02T22:22:51.462873529
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2025-07-02T22:22:51.463024051Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2025-07-02T22:22:51.455815183Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [5] 2025-07-02T22:14:31.455819230Z
…

@derklaro derklaro merged commit ce44537 into nightly Jul 3, 2025
5 checks passed
@derklaro derklaro deleted the unsafe-transformer-disable-sys-prop branch July 3, 2025 07:16
derklaro added a commit that referenced this pull request Jul 3, 2025
### Motivation
The unsafe transformer is registered in a different way than usual
(usually transformers are registered via SPI), so disabling the
transformer by throwing an exception is not a viable option as it
results in a jvm crash.

### Modification
Move the transformer disabled check into the premain class and don't try
to construct/register the transformer if it is disabled.

### Result
No more jvm crashes when the unsafe transformer is disabled using a
system property.

(cherry picked from commit ce44537)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: wrapper An issue/pull request releated to the wrapper module code p: high This issue or pull request has a high priority. t: fix A pull request introducing a fix for a bug. v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants