mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alex Xu <alex@alxu.ca>
To: "Quesada Gonzalez, Elena" <elena.quesada_gonzalez@siemens.com>
Cc: musl@lists.openwall.com
Subject: RE: [musl] SIGSEV error when using REGEX with musl library
Date: Fri, 26 Nov 2021 11:32:24 -0500	[thread overview]
Message-ID: <1637943964.nt08b4os1z.none@localhost> (raw)
In-Reply-To: <DB8PR10MB32595A48B26D8BA81C21FC8FB5639@DB8PR10MB3259.EURPRD10.PROD.OUTLOOK.COM>

Excerpts from Quesada Gonzalez, Elena's message of November 26, 2021 6:46 am:
> Hi, 
> 
> A simple main with the following code, should replicate the error.
> 
> #include <regex>
> void main()
> {
> 
>     std::regex regexp("^[a-z0-9]{1,8}$");
>     std::string s = ("0xAz10145274");
>     if (false == std::regex_search(s, regexp))
>      {
>          // Only fatal. Statement is not initialized yet.
>          printf("Invalid regex [%s]\n", __FUNCTION__);
>        exit(1);
>       }
>     else {
>           printf("Regex ok [%s]\n", __FUNCTION__);
>     }
> }
> 
> Thanks for your time

This program does not compile.

test.cpp:2:1: error: '::main' must return 'int'
    2 | void main()
      | ^~~~

After adjusting it to return int, it printed "Invalid regex [main]" 
under both glibc and musl. After removing the anchors, it printed "Regex 
ok [main]" under both glibc and musl.

      reply	other threads:[~2021-11-26 16:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 14:53 Quesada Gonzalez, Elena
2021-11-25 15:52 ` Rich Felker
2021-11-26 11:46   ` Quesada Gonzalez, Elena
2021-11-26 16:32     ` Alex Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1637943964.nt08b4os1z.none@localhost \
    --to=alex@alxu.ca \
    --cc=elena.quesada_gonzalez@siemens.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).