Bug 4694

Summary: UCLIBC_REGEX_OLD: "Invalid content of \{\}" error on regcomp('^\#define[[:space:]]\{1\,\}BOOT_TRAMPOLINE[[:space:]]\{1\,\}',0)
Product: uClibc Reporter: Denys Vlasenko <vda.linux>
Component: Standard ComplianceAssignee: unassigned
Status: NEW ---    
Severity: minor CC: uclibc-cvs
Priority: P5    
Version: 0.9.31   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: uclibc .config file

Description Denys Vlasenko 2012-01-15 17:58:35 UTC
When built aqgainst uclibc,

busybox sed 's,^\#define[[:space:]]\{1\,\}BOOT_TRAMPOLINE[[:space:]]\{1\,\},,p'

fails with "Invalid content of \{\}" message.
When the very same tree is build against glibc, it works.

On the library call level, it boils down to this call (the string has \ -> \\ escaped again by me, compiler will strip them back to single \):

regcomp(&regex, "^\\#define[[:space:]]\\{1\\,\\}BOOT_TRAMPOLINE[[:space:]]\\{1\\,\\}", 0);

which fails; regerror() reports "Invalid content of \{\}".
Comment 1 Denys Vlasenko 2012-01-15 17:59:29 UTC
Created attachment 3968 [details]
uclibc .config file

The most relevant part is probably:

UCLIBC_HAS_REGEX=y
UCLIBC_HAS_REGEX_OLD=y
Comment 2 Denys Vlasenko 2012-01-15 18:00:09 UTC
The uclibc source I used was uclibc-0.9.31.svn20110206
Comment 3 Mike Frysinger 2012-01-15 18:14:26 UTC
not sure how much effort is going to be spent here ...

config UCLIBC_HAS_REGEX_OLD
...
      ...  It also has some known issues when dealing with uncommon
      corner cases and multibyte/unicode strings.  ...
...
      If the older version has worked for you ...,
      then stick with the old version (and say Y here).
      Otherwise, you should use the new version (and say N here).
...
Comment 4 Denys Vlasenko 2012-01-16 00:14:31 UTC
(In reply to comment #3)
> not sure how much effort is going to be spent here ...
> 
> config UCLIBC_HAS_REGEX_OLD
> ...
>       ...  It also has some known issues when dealing with uncommon
>       corner cases and multibyte/unicode strings.  ...
> ...
>       If the older version has worked for you ...,
>       then stick with the old version (and say Y here).
>       Otherwise, you should use the new version (and say N here).
> ...

We should stop multiplying implementations of subsystems. We have two regexes, two FNMATCHs, two or three pthreads, two malloc's... What I forgot? Ah. We also have OLD_VFPRINTF. This is turning into a nightmare.
Comment 5 Mike Frysinger 2012-01-16 00:32:23 UTC
this is what happens when you have small implementations that mostly work, and then "full" implementations that contain stuff that most people don't care about

patches welcome to improve this