You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Samisa Abeysinghe <sa...@gmail.com> on 2005/01/25 09:11:23 UTC

m_iLibCount in ChannelFactory class

Hi,
    m_iLibCount in ChannelFactory class hit the celing value
ChannelFactory_MaxListSize (which is 2 at the moment) during the first
call to ChannelFactory::LoadChannelLibrary().
   Then m_iLibCount stays at 2 and the subsequest calls to
ChannelFactory::LoadChannelLibrary() tries to access invalid memory on
line:
m_pChannel[m_iLibCount] = pChannel; (in other words tries to access
m_pChannel[2] which is out of array given that array size is 2.

   I ran into this while running the memory profiler. 
   I think this is a bug. 

I guess we have to correct it by adding an else clause to:
if( m_iLibCount < ChannelFactory_MaxListSize)
                {
                        m_iLibCount++;
                }
else
{
     m_iLibCount = 0; // hit the celing, next load attempt need to
reload form start
}

    Any comments please.

Thanks,
Samisa...

Re: m_iLibCount in ChannelFactory class

Posted by Samisa Abeysinghe <sa...@gmail.com>.
m_iLibCount is a member of ChannelFactory class. 

This is a new axis3 transport related class.
Please see
src/transport/axis3/ChannelFactory.hpp and
src/transport/axis3/ChannelFactory.cpp.

Thanks,
Samisa...



On Tue, 25 Jan 2005 09:12:03 +0000, John Hawkins <HA...@uk.ibm.com> wrote:
>  
> Sorry, not that familiar with this class. What is m_iLibCount ? 
>  
>  
> John Hawkins
>  
>  
>  
>  
>  
>  Samisa Abeysinghe <sa...@gmail.com> 
> 
> 25/01/2005 08:11 
>  
> Please respond to
>  "Apache AXIS C Developers List" 
>  
>  
> To Apache AXIS C Developers List <ax...@ws.apache.org> 
>  
> cc 
>  
> Subject
>  m_iLibCount in ChannelFactory class 
>  
>  
>  
>  
>  
> Hi,
>     m_iLibCount in ChannelFactory class hit the celing value
>  ChannelFactory_MaxListSize (which is 2 at the moment) during the first
>  call to ChannelFactory::LoadChannelLibrary().
>    Then m_iLibCount stays at 2 and the subsequest calls to
>  ChannelFactory::LoadChannelLibrary() tries to access invalid memory on
>  line:
>  m_pChannel[m_iLibCount] = pChannel; (in other words tries to access
>  m_pChannel[2] which is out of array given that array size is 2.
>  
>    I ran into this while running the memory profiler. 
>    I think this is a bug. 
>  
>  I guess we have to correct it by adding an else clause to:
>  if( m_iLibCount < ChannelFactory_MaxListSize)
>                 {
>                         m_iLibCount++;
>                 }
>  else
>  {
>      m_iLibCount = 0; // hit the celing, next load attempt need to
>  reload form start
>  }
>  
>     Any comments please.
>  
>  Thanks,
>  Samisa...
>  
>

Re: m_iLibCount in ChannelFactory class

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Tetsting with a fresh checkout reveals that the improvements done by
Fred has solved many problems.

Axis3 transport seems to be as fast as axis2, despite loading channel
seperately.

Thanks,
Samisa...


On Wed, 26 Jan 2005 07:55:11 +0600, Samisa Abeysinghe
<sa...@gmail.com> wrote:
> Hi Fred,
>     I too think that it is not sensible to keep on loading the same DLLs.
>     I think this happens due to the problem in Call classes
> openConnection() method (mentioned in the other mail), where it is
> called for each stub method invocation and keeps on loading the DLLs
> each time it is called. If we fix it there, then this would not be a
> problem.
> 
> Thanks,
> Samisa...
> 
> 
> On Tue, 25 Jan 2005 11:24:52 +0000, Fred Preston <PR...@uk.ibm.com> wrote:
> >
> >
> > Hi All,
> >      m_iLibCount is used by ChannelFactory to keep a count of how may HTTP
> > channel libraries have been loaded.  Since there are only two types of
> > channel associated with HTTP transport, it did not seem unreasonable to set
> > the limit to 2.  m_iLibCount should only change when LoadChannelLibrary is
> > called.  This should only be called by HTTPTransport when a new HTTP DLL or
> > HTTP SSL DLL name is passed to the setTransportProperty method in
> > HTTPTransport.  This method should only need to be called once or at most
> > twice to set/load the DLL associated with unsecure and secure channel
> > transports.  If the client/server continually tries to set the name of the
> > libraries that deal with the HTTP channel requests, then m_iLibCount will
> > indeed max at 2 and no more alterations will be possible.  I have changed
> > the code to allow the user to keep on loading the same DLLs as often as
> > they require (although what purpose this serves I not entirely sure).
> >
> > Regards,
> >
> > Fred Preston.
> >
> >                      Samisa Abeysinghe
> >                      <samisa.abeysinghe        To:       Apache AXIS C Developers List <ax...@ws.apache.org>
> >                      @gmail.com>               cc:
> >                                                Subject:  m_iLibCount in ChannelFactory class
> >                      25/01/05 08:11
> >                      Please respond to
> >                      "Apache AXIS C
> >                      Developers List"
> >
> >
> > Hi,
> >    m_iLibCount in ChannelFactory class hit the celing value
> > ChannelFactory_MaxListSize (which is 2 at the moment) during the first
> > call to ChannelFactory::LoadChannelLibrary().
> >   Then m_iLibCount stays at 2 and the subsequest calls to
> > ChannelFactory::LoadChannelLibrary() tries to access invalid memory on
> > line:
> > m_pChannel[m_iLibCount] = pChannel; (in other words tries to access
> > m_pChannel[2] which is out of array given that array size is 2.
> >
> >   I ran into this while running the memory profiler.
> >   I think this is a bug.
> >
> > I guess we have to correct it by adding an else clause to:
> > if( m_iLibCount < ChannelFactory_MaxListSize)
> >                {
> >                        m_iLibCount++;
> >                }
> > else
> > {
> >     m_iLibCount = 0; // hit the celing, next load attempt need to
> > reload form start
> > }
> >
> >    Any comments please.
> >
> > Thanks,
> > Samisa...
> >
> >
>

Re: m_iLibCount in ChannelFactory class

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Hi Fred,
    I too think that it is not sensible to keep on loading the same DLLs.
    I think this happens due to the problem in Call classes
openConnection() method (mentioned in the other mail), where it is
called for each stub method invocation and keeps on loading the DLLs
each time it is called. If we fix it there, then this would not be a
problem.

Thanks,
Samisa...


On Tue, 25 Jan 2005 11:24:52 +0000, Fred Preston <PR...@uk.ibm.com> wrote:
> 
> 
> Hi All,
>      m_iLibCount is used by ChannelFactory to keep a count of how may HTTP
> channel libraries have been loaded.  Since there are only two types of
> channel associated with HTTP transport, it did not seem unreasonable to set
> the limit to 2.  m_iLibCount should only change when LoadChannelLibrary is
> called.  This should only be called by HTTPTransport when a new HTTP DLL or
> HTTP SSL DLL name is passed to the setTransportProperty method in
> HTTPTransport.  This method should only need to be called once or at most
> twice to set/load the DLL associated with unsecure and secure channel
> transports.  If the client/server continually tries to set the name of the
> libraries that deal with the HTTP channel requests, then m_iLibCount will
> indeed max at 2 and no more alterations will be possible.  I have changed
> the code to allow the user to keep on loading the same DLLs as often as
> they require (although what purpose this serves I not entirely sure).
> 
> Regards,
> 
> Fred Preston.
> 
>                      Samisa Abeysinghe
>                      <samisa.abeysinghe        To:       Apache AXIS C Developers List <ax...@ws.apache.org>
>                      @gmail.com>               cc:
>                                                Subject:  m_iLibCount in ChannelFactory class
>                      25/01/05 08:11
>                      Please respond to
>                      "Apache AXIS C
>                      Developers List"
> 
> 
> Hi,
>    m_iLibCount in ChannelFactory class hit the celing value
> ChannelFactory_MaxListSize (which is 2 at the moment) during the first
> call to ChannelFactory::LoadChannelLibrary().
>   Then m_iLibCount stays at 2 and the subsequest calls to
> ChannelFactory::LoadChannelLibrary() tries to access invalid memory on
> line:
> m_pChannel[m_iLibCount] = pChannel; (in other words tries to access
> m_pChannel[2] which is out of array given that array size is 2.
> 
>   I ran into this while running the memory profiler.
>   I think this is a bug.
> 
> I guess we have to correct it by adding an else clause to:
> if( m_iLibCount < ChannelFactory_MaxListSize)
>                {
>                        m_iLibCount++;
>                }
> else
> {
>     m_iLibCount = 0; // hit the celing, next load attempt need to
> reload form start
> }
> 
>    Any comments please.
> 
> Thanks,
> Samisa...
> 
>

Re: m_iLibCount in ChannelFactory class

Posted by Fred Preston <PR...@uk.ibm.com>.



Hi All,
      m_iLibCount is used by ChannelFactory to keep a count of how may HTTP
channel libraries have been loaded.  Since there are only two types of
channel associated with HTTP transport, it did not seem unreasonable to set
the limit to 2.  m_iLibCount should only change when LoadChannelLibrary is
called.  This should only be called by HTTPTransport when a new HTTP DLL or
HTTP SSL DLL name is passed to the setTransportProperty method in
HTTPTransport.  This method should only need to be called once or at most
twice to set/load the DLL associated with unsecure and secure channel
transports.  If the client/server continually tries to set the name of the
libraries that deal with the HTTP channel requests, then m_iLibCount will
indeed max at 2 and no more alterations will be possible.  I have changed
the code to allow the user to keep on loading the same DLLs as often as
they require (although what purpose this serves I not entirely sure).

Regards,

Fred Preston.



                                                                                                                                      
                      Samisa Abeysinghe                                                                                               
                      <samisa.abeysinghe        To:       Apache AXIS C Developers List <ax...@ws.apache.org>                    
                      @gmail.com>               cc:                                                                                   
                                                Subject:  m_iLibCount in ChannelFactory class                                         
                      25/01/05 08:11                                                                                                  
                      Please respond to                                                                                               
                      "Apache AXIS C                                                                                                  
                      Developers List"                                                                                                
                                                                                                                                      



Hi,
    m_iLibCount in ChannelFactory class hit the celing value
ChannelFactory_MaxListSize (which is 2 at the moment) during the first
call to ChannelFactory::LoadChannelLibrary().
   Then m_iLibCount stays at 2 and the subsequest calls to
ChannelFactory::LoadChannelLibrary() tries to access invalid memory on
line:
m_pChannel[m_iLibCount] = pChannel; (in other words tries to access
m_pChannel[2] which is out of array given that array size is 2.

   I ran into this while running the memory profiler.
   I think this is a bug.

I guess we have to correct it by adding an else clause to:
if( m_iLibCount < ChannelFactory_MaxListSize)
                {
                        m_iLibCount++;
                }
else
{
     m_iLibCount = 0; // hit the celing, next load attempt need to
reload form start
}

    Any comments please.

Thanks,
Samisa...



Re: m_iLibCount in ChannelFactory class

Posted by John Hawkins <HA...@uk.ibm.com>.
Sorry, not that familiar with this class. What is m_iLibCount ?


John Hawkins





Samisa Abeysinghe <sa...@gmail.com> 
25/01/2005 08:11
Please respond to
"Apache AXIS C Developers List"


To
Apache AXIS C Developers List <ax...@ws.apache.org>
cc

Subject
m_iLibCount in ChannelFactory class






Hi,
    m_iLibCount in ChannelFactory class hit the celing value
ChannelFactory_MaxListSize (which is 2 at the moment) during the first
call to ChannelFactory::LoadChannelLibrary().
   Then m_iLibCount stays at 2 and the subsequest calls to
ChannelFactory::LoadChannelLibrary() tries to access invalid memory on
line:
m_pChannel[m_iLibCount] = pChannel; (in other words tries to access
m_pChannel[2] which is out of array given that array size is 2.

   I ran into this while running the memory profiler. 
   I think this is a bug. 

I guess we have to correct it by adding an else clause to:
if( m_iLibCount < ChannelFactory_MaxListSize)
                {
                        m_iLibCount++;
                }
else
{
     m_iLibCount = 0; // hit the celing, next load attempt need to
reload form start
}

    Any comments please.

Thanks,
Samisa...