Quarkus: GCP Run: Fatal error: Util_sun_misc_Signal.ensureInitialized: CSunMiscSignal.open() failed

Created on 29 Sep 2019  路  11Comments  路  Source: quarkusio/quarkus

Describe the bug
I tried to run Quarkus sample app generated by Maven on Google Cloud Run, but unfortunately I get:
Fatal error: Util_sun_misc_Signal.ensureInitialized: CSunMiscSignal.open() failed

Expected behavior
App runs correctly on GCP Run

Actual behavior
App Fails to run

To Reproduce
Steps to reproduce the behavior:

  1. Generate quarkus project using Maven
  2. Build docker image
  3. Push to GCP Docker repo
  4. Deploy using command:
gcloud beta run deploy --allow-unauthenticated --platform managed --image gcr.io/YOUR_PROJECT/YOUR_IMAGE_NAME

logs__2019-09-29T10-56.zip

kinbug pinned triagout-of-date

Most helpful comment

Does this mean that quarkus can't be deployed as a native image to Google Cloud Run? Are there any workarounds?

All 11 comments

Hello @rgrebski, which version of Graal VM and Quarkus are you using?

Thx for quick response. Versions:

Quarkus: 0.23.1
GraalVM: GraalVM CE 19.1.1 (tried also with 19.2.0 and 19.2.1)

As far as I can see, this substitution is coming directly from substratevm here https://github.com/oracle/graal/blob/vm-19.2.0.1/substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/SunMiscSubstitutions.java#L76. So it looks like something to be reported in that project. Having said that, I'm not an expert in this area. Maybe @dmlloyd might have more inputs?

The problem is that AWS doesn't allow the syscalls required by the GraalVM signals implementation. The GraalVM signal handler in turn is a bit convoluted to account for isolates. I wasn't able to figure out a reasonable solution though: the set of syscalls that can be made from a signal handler is quite limited.

Does this mean that quarkus can't be deployed as a native image to Google Cloud Run? Are there any workarounds?

You can work around the problem by defining the environment variable DISABLE_SIGNAL_HANDLERS to any value. Obviously this means that you won't have OS signal handling though.

Ultimately we'll probably end up defining our own signal handler which works more like OpenJDK's.

You can work around the problem by defining the environment variable DISABLE_SIGNAL_HANDLERS to any value. Obviously this means that you won't have OS signal handling though.

What does this imply, concretely ?

It means that SIGINT/SIGTERM won't call shutdown hooks (the process will end abruptly) and you cannot get stack traces via SIGQUIT.

What is the status on this one ?
I just tested our getting started application on Cloud Run and it works.
Can we close it?

This I believe was fixed via https://github.com/oracle/graal/pull/2746.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

masini picture masini  路  43Comments

kny78 picture kny78  路  49Comments

quarkusbot picture quarkusbot  路  152Comments

FroMage picture FroMage  路  75Comments

maxandersen picture maxandersen  路  55Comments