[Ace-users] Re: [tao-users] [tao-bugs] TAO_UIPMC_Endpoint::is_equivalent is broken

Johnny Willemsen jwillemsen at remedy.nl
Sat Jul 21 00:37:46 CDT 2007


Thanks for using the PRF form. Can you store this in bugzilla (see
http://deuce.doc.wustl.edu/bugzilla/index.cgi) so that we can track this.

Vadym, this is your change, can you look at this PRF, extend the regression
test to cover this case and fix this problem before the scheduled x.5.10?


Johnny Willemsen
Remedy IT
Postbus 101
2650 AC  Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl  

*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl ***
*** Commercial service and support for ACE/TAO/CIAO             ***
*** See http://www.theaceorb.nl/en/support.html                 ***

"Daniel de Angelis Cordeiro" <dcordeiro at gmail.com> wrote in message
news:<mailman.1486.1184950650.5286.tao-bugs at mail.cse.wustl.edu>...
> TAO VERSION: 1.5.9
> ACE VERSION: 5.5.9
> $ uname -a
> Linux 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux
> Class UIPMC_Endpoint and the multicast module are affected
> Function 'TAO_UIPMC_Endpoint::is_equivalent' always returns true if
> the two endpoints being compared have the same port.
> The function 'TAO_UIPMC_Endpoint::is_equivalent' defines two endpoints
> as equal if they satisfies the following expression:
> (this->port_ == endpoint->port_
>      && ACE_OS::strcmp (this->get_host_addr (),
> endpoint->get_host_addr ()) == 0);
> get_host_addr() calls the method ACE_INET_Addr::get_host_addr() that
> returns the result of a call to ACE_OS::inet_ntoa().
> The manpage of inet_ntoa() says that the function returns a char * to
> a static region to the memory and that subsequent calls overwrite the
> contents of this region.
> So, if the two ports are equal, the strcmp function will receive the
> same pointer as arguments and will always return 0.
> As consequence, when the GOA calls TAO_GOA::create_group_acceptors,
> the TAO_PortableGroup_Acceptor_Registry does not create more than one
> acceptor for each port and the acceptor for new multicast addresses
> are not created.
> This bug was introduced in commit 78280, when the use of the variable
> char *class_d_address_[] was deprecated. Before that, a copy of the
> string returned by inet_ntoa() was stored in the class_d_address and
> this copy was used to do the comparison.
> Use TAO_UIPMC_Endpoint::addr_to_string() to create the "stringfied"
> version of the IP and use it to compare the endpoints.

More information about the Ace-users mailing list