knowledge-database (beta)

Current group: comp.soft-sys.ace

[ace-users] log file sampling bug

[ace-users] log file sampling bug  
Kim ByeongSu
 Re: [ace-users] log file sampling bug  
Kobi Cohen-Arazi
 Re: [ace-users] log file sampling bug  
Kobi Cohen-Arazi
From:Kim ByeongSu
Subject:[ace-users] log file sampling bug
Date:21 Jan 2005 21:09:39 -0600
ACE VERSION: 5.4.2

HOST MACHINE and OPERATING SYSTEM:
Windows XP SP2, Winsock 2

TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
Visual C++ 7.1

AREA/CLASS/EXAMPLE AFFECTED:
ACE_wrappers\ace\Logging_Strategy.cpp

DOES THE PROBLEM AFFECT:
EXECUTION? YES

SYNOPSIS:
Log-file sampling is not correct.

DESCRIPTION:
Caculation of current log file size is not correct.

SAMPLE FIX/WORKAROUND:
My patch is following:

--- Logging_Strategy.cpp.orig 2004-06-14 08:58:42.000000000 +0900
+++ Logging_Strategy.cpp 2005-01-13 10:51:14.359375000 +0900
@@ -364,11 +364,10 @@
const void *)
{
#if defined (ACE_LACKS_IOSTREAM_TOTALLY)
- if ((size_t) ACE_OS::fseek (this->log_msg_->msg_ostream (),
- 0,
- SEEK_CUR) > this->max_size_)
+ if ((size_t) ACE_OS::ftell (this->log_msg_->msg_ostream ()) >
+ this->max_size_)
#else
- if ((size_t) this->log_msg_->msg_ostream () > this->max_size_)
+ if ((size_t) this->log_msg_->msg_ostream ()->tellp() > this->max_size_)
#endif /* ACE_LACKS_IOSTREAM_TOTALLY */
{
// Lock out any other logging.
From:Kobi Cohen-Arazi
Subject:Re: [ace-users] log file sampling bug
Date:22 Jan 2005 10:26:22 -0600
Hi Johnny,

You are right. I've already did the tellp part. But the ACE_OS::ftell
is missing. I can check it in.

Kobi.


On Sat, 22 Jan 2005 09:59:50 +0100, Johnny Willemsen
wrote:
> Hi,
>
> Thanks for using the PRF form.
>
> A question back, did you test the code for ACE_LACKS_IOSTREAM_TOTALLY? The
> other part is already in the x.4.3 version which you can obtain from
> http://deuce.doc.wustl.edu/Download.html
>
> Regards,
> Johnny Willemsen
> Remedy IT
> Leeghwaterstraat 25
> 2811 DT Reeuwijk
> The Netherlands
> www.theaceorb.nl / www.remedy.nl
>
>
> > ACE VERSION: 5.4.2
> >
> > HOST MACHINE and OPERATING SYSTEM:
> > Windows XP SP2, Winsock 2
> >
> > TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> > Visual C++ 7.1
> >
> > AREA/CLASS/EXAMPLE AFFECTED:
> > ACE_wrappers\ace\Logging_Strategy.cpp
> >
> > DOES THE PROBLEM AFFECT:
> > EXECUTION? YES
> >
> > SYNOPSIS:
> > Log-file sampling is not correct.
> >
> > DESCRIPTION:
> > Caculation of current log file size is not correct.
> >
> > SAMPLE FIX/WORKAROUND:
> > My patch is following:
> >
> > --- Logging_Strategy.cpp.orig 2004-06-14 08:58:42.000000000 +0900
> > +++ Logging_Strategy.cpp 2005-01-13 10:51:14.359375000 +0900
> > @@ -364,11 +364,10 @@
> > const void *)
> > {
> > #if defined (ACE_LACKS_IOSTREAM_TOTALLY)
> > - if ((size_t) ACE_OS::fseek (this->log_msg_->msg_ostream (),
> > - 0,
> > - SEEK_CUR) > this->max_size_)
> > + if ((size_t) ACE_OS::ftell (this->log_msg_->msg_ostream ()) >
> > + this->max_size_)
> > #else
> > - if ((size_t) this->log_msg_->msg_ostream () > this->max_size_)
> > + if ((size_t) this->log_msg_->msg_ostream ()->tellp() >
> > this->max_size_)
> > #endif /* ACE_LACKS_IOSTREAM_TOTALLY */
> > {
> > // Lock out any other logging.
> >
>
>
From:Kobi Cohen-Arazi
Subject:Re: [ace-users] log file sampling bug
Date:22 Jan 2005 16:00:25 -0600
Hi Kim,

I've already fixed tellp in 5.4.3 (When Platform has IOSTREAM). I've
added the fix of ACE_OS::ftell for the other case. (#define
ACE_LACKS_IOSTREAM_TOTALLY)

Here is the relevant ChangeLog entry.
Sat Jan 22 21:18:58 2005 Kobi Cohen-Arazi

* ace/Logging_Strategy.cpp (handle_timeout): Fixed when defined
ACE_LACKS_IOSTREAM_TOTALLY.
Use ftell instead of fseek in order to get the current file length.
Thanks to Kim ByeongSu for pointing it out.

Thanks,
Kobi.

On Sat, 22 Jan 2005 09:22:06 +0900, Kim ByeongSu wrote:
> ACE VERSION: 5.4.2
>
> HOST MACHINE and OPERATING SYSTEM:
> Windows XP SP2, Winsock 2
>
> TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> Visual C++ 7.1
>
> AREA/CLASS/EXAMPLE AFFECTED:
> ACE_wrappers\ace\Logging_Strategy.cpp
>
> DOES THE PROBLEM AFFECT:
> EXECUTION? YES
>
> SYNOPSIS:
> Log-file sampling is not correct.
>
> DESCRIPTION:
> Caculation of current log file size is not correct.
>
> SAMPLE FIX/WORKAROUND:
> My patch is following:
>
> --- Logging_Strategy.cpp.orig 2004-06-14 08:58:42.000000000 +0900
> +++ Logging_Strategy.cpp 2005-01-13 10:51:14.359375000 +0900
> @@ -364,11 +364,10 @@
> const void *)
> {
> #if defined (ACE_LACKS_IOSTREAM_TOTALLY)
> - if ((size_t) ACE_OS::fseek (this->log_msg_->msg_ostream (),
> - 0,
> - SEEK_CUR) > this->max_size_)
> + if ((size_t) ACE_OS::ftell (this->log_msg_->msg_ostream ()) >
> + this->max_size_)
> #else
> - if ((size_t) this->log_msg_->msg_ostream () > this->max_size_)
> + if ((size_t) this->log_msg_->msg_ostream ()->tellp() > this->max_size_)
> #endif /* ACE_LACKS_IOSTREAM_TOTALLY */
> {
> // Lock out any other logging.
>
>
   

Copyright © 2006 knowledge-database   -   All rights reserved