Skip to content

Engine: atexit crash when used with softhsm2 #239

@aalba6675

Description

@aalba6675

There is a crash when engine is used with softhsm2, specifically with EC key operation.

Fedora 28 Downstream: https://bugzilla.redhat.com/show_bug.cgi?id=1619184
SoftHSM2: softhsm/SoftHSMv2#413

  1. Crash happens only with EC keys
  2. Crash happens when another HSM does EC key operations but softhsm2 is loaded and configured. I have configured CloudHSM+SoftHSM2.

Distro suggests it is a conflict between engine's finish and softhsm2's atexit. Not sure who is a "fault" here but maintainers may be interested in taking a look. Downstream has two suggestions:

  1. Build softhsm2 with -fno-use-cxa-atexit
  2. Use LD_PRELOAD=/usr/local/lib/softhsm/libsofthsm2.so

I can confirm that both workarounds avoid the crash. Cross-posting the issue here looking for the best place to apply C++-fu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions