New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDEV-31727: pcre stack size not functioning on clang-16 #2700
Conversation
Does gcc support attribute((optnone)) ? |
noinline attribute was being ignored by clang-16 and reporting 32 stack size on Gentoo, 16 locally on Fedora 38. Based on https://stackoverflow.com/questions/54481855/clang-ignoring-attribute-noinline appended noopt in addition to the gcc recognised attributes. After that the -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) returned 1056, simlar to gcc. From https://bugs.gentoo.org/910188. Thanks Zhixu Liu for the great bug report.
a1690b9
to
9098521
Compare
gcc-13.1.1 doesn't support the |
ideally, the fix should work with the system pcre too. If we patch the bundled version, MariaDB will not be able to use system pcre anymore UPD: ok, it's 10.4-only, and we check whether system pcre is usable or not, then I suppose we can fix only bundled. It'll be up to Gentoo/Fedora to patch their distro version of pcre if they want to. |
And luckily for the most part system builds are still gcc based. @vuvova still got an account to update https://bugs.exim.org/show_bug.cgi?id=2173, apparently other's had trouble registering. |
Done for Gentoo, thanks! |
I wonder if this is in any way related to MDEV-31605, which involves JSON functions. I was thinking of adding the following to #ifdef __clang__
# define ATTRIBUTE_OPTNONE __attribute__((optnone))
#elif defined __GNUC__
# define ATTRIBUTE_OPTNONE __attribute__((optimize(0)))
#else
# define ATTRIBUTE_OPTNONE /* empty */
#endif As you probably know, Clang defines |
Thanks Zhixu Liu for the great bug report.
Description
noinline attribute was being ignored by clang-16 and reporting 32 stack size on Gentoo, 16 locally on Fedora 38.
Based on https://stackoverflow.com/questions/54481855/clang-ignoring-attribute-noinline changed the noinline to noopt.
After that the -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) returned 1056, simlar to gcc.
From https://bugs.gentoo.org/910188.
How can this PR be tested?
Manual compile against bundled pcre with code per gentoo bug report.
Basing the PR against the correct MariaDB version
PR quality check