Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: perl +xs : crash after some time

by Anonymous Monk
on Nov 04, 2017 at 09:39 UTC ( #1202742=note: print w/replies, xml ) Need Help??


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 (Beadle) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1202742]
help
Chatterbox?
[karlgoethebier]: ...good Hot tuna. Note the stacks & racks in the background
[karlgoethebier]: ..the last hippies. They still perform. At least the survivors...
[Discipulus]: not survived
[Discipulus]: has pm some danish monk?
[Discipulus]: erix the problem was not rain in the brain.. ;=)
[erix]: I'll think about that for a bit; I'll figure it out

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2017-11-17 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?