-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ABI breakage without soname update #266
Copy link
Copy link
Closed
Description
re2 2020-07-01, in comparison to re2 2020-06-01, introduced ABI breakage without update of soname of shared library.
In commit e6613e9, new members of public enums were introduced, not at the end of these enums, so values of subsequent members were changed.
Executables/libraries compiled with older re2 would misbehave after update to newer re2 without recompilation.
Example showing problem:
$ cat test.cpp
#include <iostream>
#include <re2/re2.h>
int main(){
re2::RE2 re("(?P<>)");
if (re.error_code() == re2::RE2::ErrorBadNamedCapture) {
std::cout << "CODE FOR INVALID NAMED CAPTURE GROUP" << std::endl;
} else {
std::cout << "CODE FOR OTHER" << std::endl;
}
}
$ tar -xzf .../re2-2020-06-01.tar.gz
$ tar -xzf .../re2-2020-07-01.tar.gz
$ make -C re2-2020-06-01 shared
...
$ make -C re2-2020-07-01 shared
...
$ g++ -o test test.cpp -Ire2-2020-06-01 -Lre2-2020-06-01/obj/so -lre2
$ LD_LIBRARY_PATH="re2-2020-06-01/obj/so" ./test
re2/re2.cc:203: Error parsing '(?P<>)': invalid named capture group: (?P<>
CODE FOR INVALID NAMED CAPTURE GROUP
$ LD_LIBRARY_PATH="re2-2020-07-01/obj/so" ./test
re2/re2.cc:205: Error parsing '(?P<>)': invalid named capture group: (?P<>
CODE FOR OTHER
Grepping in Chromium 85.0.4181.8 shows that one of affected members of these enums is used there:
$ grep -Er "(ErrorTrailingBackslash|ErrorRepeatArgument|ErrorRepeatSize|ErrorRepeatOp|ErrorBadPerlOp|ErrorBadUTF8|ErrorBadNamedCapture|ErrorPatternTooLarge|kRegexpTrailingBackslash|kRegexpRepeatArgument|kRegexpRepeatSize|kRegexpRepeatOp|kRegexpBadPerlOp|kRegexpBadUTF8|kRegexpBadNamedCapture)" *
extensions/browser/api/declarative_net_request/indexed_rule.cc: if (regex.error_code() == re2::RE2::ErrorPatternTooLarge) {
I suggest that SONAME=8 be set in Makefile:
Line 47 in 9a3bd16
| SONAME=7 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels