LD_PRELOAD causes stack smashing error in gpg

NIIBE Yutaka gniibe at fsij.org
Mon Apr 20 06:26:38 CEST 2026


Hello,

devnoname120 wrote:
> For some reason gpg doesn’t seem to like when a RegEx is compiled in
> the constructor of a preloaded library.

Please see:

	https://dev/gnupg.org/T7668

We use the internal replacement of regex_* routines for GnuPG, so that
we can support OS without regexp, and we can avoid interoperability
problem among different implementations.

The bug you encountered is a problem of using ABI difference of regex_*.
The ones in system libc and the ones in the internal replacement are not
ABI same, but use different regexp_t.

GnuPG 2.6 has a fix (replacing the symbols with a prefix) for no conflict.

BTW, today, I modified the wrong prefix in master.
-- 



More information about the Gnupg-devel mailing list