Python execution problem from cpp shared object /u/Rough_Metal_9999 Python Education

I have a python program that loads a .so file generated with cpp code in the code i expose a function that executes a simple hello world program

everything works fine when i run cpp program it executes and prints hello world

when i make so file , and call the same function from .py file and run the py file it gives me error of

<code>

free(): invalid pointer
zsh: IOT instruction (core dumped) python3 main.py

</code>

i use cout statement to find out the problem occur while initilising python Py_Initialize(); in this method

itry to execute the function call with another thread same error occour

Why this happend and how i solve it

submitted by /u/Rough_Metal_9999
[link] [comments]

​r/learnpython I have a python program that loads a .so file generated with cpp code in the code i expose a function that executes a simple hello world program everything works fine when i run cpp program it executes and prints hello world when i make so file , and call the same function from .py file and run the py file it gives me error of <code> free(): invalid pointer zsh: IOT instruction (core dumped) python3 main.py </code> i use cout statement to find out the problem occur while initilising python Py_Initialize(); in this method itry to execute the function call with another thread same error occour ​ Why this happend and how i solve it submitted by /u/Rough_Metal_9999 [link] [comments] 

I have a python program that loads a .so file generated with cpp code in the code i expose a function that executes a simple hello world program

everything works fine when i run cpp program it executes and prints hello world

when i make so file , and call the same function from .py file and run the py file it gives me error of

<code>

free(): invalid pointer
zsh: IOT instruction (core dumped) python3 main.py

</code>

i use cout statement to find out the problem occur while initilising python Py_Initialize(); in this method

itry to execute the function call with another thread same error occour

Why this happend and how i solve it

submitted by /u/Rough_Metal_9999
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *