[MacPorts] #57203: pcreposix segfault in regfree with trivial program
MacPorts
noreply at macports.org
Sun Sep 30 17:07:14 UTC 2018
#57203: pcreposix segfault in regfree with trivial program
----------------------+--------------------
Reporter: markpizz | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port: pcre
----------------------+--------------------
This program (retest.c) fails:
{{{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pcreposix.h>
#include <pcre.h>
#include <pthread.h>
int main (int argc, char **argv)
{
int re_result;
regex_t re;
char match_buf[64] = "Match This";
printf("Using PCRE V %s\n", pcre_version());
memset (&re, 0, sizeof(re));
re_result = regcomp (&re, match_buf, REG_EXTENDED);
if (re_result)
{
size_t err_size = regerror (re_result, &re, NULL, 0);
char *err_buf = (char *)calloc (err_size+1, 1);
regerror (re_result, &re, err_buf, err_size);
fprintf (stderr, "Regular Expression Error compiling '%s': %s\n",
match_buf, err_buf);
free (err_buf);
exit (1);
}
printf("Regular Expression compile of '%s' successful\n", match_buf);
regfree (&re);
}
}}}
This is how I see the failure:
{{{
bash-3.2# port list installed
bash-3.2# port install pcre
---> Computing dependencies for pcre
The following dependencies will be installed:
bzip2
libedit
ncurses
zlib
Continue? [Y/n]: y
---> Fetching archive for bzip2
---> Attempting to fetch bzip2-1.0.6_0.darwin_17.x86_64.tbz2 from
https://packages.macports.org/bzip2
---> Attempting to fetch bzip2-1.0.6_0.darwin_17.x86_64.tbz2.rmd160 from
https://packages.macports.org/bzip2
---> Installing bzip2 @1.0.6_0
---> Activating bzip2 @1.0.6_0
---> Cleaning bzip2
---> Fetching archive for ncurses
---> Attempting to fetch ncurses-6.1_0.darwin_17.x86_64.tbz2 from
https://packages.macports.org/ncurses
---> Attempting to fetch ncurses-6.1_0.darwin_17.x86_64.tbz2.rmd160 from
https://packages.macports.org/ncurses
---> Installing ncurses @6.1_0
---> Activating ncurses @6.1_0
---> Cleaning ncurses
---> Fetching archive for libedit
---> Attempting to fetch libedit-20170329-3.1_2.darwin_17.x86_64.tbz2
from https://packages.macports.org/libedit
---> Attempting to fetch
libedit-20170329-3.1_2.darwin_17.x86_64.tbz2.rmd160 from
https://packages.macports.org/libedit
---> Installing libedit @20170329-3.1_2
---> Activating libedit @20170329-3.1_2
---> Cleaning libedit
---> Fetching archive for zlib
---> Attempting to fetch zlib-1.2.11_0.darwin_17.x86_64.tbz2 from
https://packages.macports.org/zlib
---> Attempting to fetch zlib-1.2.11_0.darwin_17.x86_64.tbz2.rmd160 from
https://packages.macports.org/zlib
---> Installing zlib @1.2.11_0
---> Activating zlib @1.2.11_0
---> Cleaning zlib
---> Fetching archive for pcre
---> Attempting to fetch pcre-8.42_0.darwin_17.x86_64.tbz2 from
https://packages.macports.org/pcre
---> Attempting to fetch pcre-8.42_0.darwin_17.x86_64.tbz2.rmd160 from
https://packages.macports.org/pcre
---> Installing pcre @8.42_0
---> Activating pcre @8.42_0
---> Cleaning pcre
---> Updating database of binaries
---> Updating database of C++ stdlib usage
---> Scanning binaries for linking errors
---> No broken files found.
---> No broken ports found.
bash-3.2# exit
exit
mac-mini:~ mark$ gcc retest.c -I/opt/local/include -L/opt/local/lib
-lpthread -lpcreposix -lpcre -o retest
mac-mini:~ mark$ ./retest
Using PCRE V 8.42 2018-03-20
Regular Expression compile of 'Match This' successful
Segmentation fault: 11
-mini:~ mark$
}}}
--
Ticket URL: <https://trac.macports.org/ticket/57203>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list