Re: [h323plus] Using H323+ for Asterisk's chan_h323
Plamen
GnuGk has been test compiled with h323plus.
Your error looks strange as it seems to like the code 2 lines above 656 which is identical . I suggest you look at code to see if you have not accidently modified something particularily look at gk_const.h as well as RasTbl.cxx:658
I have fixed the warning message.
Simon
-----Original Message----- From: Plamen Petkov [mailto:plamen@bg-tel.com] Sent: Friday, 26 October 2007 2:57 AM To: Simon Horne Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello, I try to compile Gnugk with H323plus. That is the result:
RasTbl.cxx:658: error: no matching function for call to `H460_FeatureOID::Add(const char[2], H460_FeatureContent)' /root/openh323/include/h460/h4601.h:969: note: candidates are: H460_FeatureParameter& H460_FeatureOID::Add(const PString&, H460_FeatureContent&) RasTbl.cxx: In member function `void CallTable::OnQosMonitoringReport(const PString&, const endptr&, H4609_QosMonitoringReportData&)': RasTbl.cxx:2790: warning: unused variable 'addr' make[1]: *** [obj_linux_x86_r/RasTbl.o] Error 1
Regards: Plamen
----- Original Message ----- From: "Simon Horne" s.horne@packetizer.com To: vhatz@kinetix.gr; h323plus@lists.packetizer.com Sent: Thursday, October 25, 2007 6:44 PM Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Vlasis
I am not sure what chan_h323 looks like but there should be no need to have timerChangePipe I think this is a left over from very old code.
Have a look at simple in the CVS http://h323plus.cvs.sourceforge.net/h323plus/applications/simple/ to see how to define the PProcess
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com]On Behalf Of Vlasis Hatzistavrou (KTI) Sent: Thursday, 25 October 2007 10:36 PM To: h323plus@lists.packetizer.com Subject: [h323plus] Using H323+ for Asterisk's chan_h323
Hello all,
I have been trying to compile chan_h323 with H323. It seems that I am almost done, although I get the following error:
g++ -DNDEBUG -I../../include -include ../../include/asterisk/autoconfig.h -fPIC -DP_USE_PRAGMA -D_REENTRANT -fno-exceptions -Wall -fPIC -DPIC -DNDEBUG -I/Downloads/h323p/ptlib_v1_12_0/include -DPTRACING -I/Downloads/h323p/h323plus/include -Os -pipe -felide-constructors -Wreorder -c ast_h323.cxx -o ast_h323.o ast_h323.cxx: In destructor `virtual MyProcess::~MyProcess()': ast_h323.cxx:194: error: `timerChangePipe' was not declared in this scope make[2]: *** [ast_h323.o] Error 1 make[1]: *** [h323/libchanh323.a] Error 2 make: *** [channels] Error 2
I went through the PWLib 1.12.0, and there is no occurrence of "timerChangePipe". In previous versions of PWLib "timerChangePipe" was used in quite a few places in the code.
I googled it, but I still don't know what it does.
If I comment it out in the destructor MyProcess::~MyProcess() it compiles, but the channel driver segfaults as soon as it is loaded...
-- Best regards, Vlasis Hatzistavrou.
Hello again, Simon,
I managed to compile chan_h323 with H323Plus.
Now, asterisk segfaults as soon as chan_h323.so is loaded. I took a core dump and analyzed it with gdb.
Here is the back-trace:
******************************* (gdb) bt #0 0x00319520 in PString::operator< () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #1 0x00243024 in std::_Rb_tree<PString, std::pair<PString const, PFactory<PSoundChannel, PString>::WorkerBase*>, std::_Select1st<std::pair<PString const, PFactory<PSoundChannel, PString>::WorkerBase*> >, std::less<PString>, std::allocator<std::pair<PString const, PFactory<PSoundChannel, PString>::WorkerBase*> > >::insert_unique () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #2 0x019db380 in std::map<PString, PFactory<PSoundChannel, PString>::WorkerBase*, std::less<PString>, std::allocator<std::pair<PString const, PFactory<PSoundChannel, PString>::WorkerBase*> > >::insert () from /usr/local/lib/pwlib/devices/sound/oss_pwplugin.so #3 0x019daa7c in std::map<PString, PFactory<PSoundChannel, PString>::WorkerBase*, std::less<PString>, std::allocator<std::pair<PString const, PFactory<PSoundChannel, PString>::WorkerBase*> > >::operator[] () from /usr/local/lib/pwlib/devices/sound/oss_pwplugin.so #4 0x019da3b3 in PFactory<PSoundChannel, PString>::Register_Internal () from /usr/local/lib/pwlib/devices/sound/oss_pwplugin.so #5 0x019d9efb in PFactory<PSoundChannel, PString>::Register () from /usr/local/lib/pwlib/devices/sound/oss_pwplugin.so #6 0x019d9a61 in PDevicePluginFactory<PSoundChannel, PString>::Worker::Worker () from /usr/local/lib/pwlib/devices/sound/oss_pwplugin.so #7 0x019d9183 in PPlugin_PSoundChannel_OSS_Registration::PPlugin_PSoundChannel_OSS_Registration () from /usr/local/lib/pwlib/devices/sound/oss_pwplugin.so #8 0x019d5a22 in PWLibPlugin_TriggerRegister () from /usr/local/lib/pwlib/devices/sound/oss_pwplugin.so #9 0x002fadd9 in PPluginManager::LoadPlugin () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #10 0x002fb8a4 in PPluginManager::LoadPluginDirectory () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #11 0x002fb5dc in PPluginManager::LoadPluginDirectory () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #12 0x002fb5dc in PPluginManager::LoadPluginDirectory () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #13 0x002fc816 in PPluginManager::LoadPluginDirectory () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #14 0x002fc8d6 in PluginLoaderStartup::OnStartup () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #15 0x00312719 in PProcess::PProcess$base () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #16 0x063a4b3f in MyProcess::MyProcess () from /usr/lib/asterisk/modules/chan_h323.so #17 0x063af39c in h323_end_point_create () from /usr/lib/asterisk/modules/chan_h323.so #18 0x063a2634 in reload_config (is_reload=0) at chan_h323.c:2738 #19 0x063a3a57 in load_module () at chan_h323.c:3115 #20 0x080aabf1 in load_resource (resource_name=0x8ff5f40 "chan_h323.so", global_symbols_only=Variable "global_symbols_only" is not available. ) at loader.c:660 #21 0x080ab0f1 in load_modules (preload_only=0) at loader.c:854 #22 0x0806ea42 in main (argc=2, argv=0xbfe775b4) at asterisk.c:2926 #23 0x00c04de3 in __libc_start_main () from /lib/tls/libc.so.6 #24 0x08057ae1 in ?? () *******************************
I get the same backtrace no matter if I configure PWLib with
./configure or with
./configure --enable-oss
Any ideas?
Best regards, Vlasis.
Hello Simon,
Good news, chan_h323 is now able to use H323Plus!
:-)
There is only one small problem, it segfaults whenever the chan_h323.so module is unloaded or Asterisk is stopped (in which case the module is unloaded again). Otherwise everything is working as expected.
The problem for the segfault, however, is not related to H323. It seems that it is related with chan_h323's log stream which is a derivative class of PProcess. Apparently the PWLib/PTLib change had an effect on this and it segfaults whenever the logstream object is deleted.
I have the feeling that it is related to the timerChangePipe[] array which is missing in the newest PWLib versions.
I tried to find some documentation about this array but I couldn't find any. I'd be grateful if you could give me some pointers as to where to look for relevant information in order to wrap up chan_h323's transition to H323Plus.
Best regards, Vlasis Hatzistavrou Kinetix Tele.com International Inc. 306 Victoria House, Victoria, Mahe, Seychelles Tel.: +302310556134 Fax: +302310556134 (ext. 0) GSM: +306977835653 e-mail: vhatz@kinetixtele.com http://www.kinetixtele.com
Postal address: Monastiriou 9 & Enotikon 54627 Thessaloniki Greece
Simon Horne wrote:
Plamen
GnuGk has been test compiled with h323plus.
Your error looks strange as it seems to like the code 2 lines above 656 which is identical . I suggest you look at code to see if you have not accidently modified something particularily look at gk_const.h as well as RasTbl.cxx:658
I have fixed the warning message.
Simon
-----Original Message----- From: Plamen Petkov [mailto:plamen@bg-tel.com] Sent: Friday, 26 October 2007 2:57 AM To: Simon Horne Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello, I try to compile Gnugk with H323plus. That is the result:
RasTbl.cxx:658: error: no matching function for call to `H460_FeatureOID::Add(const char[2], H460_FeatureContent)' /root/openh323/include/h460/h4601.h:969: note: candidates are: H460_FeatureParameter& H460_FeatureOID::Add(const PString&, H460_FeatureContent&) RasTbl.cxx: In member function `void CallTable::OnQosMonitoringReport(const PString&, const endptr&, H4609_QosMonitoringReportData&)': RasTbl.cxx:2790: warning: unused variable 'addr' make[1]: *** [obj_linux_x86_r/RasTbl.o] Error 1
Regards: Plamen
----- Original Message ----- From: "Simon Horne" s.horne@packetizer.com To: vhatz@kinetix.gr; h323plus@lists.packetizer.com Sent: Thursday, October 25, 2007 6:44 PM Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Vlasis
I am not sure what chan_h323 looks like but there should be no need to have timerChangePipe I think this is a left over from very old code.
Have a look at simple in the CVS http://h323plus.cvs.sourceforge.net/h323plus/applications/simple/ to see how to define the PProcess
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com]On Behalf Of Vlasis Hatzistavrou (KTI) Sent: Thursday, 25 October 2007 10:36 PM To: h323plus@lists.packetizer.com Subject: [h323plus] Using H323+ for Asterisk's chan_h323
Hello all,
I have been trying to compile chan_h323 with H323. It seems that I am almost done, although I get the following error:
g++ -DNDEBUG -I../../include -include ../../include/asterisk/autoconfig.h -fPIC -DP_USE_PRAGMA -D_REENTRANT -fno-exceptions -Wall -fPIC -DPIC -DNDEBUG -I/Downloads/h323p/ptlib_v1_12_0/include -DPTRACING -I/Downloads/h323p/h323plus/include -Os -pipe -felide-constructors -Wreorder -c ast_h323.cxx -o ast_h323.o ast_h323.cxx: In destructor `virtual MyProcess::~MyProcess()': ast_h323.cxx:194: error: `timerChangePipe' was not declared in this scope make[2]: *** [ast_h323.o] Error 1 make[1]: *** [h323/libchanh323.a] Error 2 make: *** [channels] Error 2
I went through the PWLib 1.12.0, and there is no occurrence of "timerChangePipe". In previous versions of PWLib "timerChangePipe" was used in quite a few places in the code.
I googled it, but I still don't know what it does.
If I comment it out in the destructor MyProcess::~MyProcess() it compiles, but the channel driver segfaults as soon as it is loaded...
-- Best regards, Vlasis Hatzistavrou.
Around October last year timerChangePipe[] was replaced by process.breakBlock;
I suggest you troll through the changelog http://openh323.cvs.sourceforge.net/openh323/pwlib/src/ptlib/unix/tlibthrd.c xx?view=log
There has been quite a few changes around october last year.
I hope this helps and we can move ahead with h323plus support in Asterisk.
Simon
-----Original Message----- From: Vlasis Hatzistavrou (KTI) [mailto:vhatz@kinetix.gr] Sent: Monday, 29 October 2007 6:44 PM To: Simon Horne Cc: Plamen Petkov; H323plus Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello Simon,
Good news, chan_h323 is now able to use H323Plus!
:-)
There is only one small problem, it segfaults whenever the chan_h323.so module is unloaded or Asterisk is stopped (in which case the module is unloaded again). Otherwise everything is working as expected.
The problem for the segfault, however, is not related to H323. It seems that it is related with chan_h323's log stream which is a derivative class of PProcess. Apparently the PWLib/PTLib change had an effect on this and it segfaults whenever the logstream object is deleted.
I have the feeling that it is related to the timerChangePipe[] array which is missing in the newest PWLib versions.
I tried to find some documentation about this array but I couldn't find any. I'd be grateful if you could give me some pointers as to where to look for relevant information in order to wrap up chan_h323's transition to H323Plus.
Best regards, Vlasis Hatzistavrou Kinetix Tele.com International Inc. 306 Victoria House, Victoria, Mahe, Seychelles Tel.: +302310556134 Fax: +302310556134 (ext. 0) GSM: +306977835653 e-mail: vhatz@kinetixtele.com http://www.kinetixtele.com
Postal address: Monastiriou 9 & Enotikon 54627 Thessaloniki Greece
Simon Horne wrote:
Plamen
GnuGk has been test compiled with h323plus.
Your error looks strange as it seems to like the code 2 lines above 656 which is identical . I suggest you look at code to see if you have not accidently modified something particularily look at gk_const.h as well as RasTbl.cxx:658
I have fixed the warning message.
Simon
-----Original Message----- From: Plamen Petkov [mailto:plamen@bg-tel.com] Sent: Friday, 26 October 2007 2:57 AM To: Simon Horne Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello, I try to compile Gnugk with H323plus. That is the result:
RasTbl.cxx:658: error: no matching function for call to `H460_FeatureOID::Add(const char[2], H460_FeatureContent)' /root/openh323/include/h460/h4601.h:969: note: candidates are: H460_FeatureParameter& H460_FeatureOID::Add(const PString&, H460_FeatureContent&) RasTbl.cxx: In member function `void
CallTable::OnQosMonitoringReport(const
PString&, const endptr&, H4609_QosMonitoringReportData&)': RasTbl.cxx:2790: warning: unused variable 'addr' make[1]: *** [obj_linux_x86_r/RasTbl.o] Error 1
Regards: Plamen
----- Original Message ----- From: "Simon Horne" s.horne@packetizer.com To: vhatz@kinetix.gr; h323plus@lists.packetizer.com Sent: Thursday, October 25, 2007 6:44 PM Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Vlasis
I am not sure what chan_h323 looks like but there should be no need to have timerChangePipe I think this is a left over from very old code.
Have a look at simple in the CVS http://h323plus.cvs.sourceforge.net/h323plus/applications/simple/ to see how to define the PProcess
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com]On Behalf Of Vlasis Hatzistavrou (KTI) Sent: Thursday, 25 October 2007 10:36 PM To: h323plus@lists.packetizer.com Subject: [h323plus] Using H323+ for Asterisk's chan_h323
Hello all,
I have been trying to compile chan_h323 with H323. It seems that I am almost done, although I get the following error:
g++ -DNDEBUG -I../../include -include ../../include/asterisk/autoconfig.h -fPIC -DP_USE_PRAGMA -D_REENTRANT -fno-exceptions -Wall -fPIC -DPIC -DNDEBUG -I/Downloads/h323p/ptlib_v1_12_0/include -DPTRACING -I/Downloads/h323p/h323plus/include -Os -pipe -felide-constructors -Wreorder -c ast_h323.cxx -o ast_h323.o ast_h323.cxx: In destructor `virtual MyProcess::~MyProcess()': ast_h323.cxx:194: error: `timerChangePipe' was not declared in this scope make[2]: *** [ast_h323.o] Error 1 make[1]: *** [h323/libchanh323.a] Error 2 make: *** [channels] Error 2
I went through the PWLib 1.12.0, and there is no occurrence of "timerChangePipe". In previous versions of PWLib "timerChangePipe" was used in quite a few places in the code.
I googled it, but I still don't know what it does.
If I comment it out in the destructor MyProcess::~MyProcess() it compiles, but the channel driver segfaults as soon as it is loaded...
-- Best regards, Vlasis Hatzistavrou.
Thank you very much, Simon,
I'll get to work right away.
Best regards, Vlasis.
Simon Horne wrote:
Around October last year timerChangePipe[] was replaced by process.breakBlock;
I suggest you troll through the changelog http://openh323.cvs.sourceforge.net/openh323/pwlib/src/ptlib/unix/tlibthrd.c xx?view=log
There has been quite a few changes around october last year.
I hope this helps and we can move ahead with h323plus support in Asterisk.
Simon
-----Original Message----- From: Vlasis Hatzistavrou (KTI) [mailto:vhatz@kinetix.gr] Sent: Monday, 29 October 2007 6:44 PM To: Simon Horne Cc: Plamen Petkov; H323plus Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello Simon,
Good news, chan_h323 is now able to use H323Plus!
:-)
There is only one small problem, it segfaults whenever the chan_h323.so module is unloaded or Asterisk is stopped (in which case the module is unloaded again). Otherwise everything is working as expected.
The problem for the segfault, however, is not related to H323. It seems that it is related with chan_h323's log stream which is a derivative class of PProcess. Apparently the PWLib/PTLib change had an effect on this and it segfaults whenever the logstream object is deleted.
I have the feeling that it is related to the timerChangePipe[] array which is missing in the newest PWLib versions.
I tried to find some documentation about this array but I couldn't find any. I'd be grateful if you could give me some pointers as to where to look for relevant information in order to wrap up chan_h323's transition to H323Plus.
Best regards, Vlasis Hatzistavrou Kinetix Tele.com International Inc. 306 Victoria House, Victoria, Mahe, Seychelles Tel.: +302310556134 Fax: +302310556134 (ext. 0) GSM: +306977835653 e-mail: vhatz@kinetixtele.com http://www.kinetixtele.com
Postal address: Monastiriou 9 & Enotikon 54627 Thessaloniki Greece
Simon Horne wrote:
Plamen
GnuGk has been test compiled with h323plus.
Your error looks strange as it seems to like the code 2 lines above 656 which is identical . I suggest you look at code to see if you have not accidently modified something particularily look at gk_const.h as well as RasTbl.cxx:658
I have fixed the warning message.
Simon
-----Original Message----- From: Plamen Petkov [mailto:plamen@bg-tel.com] Sent: Friday, 26 October 2007 2:57 AM To: Simon Horne Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello, I try to compile Gnugk with H323plus. That is the result:
RasTbl.cxx:658: error: no matching function for call to `H460_FeatureOID::Add(const char[2], H460_FeatureContent)' /root/openh323/include/h460/h4601.h:969: note: candidates are: H460_FeatureParameter& H460_FeatureOID::Add(const PString&, H460_FeatureContent&) RasTbl.cxx: In member function `void
CallTable::OnQosMonitoringReport(const
PString&, const endptr&, H4609_QosMonitoringReportData&)': RasTbl.cxx:2790: warning: unused variable 'addr' make[1]: *** [obj_linux_x86_r/RasTbl.o] Error 1
Regards: Plamen
----- Original Message ----- From: "Simon Horne" s.horne@packetizer.com To: vhatz@kinetix.gr; h323plus@lists.packetizer.com Sent: Thursday, October 25, 2007 6:44 PM Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Vlasis
I am not sure what chan_h323 looks like but there should be no need to have timerChangePipe I think this is a left over from very old code.
Have a look at simple in the CVS http://h323plus.cvs.sourceforge.net/h323plus/applications/simple/ to see how to define the PProcess
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com]On Behalf Of Vlasis Hatzistavrou (KTI) Sent: Thursday, 25 October 2007 10:36 PM To: h323plus@lists.packetizer.com Subject: [h323plus] Using H323+ for Asterisk's chan_h323
Hello all,
I have been trying to compile chan_h323 with H323. It seems that I am almost done, although I get the following error:
g++ -DNDEBUG -I../../include -include ../../include/asterisk/autoconfig.h -fPIC -DP_USE_PRAGMA -D_REENTRANT -fno-exceptions -Wall -fPIC -DPIC -DNDEBUG -I/Downloads/h323p/ptlib_v1_12_0/include -DPTRACING -I/Downloads/h323p/h323plus/include -Os -pipe -felide-constructors -Wreorder -c ast_h323.cxx -o ast_h323.o ast_h323.cxx: In destructor `virtual MyProcess::~MyProcess()': ast_h323.cxx:194: error: `timerChangePipe' was not declared in this scope make[2]: *** [ast_h323.o] Error 1 make[1]: *** [h323/libchanh323.a] Error 2 make: *** [channels] Error 2
I went through the PWLib 1.12.0, and there is no occurrence of "timerChangePipe". In previous versions of PWLib "timerChangePipe" was used in quite a few places in the code.
I googled it, but I still don't know what it does.
If I comment it out in the destructor MyProcess::~MyProcess() it compiles, but the channel driver segfaults as soon as it is loaded...
-- Best regards, Vlasis Hatzistavrou.
Hello Simon,
I made quite some progress with chan_h323 and H323Plus.
The only problem that remains is that now Asterisk segfaults when the module unloads OR it is stopped (depending on the changes of the code, see below).
1) Initially, I traced the problem (first time user of gdb!!!) to when the function h323_end_process is called below, whenever the module is unloaded:
void h323_end_process(void) { if (endPoint) { endPoint->ClearAllCalls(); endPoint->RemoveListener(NULL); delete endPoint; endPoint = NULL; } if (localProcess) { delete localProcess; localProcess = NULL; /* close(_timerChangePipe[0]); */ /* close(_timerChangePipe[1]); */ } if (logstream) { PTrace::SetLevel(0); PTrace::SetStream(&cout); delete logstream; logstream = NULL; } }
I have found out that the segfault will happen after asterisk exits PTrace::SetStream , so I assume that "delete logstream" must be causing the problem. The above code would cause a segfault when chan_h323.so was unloaded.
2) gdb showed that logstream (a class concerning the logs of chan_h323) is in fact deleted during "PTrace::SetStream", so I tried to comment out the " delete logstream; logstream = NULL;" part of the code.
This seemed to do the trick partially, because then the module chan_h323.so would load and unload any number of times. However, asterisk would segfault when it was stopped, even if chan_h323.so was unloaded.
A useful fact is that asterisk seems to exit first by giving a signal SIG32, and AFTER that it segfaults:
*CLI> stop now [asterisk's command to shut down]
Program received signal SIG32, Real-time event 32. [Switching to Thread -1208759376 (LWP 17320)] 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 (gdb) continue Continuing.
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1208756544 (LWP 17316)] 0x00322388 in PFactoryBase::FactoryMap::~FactoryMap () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 (gdb) where #0 0x00322388 in PFactoryBase::FactoryMap::~FactoryMap () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #1 0x003223ce in __tcf_0 () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #2 0x00c1a7a4 in __cxa_finalize () from /lib/tls/libc.so.6 #3 0x00225362 in __do_global_dtors_aux () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #4 0x00322cb2 in _fini () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #5 0x00be3907 in _dl_fini () from /lib/ld-linux.so.2 #6 0x00c1a527 in exit () from /lib/tls/libc.so.6 #7 0x0806c056 in quit_handler (num=Variable "num" is not available. ) at asterisk.c:1325 #8 0x0806c2c9 in handle_shutdown_now (fd=1, argc=2, argv=0xbff78b40) at asterisk.c:1504 #9 0x0808e1be in ast_cli_command (fd=1, s=0x9233068 "HG#\t¨<#\t") at cli.c:1979 #10 0x0806f718 in main (argc=2, argv=0xbff790c4) at asterisk.c:1395 #11 0x00c04de3 in __libc_start_main () from /lib/tls/libc.so.6 #12 0x08057ae1 in ?? ()
It seems that not deleting logstream explicitly leaves a lingering problem (where ???), but trying to delete it causes a segfault right then and there.
Note: As you can see in the code snippet above, I have just commented out the use of _timerChangePipe[], which was use in the destructor of MyProcess:
MyProcess::~MyProcess() { _timerChangePipe[0] = timerChangePipe[0]; _timerChangePipe[1] = timerChangePipe[1]; }
I have been trying to tackle this issue since quite a few days now with no serious progress, so any pointers as to where to look will be highly appreciated...
Best regards, Vlasis Hatzistavrou Kinetix Tele.com International Inc. 306 Victoria House, Victoria, Mahe, Seychelles Tel.: +302310556134 Fax: +302310556134 (ext. 0) GSM: +306977835653 e-mail: vhatz@kinetixtele.com http://www.kinetixtele.com
Postal address: Monastiriou 9 & Enotikon 54627 Thessaloniki Greece
Simon Horne wrote:
Around October last year timerChangePipe[] was replaced by process.breakBlock;
I suggest you troll through the changelog http://openh323.cvs.sourceforge.net/openh323/pwlib/src/ptlib/unix/tlibthrd.c xx?view=log
There has been quite a few changes around october last year.
I hope this helps and we can move ahead with h323plus support in Asterisk.
Simon
-----Original Message----- From: Vlasis Hatzistavrou (KTI) [mailto:vhatz@kinetix.gr] Sent: Monday, 29 October 2007 6:44 PM To: Simon Horne Cc: Plamen Petkov; H323plus Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello Simon,
Good news, chan_h323 is now able to use H323Plus!
:-)
There is only one small problem, it segfaults whenever the chan_h323.so module is unloaded or Asterisk is stopped (in which case the module is unloaded again). Otherwise everything is working as expected.
The problem for the segfault, however, is not related to H323. It seems that it is related with chan_h323's log stream which is a derivative class of PProcess. Apparently the PWLib/PTLib change had an effect on this and it segfaults whenever the logstream object is deleted.
I have the feeling that it is related to the timerChangePipe[] array which is missing in the newest PWLib versions.
I tried to find some documentation about this array but I couldn't find any. I'd be grateful if you could give me some pointers as to where to look for relevant information in order to wrap up chan_h323's transition to H323Plus.
Best regards, Vlasis Hatzistavrou Kinetix Tele.com International Inc. 306 Victoria House, Victoria, Mahe, Seychelles Tel.: +302310556134 Fax: +302310556134 (ext. 0) GSM: +306977835653 e-mail: vhatz@kinetixtele.com http://www.kinetixtele.com
Postal address: Monastiriou 9 & Enotikon 54627 Thessaloniki Greece
Simon Horne wrote:
Plamen
GnuGk has been test compiled with h323plus.
Your error looks strange as it seems to like the code 2 lines above 656 which is identical . I suggest you look at code to see if you have not accidently modified something particularily look at gk_const.h as well as RasTbl.cxx:658
I have fixed the warning message.
Simon
-----Original Message----- From: Plamen Petkov [mailto:plamen@bg-tel.com] Sent: Friday, 26 October 2007 2:57 AM To: Simon Horne Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello, I try to compile Gnugk with H323plus. That is the result:
RasTbl.cxx:658: error: no matching function for call to `H460_FeatureOID::Add(const char[2], H460_FeatureContent)' /root/openh323/include/h460/h4601.h:969: note: candidates are: H460_FeatureParameter& H460_FeatureOID::Add(const PString&, H460_FeatureContent&) RasTbl.cxx: In member function `void
CallTable::OnQosMonitoringReport(const
PString&, const endptr&, H4609_QosMonitoringReportData&)': RasTbl.cxx:2790: warning: unused variable 'addr' make[1]: *** [obj_linux_x86_r/RasTbl.o] Error 1
Regards: Plamen
----- Original Message ----- From: "Simon Horne" s.horne@packetizer.com To: vhatz@kinetix.gr; h323plus@lists.packetizer.com Sent: Thursday, October 25, 2007 6:44 PM Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Vlasis
I am not sure what chan_h323 looks like but there should be no need to have timerChangePipe I think this is a left over from very old code.
Have a look at simple in the CVS http://h323plus.cvs.sourceforge.net/h323plus/applications/simple/ to see how to define the PProcess
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com]On Behalf Of Vlasis Hatzistavrou (KTI) Sent: Thursday, 25 October 2007 10:36 PM To: h323plus@lists.packetizer.com Subject: [h323plus] Using H323+ for Asterisk's chan_h323
Hello all,
I have been trying to compile chan_h323 with H323. It seems that I am almost done, although I get the following error:
g++ -DNDEBUG -I../../include -include ../../include/asterisk/autoconfig.h -fPIC -DP_USE_PRAGMA -D_REENTRANT -fno-exceptions -Wall -fPIC -DPIC -DNDEBUG -I/Downloads/h323p/ptlib_v1_12_0/include -DPTRACING -I/Downloads/h323p/h323plus/include -Os -pipe -felide-constructors -Wreorder -c ast_h323.cxx -o ast_h323.o ast_h323.cxx: In destructor `virtual MyProcess::~MyProcess()': ast_h323.cxx:194: error: `timerChangePipe' was not declared in this scope make[2]: *** [ast_h323.o] Error 1 make[1]: *** [h323/libchanh323.a] Error 2 make: *** [channels] Error 2
I went through the PWLib 1.12.0, and there is no occurrence of "timerChangePipe". In previous versions of PWLib "timerChangePipe" was used in quite a few places in the code.
I googled it, but I still don't know what it does.
If I comment it out in the destructor MyProcess::~MyProcess() it compiles, but the channel driver segfaults as soon as it is loaded...
-- Best regards, Vlasis Hatzistavrou.
Vlasis
Here is my suggestion. Do not create a process which you delete this causes problems with the factory system which is causing the segfault on shutdown. Use the PDECLARE_PROCESS macro instead to create a process for the life of the application.
So in place of your PProcess class you have
PDECLARE_PROCESS(asterisk,PProcess,"Asterisk","chan_h323",MAJOR_VERSION,MINO R_VERSION,BUILD_TYPE,BUILD_NUMBER) static asterisk chan_h323; // active for the life of the DLL void asterisk::Main() // implement the virtual function which is never called { }
I use this with PacPhone which has h323plus in an windows activeX DLL. It works fine.
so now the end Process can be simplified to:
void h323_end_process(void) { if (endPoint) { delete endPoint; endPoint = NULL; } if (logstream) { delete logstream; logstream = NULL; } }
This is my suggestion.
Simon
-----Original Message----- From: Vlasis Hatzistavrou (KTI) [mailto:vhatz@kinetix.gr] Sent: Saturday, 3 November 2007 1:12 AM To: Simon Horne Cc: H323plus Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello Simon,
I made quite some progress with chan_h323 and H323Plus.
The only problem that remains is that now Asterisk segfaults when the module unloads OR it is stopped (depending on the changes of the code, see below).
1) Initially, I traced the problem (first time user of gdb!!!) to when the function h323_end_process is called below, whenever the module is unloaded:
void h323_end_process(void) { if (endPoint) { endPoint->ClearAllCalls(); endPoint->RemoveListener(NULL); delete endPoint; endPoint = NULL; } if (localProcess) { delete localProcess; localProcess = NULL; /* close(_timerChangePipe[0]); */ /* close(_timerChangePipe[1]); */ } if (logstream) { PTrace::SetLevel(0); PTrace::SetStream(&cout); delete logstream; logstream = NULL; } }
I have found out that the segfault will happen after asterisk exits PTrace::SetStream , so I assume that "delete logstream" must be causing the problem. The above code would cause a segfault when chan_h323.so was unloaded.
2) gdb showed that logstream (a class concerning the logs of chan_h323) is in fact deleted during "PTrace::SetStream", so I tried to comment out the " delete logstream; logstream = NULL;" part of the code.
This seemed to do the trick partially, because then the module chan_h323.so would load and unload any number of times. However, asterisk would segfault when it was stopped, even if chan_h323.so was unloaded.
A useful fact is that asterisk seems to exit first by giving a signal SIG32, and AFTER that it segfaults:
*CLI> stop now [asterisk's command to shut down]
Program received signal SIG32, Real-time event 32. [Switching to Thread -1208759376 (LWP 17320)] 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 (gdb) continue Continuing.
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1208756544 (LWP 17316)] 0x00322388 in PFactoryBase::FactoryMap::~FactoryMap () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 (gdb) where #0 0x00322388 in PFactoryBase::FactoryMap::~FactoryMap () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #1 0x003223ce in __tcf_0 () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #2 0x00c1a7a4 in __cxa_finalize () from /lib/tls/libc.so.6 #3 0x00225362 in __do_global_dtors_aux () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #4 0x00322cb2 in _fini () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #5 0x00be3907 in _dl_fini () from /lib/ld-linux.so.2 #6 0x00c1a527 in exit () from /lib/tls/libc.so.6 #7 0x0806c056 in quit_handler (num=Variable "num" is not available. ) at asterisk.c:1325 #8 0x0806c2c9 in handle_shutdown_now (fd=1, argc=2, argv=0xbff78b40) at asterisk.c:1504 #9 0x0808e1be in ast_cli_command (fd=1, s=0x9233068 "HG#\t¨<#\t") at cli.c:1979 #10 0x0806f718 in main (argc=2, argv=0xbff790c4) at asterisk.c:1395 #11 0x00c04de3 in __libc_start_main () from /lib/tls/libc.so.6 #12 0x08057ae1 in ?? ()
It seems that not deleting logstream explicitly leaves a lingering problem (where ???), but trying to delete it causes a segfault right then and there.
Note: As you can see in the code snippet above, I have just commented out the use of _timerChangePipe[], which was use in the destructor of MyProcess:
MyProcess::~MyProcess() { _timerChangePipe[0] = timerChangePipe[0]; _timerChangePipe[1] = timerChangePipe[1]; }
I have been trying to tackle this issue since quite a few days now with no serious progress, so any pointers as to where to look will be highly appreciated...
Best regards, Vlasis Hatzistavrou Kinetix Tele.com International Inc. 306 Victoria House, Victoria, Mahe, Seychelles Tel.: +302310556134 Fax: +302310556134 (ext. 0) GSM: +306977835653 e-mail: vhatz@kinetixtele.com http://www.kinetixtele.com
Postal address: Monastiriou 9 & Enotikon 54627 Thessaloniki Greece
Simon Horne wrote:
Around October last year timerChangePipe[] was replaced by process.breakBlock;
I suggest you troll through the changelog
http://openh323.cvs.sourceforge.net/openh323/pwlib/src/ptlib/unix/tlibthrd.c
xx?view=log
There has been quite a few changes around october last year.
I hope this helps and we can move ahead with h323plus support in Asterisk.
Simon
-----Original Message----- From: Vlasis Hatzistavrou (KTI) [mailto:vhatz@kinetix.gr] Sent: Monday, 29 October 2007 6:44 PM To: Simon Horne Cc: Plamen Petkov; H323plus Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello Simon,
Good news, chan_h323 is now able to use H323Plus!
:-)
There is only one small problem, it segfaults whenever the chan_h323.so module is unloaded or Asterisk is stopped (in which case the module is unloaded again). Otherwise everything is working as expected.
The problem for the segfault, however, is not related to H323. It seems that it is related with chan_h323's log stream which is a derivative class of PProcess. Apparently the PWLib/PTLib change had an effect on this and it segfaults whenever the logstream object is deleted.
I have the feeling that it is related to the timerChangePipe[] array which is missing in the newest PWLib versions.
I tried to find some documentation about this array but I couldn't find any. I'd be grateful if you could give me some pointers as to where to look for relevant information in order to wrap up chan_h323's transition to H323Plus.
Best regards, Vlasis Hatzistavrou Kinetix Tele.com International Inc. 306 Victoria House, Victoria, Mahe, Seychelles Tel.: +302310556134 Fax: +302310556134 (ext. 0) GSM: +306977835653 e-mail: vhatz@kinetixtele.com http://www.kinetixtele.com
Postal address: Monastiriou 9 & Enotikon 54627 Thessaloniki Greece
Simon Horne wrote:
Plamen
GnuGk has been test compiled with h323plus.
Your error looks strange as it seems to like the code 2 lines above 656 which is identical . I suggest you look at code to see if you have not accidently modified something particularily look at gk_const.h as well as RasTbl.cxx:658
I have fixed the warning message.
Simon
-----Original Message----- From: Plamen Petkov [mailto:plamen@bg-tel.com] Sent: Friday, 26 October 2007 2:57 AM To: Simon Horne Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Hello, I try to compile Gnugk with H323plus. That is the result:
RasTbl.cxx:658: error: no matching function for call to `H460_FeatureOID::Add(const char[2], H460_FeatureContent)' /root/openh323/include/h460/h4601.h:969: note: candidates are: H460_FeatureParameter& H460_FeatureOID::Add(const PString&, H460_FeatureContent&) RasTbl.cxx: In member function `void
CallTable::OnQosMonitoringReport(const
PString&, const endptr&, H4609_QosMonitoringReportData&)': RasTbl.cxx:2790: warning: unused variable 'addr' make[1]: *** [obj_linux_x86_r/RasTbl.o] Error 1
Regards: Plamen
----- Original Message ----- From: "Simon Horne" s.horne@packetizer.com To: vhatz@kinetix.gr; h323plus@lists.packetizer.com Sent: Thursday, October 25, 2007 6:44 PM Subject: Re: [h323plus] Using H323+ for Asterisk's chan_h323
Vlasis
I am not sure what chan_h323 looks like but there should be no need to have timerChangePipe I think this is a left over from very old code.
Have a look at simple in the CVS http://h323plus.cvs.sourceforge.net/h323plus/applications/simple/ to see how to define the PProcess
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com]On Behalf Of Vlasis Hatzistavrou (KTI) Sent: Thursday, 25 October 2007 10:36 PM To: h323plus@lists.packetizer.com Subject: [h323plus] Using H323+ for Asterisk's chan_h323
Hello all,
I have been trying to compile chan_h323 with H323. It seems that I am almost done, although I get the following error:
g++ -DNDEBUG -I../../include -include ../../include/asterisk/autoconfig.h -fPIC -DP_USE_PRAGMA -D_REENTRANT -fno-exceptions -Wall -fPIC -DPIC -DNDEBUG -I/Downloads/h323p/ptlib_v1_12_0/include -DPTRACING -I/Downloads/h323p/h323plus/include -Os -pipe -felide-constructors -Wreorder -c ast_h323.cxx -o ast_h323.o ast_h323.cxx: In destructor `virtual MyProcess::~MyProcess()': ast_h323.cxx:194: error: `timerChangePipe' was not declared in this
scope
make[2]: *** [ast_h323.o] Error 1 make[1]: *** [h323/libchanh323.a] Error 2 make: *** [channels] Error 2
I went through the PWLib 1.12.0, and there is no occurrence of "timerChangePipe". In previous versions of PWLib "timerChangePipe" was used in quite a few places in the code.
I googled it, but I still don't know what it does.
If I comment it out in the destructor MyProcess::~MyProcess() it compiles, but the channel driver segfaults as soon as it is loaded...
-- Best regards, Vlasis Hatzistavrou.
Hello Simon,
I did some more debugging. I tried to compare the way Asterisk + our modified chan_h323 exits with Asterisk + the standard chan_h323.
I have pasted the two results first is the behavior of our modified version. Aftert I give the 'stop now' command in Asterisk's CLI, we receive a SIG32. 'Info threads' gives info that thread 26998 is deleting ~FactoryMap().
If we see the behavior of the standard Asterisk after the 'stop now' command, we see that thread 26600 is (probably) flushing the last contents of some output stream and then exits normally.
I don't know what to make from these different behaviors...
Sorry if my progress is so slow or if my questions are "newbie-ish" but the fact is that I AM a newbie in the area...
:(
Any ideas would be appreciated...
The 2 pieces of debug info follow.
Best regards, Vlasis.
Asterisk 1.4.13 with modified chan_h323
******************* *CLI> stop now
Program received signal SIG32, Real-time event 32. [Switching to Thread -1208198224 (LWP 27002)] 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 (gdb) info threads 8 Thread -1209480272 (LWP 27007) 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 4 Thread -1208456272 (LWP 27003) 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 * 3 Thread -1208198224 (LWP 27002) 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 1 Thread -1208195392 (LWP 26998) 0x00322388 in PFactoryBase::FactoryMap::~FactoryMap () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 (gdb) cont Continuing.
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1208195392 (LWP 26998)] 0x00322388 in PFactoryBase::FactoryMap::~FactoryMap () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 (gdb) info threads 8 Thread -1209480272 (LWP 27007) 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 4 Thread -1208456272 (LWP 27003) 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 3 Thread -1208198224 (LWP 27002) 0x00d64821 in __deregister_frame () from /lib/libgcc_s.so.1 * 1 Thread -1208195392 (LWP 26998) 0x00322388 in PFactoryBase::FactoryMap::~FactoryMap () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 (gdb) bt #0 0x00322388 in PFactoryBase::FactoryMap::~FactoryMap () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #1 0x003223ce in __tcf_0 () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #2 0x00c1a7a4 in __cxa_finalize () from /lib/tls/libc.so.6 #3 0x00225362 in __do_global_dtors_aux () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #4 0x00322cb2 in _fini () from /Downloads/h323p/ptlib_v1_12_0/lib/libpt_linux_x86_r.so.1.12.0 #5 0x00be3907 in _dl_fini () from /lib/ld-linux.so.2 #6 0x00c1a527 in exit () from /lib/tls/libc.so.6 #7 0x0806c056 in quit_handler (num=Variable "num" is not available. ) at asterisk.c:1325 #8 0x0806c2c9 in handle_shutdown_now (fd=1, argc=2, argv=0xbfe82600) at asterisk.c:1504 #9 0x0808e1be in ast_cli_command (fd=1, s=0x87aa068 "H·z\b¨¬z\b") at cli.c:1979 #10 0x0806f718 in main (argc=2, argv=0xbfe82b84) at asterisk.c:1395 #11 0x00c04de3 in __libc_start_main () from /lib/tls/libc.so.6 #12 0x08057ae1 in ?? () *******************
Standard 1.4.13:
******************* *CLI> stop now
Program received signal SIG32, Real-time event 32. [Switching to Thread -1208595536 (LWP 26604)] 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 (gdb) info threads 8 Thread -1209877584 (LWP 26609) 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 4 Thread -1208853584 (LWP 26605) 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 * 3 Thread -1208595536 (LWP 26604) 0x00bd77a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 1 Thread -1208592704 (LWP 26600) 0x00477000 in std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::flush () from /usr/lib/libstdc++.so.6 (gdb) cont Continuing.
Program exited normally. *******************
participants (2)
-
Simon Horne
-
Vlasis Hatzistavrou (KTI)