Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fix for rt-43537: undefined values passed to the multi functions no long... #5
This patch fixes rt-43537:
Calls to set_multi that contained an undefined value caused segmentation faults. The root cause of this was the de-referencing of a call to
To fix this a new function,
A new test t/malformed.t was added to test this new functionality. It adds three values to the server, then submits a series calls to
aTHX_ is an argument (hence "a", underscore suggests a comma) for a pTHX_ parameter (hence "p"). You need aTHX_ because you have pTHX_, and you need pTHX_ because when Perl is built with the support for multi-threading av_fetch() (and friends) is a macro that expands to a function call with an extra argument of thread context. I.e. pTHX_ expands to "ThreadContextType *ctx," (actual names are different), aTHX_ expands to "ctx,", and av_fetch(a,b,c) expands to av_fetch(ctx,a,b,c), thus passing around current thread context "ctx". Before the commit 13c9216 we haven't defined PERL_NO_GET_CONTEXT and so didn't have pTHX_/aTHX_, but then av_fetch(a,b,c) had expanded to av_fetch(get_current_ctx(),a,b,c) and there were too many get_current_ctx() calls, which bothered some.
Presumably on OSX you have single-threaded Perl, hence pTHX_/aTHX_ expand to empty strings, and av_fetch(a,b,c) expands to av_fetch(global_ctx_var,a,b,c), and so you don't have compilation problem. But on Debian you had an error yourself ;).