-
Notifications
You must be signed in to change notification settings - Fork 310
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
fix: check CalloutNameEntry for NULL before access #196
Conversation
This fixes a php segfault, see openwrt/packages#12403 I traced it down with gdb 0xb6e37f70 in i_free_callout_name_entry (key=0x369040, e=0x0, arg=0x37afe0) at oniguruma-6.9.5_rev1/src/regparse.c:1297
I propose to carry this patch until a new upstream release includes it. For forther references see: openwrt#12403 and kkos/oniguruma#196 Signed-off-by: Michael Heimpold <mhei@heimpold.de>
I have not been able to figure out where the problem is.
But e is made so that it's not null, and arg shouldn't be passed as anything but zero. Regardless, there's nothing wrong with this PR, so I accept it. |
I'm not familiar with the code, but the comment about |
I propose to carry this patch until a new upstream release includes it. For forther references see: #12403 and kkos/oniguruma#196 Signed-off-by: Michael Heimpold <mhei@heimpold.de>
This issue is very strange to me. (1) The segmentation fault occurs just by calling the termination process without using any other function of this library. (2) The values passed to function i_free_callout_name_entry are strange. The only place to call function i_free_callout_name_entry.
The issue is a complete mystery, and I have no idea what to look for in it. |
Thanks for digging into this. To be honest, I did not take the time to analyze the code around it, I just tried to setup the gdb environment to have a trace. I'm not that familiar with gdb, so please even consider that my backtrace is wrong. On the other side, with the fix/check for NULL applied, the original issue is gone...So yes, I'm confused to. What I can do is to rollback my test environment to the previous oniguruma version used in OpenWrt before and check whether the issue still - or better: already - occurs with this version... |
My test environment is a I2SE Duckbill (arm mxs platform) with PHP 7.4.7: |
Thank you. |
I think, you don't need any knowledge about OpenWrt. The summary is, that we used v6.9.4 and autotools without problems, and the library built with v6.9.5_rev1 + one additional patch using cmake build system does not work (anymore). |
I think I found something. First of all, it works when autotools is used, but fails with cmake. The backport of the cmake versioning change I've written is not the problem. It fails even without the patch.
It could explain why the parameters had values that were not supposed to be. I'll look into it further when I get the time. |
It did not take me that long. See #197 When building with cmake, |
Thank you. |
It appears that cmake support is not really on par with autotools, is it? cmake builds it much faster, so I would prefer to use it, if all other things are equal. Do you have any recommendation? |
This is great news that the cause was found! Thank you both @cotequeiroz and @kkos ! |
@cotequeiroz @mhei |
I propose to carry this patch until a new upstream release includes it. For forther references see: openwrt#12403 and kkos/oniguruma#196 Signed-off-by: Michael Heimpold <mhei@heimpold.de>
I propose to carry this patch until a new upstream release includes it. For forther references see: openwrt#12403 and kkos/oniguruma#196 Signed-off-by: Michael Heimpold <mhei@heimpold.de>
This fixes a php segfault, see
openwrt/packages#12403
I traced it down with gdb
0xb6e37f70 in i_free_callout_name_entry (key=0x369040,
e=0x0, arg=0x37afe0) at oniguruma-6.9.5_rev1/src/regparse.c:1297