I don’t have time to setup your test jig right now. But attached are the
snippets of code that fail.
You will need to the following to use them:
I am using Python 2.7.13 (via conda 4.2.13).
You will need a MySQL database.
sudo apt-get install -y libmysqlclient-dev
sudo
Thanks for responding. Thought you would just advise me to use specific
compiler flags first.
Do you want me to use your jig (testing setup) to make a crash?
Or do you want me to add python code to your git repo so you can run it using
your jig?
What you are doing with code is pretty complex
I am guessing this is not the case. My guess is mod_init is called once by
main/master openSIPS process and child_init is called for each child openSIPS
process.
Hence you should modify your C code not to initialize the Python stuff in
mod_init, but instead in child_init. And your Python code
Robert, what you have described is how essentially python module works. We
init the interpreter and then the opensips forks, and in each of its
children the mod_init() python function exported by your code is called,
which returns instance whose method can be invoked via script. So at the
end of
Overall, I think trying to use threads, even “Python threads” across multiple
processes is a bad idea. Threads are usually meant to live inside one process.
Robert Mundkowsky
From: Mundkowsky, Robert
Sent: Tuesday, April 25, 2017 1:26 PM
To: 'Maxim Sobolev'
Cc: OpenSIPS
Robert sorry for the delay. What could be useful if you can produce chunk
of python routing code (could be NOP on the functional side) that crashes
repeatedly on our voiptest jig (https://github.com/sippy/voiptests). The
travis is setup to build pull requests, so that you can inject your code
and
Python 2.7.13 on Ubuntu 16.04.2 LTS.
How do you link using pthreads?
Do you add flags to Makefile, or will setting “USE_PTHREAD_MUTEX” and
“USE_POSIX_SEM” via menuconfig do it?
Since openSIPS is not multithread, seems like it would be a lot cleaner to not
use threads at all on C/C++. Then