Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #84073

Re: core dumped at regex_search()

From Juha Nieminen <nospam@thanks.invalid>
Newsgroups comp.lang.c++
Subject Re: core dumped at regex_search()
Date 2022-05-13 10:20 +0000
Organization Aioe.org NNTP Server
Message-ID <t5lbdc$1ovg$1@gioia.aioe.org> (permalink)
References <t5l9ts$2rkbj$1@portraits.wsisiz.edu.pl>

Show all headers | View raw


Jivanmukta <jivanmukta@poczta.onet.pl> wrote:
> I have a problem with regex_search function from standard regex library. 
> I use gcc compiler in Ubuntu 20.
> I wrote PHP obfuscator in C++. Now I am testing my program with PHP 
> source codes found in Internet. For example PHP project 
> shopping_portal_0.1 contains very long line with string data (108599 
> characters). When I call regex_reach() with the following regex:
> (static|private|protected|public)?\s*(readonly)?\s*([_a-zA-Z0-9]+)?\s*(\$([a-zA-Z_][a-zA-Z0-9_]*)\s*=.*,?\s*)+
> I receive core dumped at this call.
> Can you tell me a workaround/solution for my problem?

Are you sure it's regex_search that's the culprit and it's not just a
symptom of a bug in your own code? (Out-of-bounds accesses and similar
errors can have all kinds of weird effects, where the program doesn't
crash or misbehave at the place of the bug, but somewhere else, which
uses data corrupted by the buggy code.)

You can try running your program with valgrind to see if it detects
such errors. You can also try compiling with the gcc compiler flag
"-fsanitize=address" for a similar functionality. Might also specify
"-D_GLIBXCC_DEBUG" for good measure.

If nothing of that helps, post a minimal complete example that
replicates the problem.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

core dumped at regex_search() Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-05-13 11:54 +0200
  Re: core dumped at regex_search() Juha Nieminen <nospam@thanks.invalid> - 2022-05-13 10:20 +0000
    Re: core dumped at regex_search() Juha Nieminen <nospam@thanks.invalid> - 2022-05-13 10:25 +0000
  Re: core dumped at regex_search() Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-05-13 12:47 +0200
  Re: core dumped at regex_search() Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-05-13 14:40 +0200
    Re: core dumped at regex_search() Juha Nieminen <nospam@thanks.invalid> - 2022-05-14 07:18 +0000
  Re: core dumped at regex_search() James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-05-14 01:21 -0400
  Re: core dumped at regex_search() Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-05-18 10:19 +0200
    Re: core dumped at regex_search() Juha Nieminen <nospam@thanks.invalid> - 2022-05-18 08:52 +0000
      Re: core dumped at regex_search() Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-05-18 11:59 +0200
        Re: core dumped at regex_search() Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-05-18 12:58 +0200
          Re: core dumped at regex_search() Juha Nieminen <nospam@thanks.invalid> - 2022-05-19 15:15 +0000
  Re: core dumped at regex_search() Tony Oliver <guinness.tony@gmail.com> - 2022-05-20 07:53 -0700
    Re: core dumped at regex_search() Jivanmukta <jivanmukta@poczta.onet.pl> - 2022-05-22 08:13 +0200

csiph-web