Opened 4 years ago

Closed 3 years ago

#46528 closed defect (fixed)

dirmngr: prevent crash

Reported by: RJVB (René Bertin) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: kurthindenburg (Kurt Hindenburg)
Port: dirmngr

Description

I've been seeing regular dirmngr crashes when I open a signed message in kmail.

It seems this was due to calling a function from port:pth without proper initialisation (which appears to be done implicitly). Pth allows for multiple calls to pth_init, so a call to that function before the code leading to the crash seems to have solved the issue.

Attachments (1)

ensure_pth_initialisation.patch (416 bytes) - added by RJVB (René Bertin) 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by RJVB (René Bertin)

comment:1 Changed 4 years ago by ryandesign (Ryan Schmidt)

Priority: Not setNormal
Summary: prevent crash in dirmngrdirmngr: prevent crash

Is this problem already known to the developers of dirmngr? i.e. can you give us the bug report URL?

comment:2 Changed 4 years ago by RJVB (René Bertin)

No, and checking just now I see that this particular issue isn't patched by Debian/Ubuntu either.

Really, my patch is probably just a workaround for an underlying issue I'm not really interested to hunt down. If you look at dirmngr.c:667,

  /* Libgcrypt requires us to register the threading model first.
     Note that this will also do the pth_init. */

  /* Init Libgcrypt. */
  rc = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);

that would suggest that gcry_control doesn't call pth_init() properly. Or some other later call undoes that, for whatever reason. An extra pth_init() that is redundant (does nothing) in the cases where the crash did not occur protects against such events.

As I said, I'm not interested in hunting this down properly if this workaround is enough to prevent a crash report window from popping up for certain messages. I thought initially that that crash might be OS X specific, but it seems I don't get them on my Linux rig because kmail doesn't attempt certificate verification (despite being configured to do so).

comment:3 Changed 4 years ago by tanner@…

this is an old upstream bug https://bugs.g10code.com/gnupg/issue1590 (patch included) but upstream seems to have forgotten to release a new version.

Last edited 4 years ago by tanner@… (previous) (diff)

comment:4 Changed 4 years ago by RJVB (René Bertin)

So, should we use that patch, or just use mine (which in essence does the same thing) and wait for an upstream new version?

comment:5 Changed 3 years ago by kurthindenburg (Kurt Hindenburg)

Cc: khindenburg@… added

Cc Me!

comment:6 Changed 3 years ago by kurthindenburg (Kurt Hindenburg)

Resolution: fixed
Status: newclosed

thanks I used the bug report patch r147633

Note: See TracTickets for help on using tickets.