-
Notifications
You must be signed in to change notification settings - Fork 83
Segfaulting without tracing enabled. #281
Comments
At which values of |
Its hitting at about 32000 (it's always changing a bit, running the script displays it in 1000 iteration steps). Note that this runs only with the extension enabled, but no tracing at all configured. The affected code seems to need a lot less recursions, but of course there are more variables and other things happening which would also fill up the stack i think. I guess even if there is more memory used, it should never segfault? Also are there ways to increase the available memory? |
That's to be expected, as with the current way the extension is implemented, every single method call needs to be intercepted, regardless whether it is traced or not.
The segmentation fault is probably not due to running out of heap memory, but rather out of stack memory, which is much more limited (~512kB by default on some OSes I think, but not 100% sure). Changing the stack size might be possible on an OS limit, see this very old article on a similar problem which uses Again, I am not an expert on this, it's just my guess. |
Thanks so much, i didn't realize that this was a operating system limit. For the record, adjusting the httpd systemd service fixes this:
|
Should this be somehow documented if others run into this? |
After setting up opencensus-php for a project i noticed segfaults of a specific url.
After a bit of debugging it's seems to be partially related to call depth. I was able to reproduce this with a simple example:
https://github.com/foosinn/opencensus-segfault
This is throwing an segfault:
While this is not:
The only difference is installing the opencensus PHP extension. The
script.php
doesn't use tracing at all, the only difference is installing the module.Sidenote: In the original code it also made a difference weather i specified a third parameter for the results to
preg_match
. I wasn't able to create a simple case for that, but i guess the issue is in both cases the same.Thanks for your help!
The text was updated successfully, but these errors were encountered: