pjsua: parse error --id on ARM ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes i have to agree with you. My solution isn't good because
other place give "(null)" strings and pjsua not work correctly...

But when precision is 0 and string is NULL pointer what should be function 
printf return? "(null)" string or "" string...I thing "(null)" is for debug 
purpose...and this behavior isn't defined..

Or is this behavior some norm ?...because if not,
and it's only feature glibc then it is "hack"...don't you think?


> I would agree with Samuel, the problem is with *printf() functions in
> newlib/uclibc, and you shoul fix that instead. We use "%.*s" format
> pretty much everywhere, there are lots of them throughout the library,
> and chances are some of them will give NULL in the pointer argument.
> Or worse, an arbitrary value that may crash your little board.
>
> Cheers
>  Benny
>
> On Thu, Nov 5, 2009 at 9:42 PM, Peter Lukac <p.lukac at emtest.sk> wrote:
> > Hi i solved my problem:
> >
> > in file
> > $PROJECT_DIRECTORY/pjsip/src/pjsua-lib/pjsua_acc.c
> >
> > and in function:
> >
> > PJ_DEF(pj_status_t) pjsua_acc_create_uac_contact( pj_pool_t *pool,
> >                          pj_str_t *contact,
> >                          pjsua_acc_id acc_id,
> >                          const pj_str_t *suri)
> >
> >
> > is line :
> >
> > contact->slen = pj_ansi_snprintf(contact->ptr, PJSIP_MAX_URL_SIZE,
> >                     "%.*s%s<%s:%.*s%s%s%.*s%s:%d%s%.*s>%.*s",
> >                     (int)acc->display.slen,
> >                     acc->display.ptr,
> >                     (acc->display.slen?" " : ""),
> >                     (secure ? PJSUA_SECURE_SCHEME : "sip"),
> >                     (int)acc->user_part.slen,
> >                     acc->user_part.ptr,
> >                     (acc->user_part.slen?"@":""),
> >                     beginquote,
> >                     (int)local_addr.slen,
> >                     local_addr.ptr,
> >                     endquote,
> >                     local_port,
> >                     transport_param,
> >                     (int)acc->cfg.contact_uri_params.slen,
> >                     acc->cfg.contact_uri_params.ptr,
> >                     (int)acc->cfg.contact_params.slen,
> >                     acc->cfg.contact_params.ptr);
> >
> >
> > arguments:
> > acc->display.ptr
> > acc->cfg.contact_uri_params.ptr
> > acc->cfg.contact_params.ptr
> >
> > are NULL strings. Function pj_ansi_snprintf("%s",null_string) with
> > null_string pointer generate "(null)" string...is interesting because on
> > i386 is this string too NULL and function do not create "(null)" string
> > :)
> >
> > So solution is simple, but i don't know whether is sufficient because is
> > lot of code where is used pj_ansi_snprintf with potentian null_string
> > arguments. Maybe this fix should by in function pj_ansi_snprintf. but for
> > this situation it works... :)
> >
> > Parameters:
> >
> > acc->display.ptr
> > acc->cfg.contact_uri_params.ptr
> > acc->cfg.contact_params.ptr
> >
> > replace with
> >
> > (acc->display.ptr? acc->display.ptr:"")
> > (acc->cfg.contact_uri_params.ptr?acc->cfg.contact_uri_params.ptr:"")
> > (acc->cfg.contact_params.ptr?acc->cfg.contact_params.ptr:"")
> >
> >
> > ...have a nice day
> >
> >> Hello,
> >>
> >> I think your problem comes from ulibc in function vsprintf or sprintf. I
> >> had this problem in newlib 2 years ago.
> >>
> >> This function seems not correctly manages format : %.*s.
> >> I think
> >>     printf("%.*s\n",len,(char *)NULL); *display*s (null)
> >>     snprintf(ptr, 40, "%.*s", len, (char *)NULL) *give* ptr = "(null)".
> >>
> >>
> >> Samuel
> >>
> >> Antonio Anton a ?crit :
> >> > Hi,
> >> >
> >> > I have the same error for MIPS architecture ; I posted exactly same
> >> > details of yours few days ago.
> >> >
> >> > Hope any experienced guru can help us. I have tried to trace back
> >> > where the issue may be but I have no knowledge of the internals of
> >> > PJSIP, structures, etc.. and I don't know where to start looking
> >> > for...
> >> >
> >> > Regards
> >> > Antonio
> >> >
> >> > El mi?, 04-11-2009 a las 16:05 +0100, Peter Lukac escribi?:
> >> >> hello,
> >> >> I have little problem :)
> >> >>
> >> >> I have embeded device on ARM CPU 255 architecture 5TE and i cross
> >> >> compile pjsip library as:
> >> >>
> >> >> export CFLAGS="-pipe -I/usr/toolchain-arm-26/usr/include
> >> >> -I/usr/toolchain- arm-26/include --sysroot=/usr/toolchain-arm-26/
> >> >> -isysroot /usr/toolchain- arm-26-mtune=xscale -mabi=aapcs-linux
> >> >> -msoft-float"
> >> >>
> >> >> ./configure --prefix=/opt/emtest/arm_install --host=arm-linux
> >> >> --disable-oss make dep && make
> >> >>
> >> >> In my toolchain is used uclibc version 0.9.29 non standart libc.
> >> >>
> >> >> For my testing purpose i using pjsua test application. but when i
> >> >> starting aplication :
> >> >>
> >> >> ./pjsua --id sip:pc1 at 192.168.32.17 --registrar sip:192.168.32.123
> >> >> --realm asterisk --username pc1 --password heslo --app-log-level 6
> >> >> --log-level 6
> >> >>
> >> >> i get error:
> >> >>
> >> >>  15:41:46.080      sip_reg.c  Invalid Contact:
> >> >> "(null)<sip:pc1 at 192.168.32.17:5060(null)>(null)"
> >> >>
> >> >> here is full output:
> >> >>
> >> >>  15:41:45.535 os_core_unix.c  pjlib 1.4.5 for POSIX initialized
> >> >>  15:41:45.540 sip_endpoint.c  Creating endpoint instance...
> >> >>  15:41:45.548          pjlib  select() I/O Queue created (0x21c500)
> >> >>  15:41:45.550 sip_endpoint.c  Module "mod-msg-print" registered
> >> >>  15:41:45.553 sip_transport.  Transport manager created.
> >> >>  15:41:45.557 sip_endpoint.c  Module "mod-pjsua-log" registered
> >> >>  15:41:45.560 sip_endpoint.c  Module "mod-tsx-layer" registered
> >> >>  15:41:45.563 sip_endpoint.c  Module "mod-stateful-util" registered
> >> >>  15:41:45.565 sip_endpoint.c  Module "mod-ua" registered
> >> >>  15:41:45.568 sip_endpoint.c  Module "mod-100rel" registered
> >> >>  15:41:45.570 sip_endpoint.c  Module "mod-pjsua" registered
> >> >>  15:41:45.573 sip_endpoint.c  Module "mod-invite" registered
> >> >>  15:41:45.856       pa_dev.c  PortAudio sound library initialized,
> >> >> status=0 15:41:45.857       pa_dev.c  PortAudio host api count=1
> >> >>  15:41:45.860       pa_dev.c  Sound device count=2
> >> >>  15:41:45.868          pjlib  select() I/O Queue created (0x22d654)
> >> >>  15:41:45.880   conference.c  Creating conference bridge with 254
> >> >> ports 15:41:46.024 sip_endpoint.c  Module "mod-evsub" registered
> >> >>  15:41:46.026 sip_endpoint.c  Module "mod-presence" registered
> >> >>  15:41:46.029        evsub.c  Event pkg "presence" registered by
> >> >> mod-presence 15:41:46.031 sip_endpoint.c  Module "mod-refer"
> >> >> registered 15:41:46.033        evsub.c  Event pkg "refer" registered
> >> >> by mod-refer 15:41:46.035 sip_endpoint.c  Module "mod-pjsua-pres"
> >> >> registered 15:41:46.038 sip_endpoint.c  Module "mod-pjsua-im"
> >> >> registered 15:41:46.041 sip_endpoint.c  Module "mod-pjsua-options"
> >> >> registered 15:41:46.044   pjsua_core.c  1 SIP worker threads created
> >> >>  15:41:46.046   pjsua_core.c  pjsua version 1.4.5 for
> >> >> arm-unknown-linux-gnu initialized
> >> >>  15:41:46.049 sip_endpoint.c  Module "mod-default-handler" registered
> >> >>  15:41:46.054   pjsua_core.c  SIP UDP socket reachable at
> >> >> 192.168.32.17:5060 15:41:46.059    udp0x243d70  SIP UDP transport
> >> >> started, published address is 192.168.32.17:5060
> >> >>  15:41:46.062    pjsua_acc.c  Account <sip:192.168.32.17:5060> added
> >> >> with id 0 15:41:46.068    tcplis:5060  SIP TCP listener ready for
> >> >> incoming connections at 192.168.32.17:5060
> >> >>  15:41:46.071    pjsua_acc.c  Account
> >> >> <sip:192.168.32.17:5060;transport=TCP> added with id 1
> >> >>  15:41:46.074    pjsua_acc.c  Account sip:pc1 at 192.168.32.17 added
> >> >> with id 2 15:41:46.080      sip_reg.c  Invalid Contact:
> >> >> "(null)<sip:pc1 at 192.168.32.17:5060(null)>(null)"
> >> >>  15:41:46.083    pjsua_acc.c  Client registration initialization
> >> >> error: Invalid URI (PJSIP_EINVALIDURI) [status=171039]
> >> >>  15:41:46.085    pjsua_acc.c  Unable to create registration: Invalid
> >> >> URI (PJSIP_EINVALIDURI) [status=171039]
> >> >>  15:41:46.089  pjsua_media.c  RTP socket reachable at
> >> >> 192.168.32.17:4000 15:41:46.091  pjsua_media.c  RTCP socket reachable
> >> >> at
> >> >> 192.168.32.17:4001 15:41:46.098  pjsua_media.c  RTP socket reachable
> >> >> at 192.168.32.17:4002 15:41:46.100  pjsua_media.c  RTCP socket
> >> >> reachable at 192.168.32.17:4003 15:41:46.107  pjsua_media.c  RTP
> >> >> socket reachable at 192.168.32.17:4004 15:41:46.109  pjsua_media.c
> >> >>  RTCP socket reachable at 192.168.32.17:4005 15:41:46.116
> >> >>  pjsua_media.c  RTP socket reachable at 192.168.32.17:4006
> >> >> 15:41:46.118  pjsua_media.c  RTCP socket reachable at
> >> >> 192.168.32.17:4007
> >> >>
> >> >> Account list:
> >> >>   [ 0] <sip:192.168.32.17:5060>: does not register
> >> >>        Online status: Online
> >> >>   [ 1] <sip:192.168.32.17:5060;transport=TCP>: does not register
> >> >>        Online status: Online
> >> >>  *[ 2] sip:pc1 at 192.168.32.17: 100/In Progress (expires=-1)
> >> >>        Online status: Online
> >> >> Buddy list:
> >> >>  -none-
> >> >>
> >> >> When i try enter account information from menu i get same result:
> >> >>>>> +a
> >> >>
> >> >> Your SIP URL: (empty to cancel): sip:pc1 at 192.168.32.17
> >> >> URL of the registrar: (empty to cancel): sip:192.168.32.123
> >> >> Auth Realm: (empty to cancel): asterisk
> >> >> Auth Username: (empty to cancel): pc1
> >> >> Auth Password: (empty to cancel): heslo
> >> >>  15:51:04.794    pjsua_acc.c  Account sip:pc1 at 192.168.32.17 added
> >> >> with id 2 15:51:04.798      sip_reg.c  Invalid Contact:
> >> >> "(null)<sip:pc1 at 192.168.32.17:5060(null)>(null)"
> >> >>  15:51:04.798    pjsua_acc.c  Client registration initialization
> >> >> error: Invalid URI (PJSIP_EINVALIDURI) [status=171039]
> >> >>  15:51:04.799    pjsua_acc.c  Unable to create registration: Invalid
> >> >> URI (PJSIP_EINVALIDURI) [status=171039]
> >> >>
> >> >> On 386 it works fine. i try last trunk version 2985. and
> >> >> pjproject-1.4.5.tar.bz2 from download page too and i get same error.
> >> >>
> >> >> Can me somebody help?
> >> >>
> >> >>
> >> >> ...thank you
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> _______________________________________________
> >> >> Visit our blog: http://blog.pjsip.org
> >> >>
> >> >> pjsip mailing list
> >> >> pjsip at lists.pjsip.org
> >> >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> >> >
> >> > _______________________________________________
> >> > Visit our blog: http://blog.pjsip.org
> >> >
> >> > pjsip mailing list
> >> > pjsip at lists.pjsip.org
> >> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> >
> > _______________________________________________
> > Visit our blog: http://blog.pjsip.org
> >
> > pjsip mailing list
> > pjsip at lists.pjsip.org
> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
> !DSPAM:153,4af4092384261343920161!




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux