in reply to Re^4: Embed perl problem
in thread Embed perl problem

It smells like a missing string terminator, the NULL at the end of your block. printf() might be a lot less sensitive than eval_pv() when feeding it with a football-field worth of core. The initialiser char block[]="abc"; puts a NULL at the end whereas char block[] = {0xaa,0xbb,0xcc} doesn't... and do not attempt to add one as it's a const. Long story short, add a 0x0 after 0xcc and make sure your decode() keeps it there.

Replies are listed 'Best First'.
Re^6: Embed perl problem
by Noves Castro (Novice) on Feb 03, 2019 at 04:01 UTC

    no chance. seems problem comes from calling system("ls -a"); in my code. when i using ptrace in c together with system calls in my perl code program stop running with + Stopped message at the end of program.

      I think about an alternative way, if i could detect when i my program run like this , problem can be solved almost:

      parent program

      vs

      program

      how can i detect when my program run by parent in perl?

      Any idea?