libpcre2-posix uses the same name as POSIX

Bug #1586769 reported by Malaise
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcre2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

At present the POSIX interface of the (new) PCRE2 defines the same names as the standard POSIX regex API, e.g. "extern int regcomp(regex_t *, const char *, int);"
On Debian, despite including pcre2posix.h and linking with libpcre2-posix, the program will likely bind to the libc entry with the same name.

See attached source:
gcc -pipe -fPIC -std=gnu99 -D_FILE_OFFSET_BITS=64 -pthpcre2-posixread -c tpcre2.c -o tpcre2.o
gcc -o tpcre2 tpcre2.o -lpcre2-posix -lpcre2-8 -lpthread -lm
ldd tpcre2
 linux-vdso.so.1 => (0x00007ffd0dbb7000)
 libpcre2-8.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f7ee2fd6000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7ee2c0d000)
 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7ee29ef000)
 /lib64/ld-linux-x86-64.so.2 (0x0000558e24854000)

According to a discussion in the PCRE forum (https://bugs.exim.org/show_bug.cgi?id=1830), the development team will not change these names because of risk of regression, because it has always been like that, because it works when PCRE2 is installed in a custom prefix (e.g. /usr/local)...

NOTE:
On the (previous) PCRE POSIX API, a patch (https://sources.debian.net/src/pcre3/2:8.38-3.1/debian/patches/pcreposix.patch/) ensures that including pcreposix.h will lead to bind with libpcreposix.
This patch is to define specific names (e.g. pcreposix_regcomp (...)) and #define the standard name as an "alias" to it (#define regcomp pcreposix_regcomp).

This patch works fine and may probably be reproduced in pcre2-posix.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libpcre2-posix0 10.21-1
ProcVersionSignature: Ubuntu 4.4.0-22.40-generic 4.4.8
Uname: Linux 4.4.0-22-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Sun May 29 14:19:47 2016
Dependencies:
 gcc-6-base 6.0.1-0ubuntu1
 libc6 2.23-0ubuntu3
 libgcc1 1:6.0.1-0ubuntu1
 libpcre2-8-0 10.21-1
InstallationDate: Installed on 2016-02-01 (117 days ago)
InstallationMedia: Xubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: pcre2
UpgradeStatus: Upgraded to xenial on 2016-04-23 (36 days ago)

Revision history for this message
Malaise (malaise) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.