Hi there, 
We are just starting to "get our feet wet" with sipX code, so apology if
this is a known issue. I was not able to find a similar issue in Jira,
nor in the sipx-dev list archive.
Basically we have a simple example that sets up an UA. However, we also
enable logging to screen via OsSysLog (osPrintf) in the example.
We get the following SEGV in strlen() from osPrintf. 

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1074792768 (LWP 12326)]
0x0000003e1ea76090 in strlen () from /lib64/libc.so.6
(gdb) where
#0 0x0000003e1ea76090 in strlen () from /lib64/libc.so.6
#1 0x0000003e1ea4602b in vfprintf () from /lib64/libc.so.6
#2 0x0000003e1ea671fa in vsnprintf () from /lib64/libc.so.6
#3 0x00002aaaab14fbc6 in osPrintf (format=0x2aaaab177582 "%s\n")
at os/osPrintf.cpp:75
#4 0x00002aaaab15bc71 in OsSysLogTask::processAdd
(this=0x13d49d60,pEntry=0x2aaaac012e30
"\"2008-09-04T06:52:23.949474Z\":132:OUTGOING:INFO:eng-srv-001.bsn.prola
ncer.com.au:SipClientTcp-13:40B0A940:TMCClient:\"SipUserAgent::sendTcp
TCP SIP User Agent sent message:\\n----Remote Host:192.168.120"...) at
os/OsSysLogTask.cpp:360
#5 0x00002aaaab15bf85 in OsSysLogTask::handleMessage (this=0x13d49d60,
[EMAIL PROTECTED]) at os/OsSysLogTask.cpp:264
#6 0x00002aaaab154b17 in OsServerTask::run (this=0x13d49d60,
pArg=<value optimized out>) at os/OsServerTask.cpp:160
#7 0x00002aaaab16ae1a in OsTaskLinux::taskEntry (arg=<value optimized
out>)
at os/linux/OsTaskLinux.cpp:705
#8 0x0000003e1f6062e7 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003e1eace3bd in clone () from /lib64/libc.so.6
(gdb) 

Google reveals many similar issues with strlen() when called from
vsnprintf() with format similar to "%s\n". However, they all appear to
be related to older versions of libc. 
We are on CentOS 5.1. Other (possibly) useful information: 

[EMAIL PROTECTED] sipXportLib]$ uname -a
Linux eng-srv-001 2.6.18-53.el5 #1 SMP Mon Nov 12 02:14:55 EST 2007
x86_64 x86_64 x86_64 GNU/Linux 

[EMAIL PROTECTED] sipXportLib]$ gcc --version
gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. 

[EMAIL PROTECTED] sipXportLib]$ rpm -a | grep glibc
glibc-common-2.5-18
glibc-2.5-18
glibc-headers-2.5-18
glibc-devel-2.5-18
glibc-2.5-18
glibc-devel-2.5-18 

[EMAIL PROTECTED] sipXportLib]$ svn log src/os/osPrintf.cpp
------------------------------------------------------------------------
r9999 | xmlscott | 2007-04-14 19:44:10 +1000 (Sat, 14 Apr 2007) | 1 line


import sipXecs sources from pingtel rev 8178
------------------------------------------------------------------------


Shall we log this as an issue in Jira, or is there a solution for it
already? If there is a solution, please let us know.
We changed line 64 in osPrintef.cpp to the following as a temporary work
around. 
        int n, size = 4096; // from "int n, size = 128;" 

Thank you, 
--
Emil
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev

Reply via email to