in reply to perl +xs : crash after some time

Reading perlcall, there's an example with SPAGAIN; after the call_pv().

The purpose of the macro "SPAGAIN" is to refresh the local copy of the stack pointer. This is necessary because it is possible that the memory allocated to the Perl stack has been reallocated during the call_pv call.
You do the opposite: a PUTBACK; after the call. There shouldn't be need for either as you don't access SP after the call.

Anyway, that was just my quick guess. Can you try the code without this (second) PUTBACK; statement?

Replies are listed 'Best First'.
Re^2: perl +xs : crash after some time
by frazap (Monk) on Nov 06, 2017 at 14:07 UTC
    Yes, You're right !

    reading again perlcall, passing one parameter here there's no call to PUTBACK after call_pv.

    Without this second PUTBACK, I was not able to crash my code with a few minutes testing

    Thanks a lot !

    François