From MAILER-DAEMON Tue Apr 01 06:51:11 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 190K8F-0002ka-00
	for mharc-bug-commoncpp@gnu.org; Tue, 01 Apr 2003 06:40:47 -0500
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 190K82-0002UK-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 06:40:34 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 190K6j-0002B9-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 06:39:16 -0500
Received: from oe22.law10.hotmail.com ([64.4.14.79] helo=hotmail.com)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 190K4K-00083T-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 06:36:44 -0500
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Tue, 1 Apr 2003 03:36:40 -0800
Received: from 80.62.87.69 by oe22.law10.hotmail.com with DAV;
	Tue, 01 Apr 2003 11:36:40 +0000
X-Originating-IP: [80.62.87.69]
X-Originating-Email: [niels_tr@hotmail.com]
From: "NTR" <niels_tr@hotmail.com>
To: <bug-commoncpp@gnu.org>
Date: Tue, 1 Apr 2003 13:35:54 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4920.2300
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300
Message-ID: <OE22Y1heBm1FSt7rALC0002e105@hotmail.com>
X-OriginalArrivalTime: 01 Apr 2003 11:36:40.0441 (UTC)
	FILETIME=[F659DE90:01C2F842]
Subject: Thread termination & Mutex bug?
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 01 Apr 2003 11:40:44 -0000

Hi,

I have been working with CommonC++ 1.9.1 on Win2000 using the Thread, Mutex,
Semaphore classes in a multi-threaded and I'm having problems with
terminating threads from "main(...)" as this cannot call "Terminate()" as it
is protected. What is the reason for this? Couldn't it be public instead?
Could I just derive my own thread class and make a public "MyTerminate"
method which calls "this->Terminate()"?

Anyway, I assume there is a good reason for this so ... how can I terminate
a thread from the main method? I have noticed the Thread(bool), which is
supposed to construct a context for the main thread. However, I have no idea
how to use this ... if anybody has an example it would be highly
appreciated.

In addition, I'm experiencing problems with Mutex and Semaphore not being
thread safe in a producer/consumer scenario. Is this a known bug in 1.9.1?

My scenario is something like:
main()
{
   ProducerConsumerBuffer buf;
   ProducerThread prod(buf);//Puts data in buf ... overwrites data in buf
   ConsumerThread cons(buf);//Waits on semaphore for data in buf
   prod.Start();
   cons.Start();

   ccxx_sleep(100000);//In my case I process user input until ESC has been
pressed

   //Due to various reasons I cannot simply let threads
   //delete themselves when the main thread stops but have
   //to stop the threads first
   prod.Terminate();//WRONG
   cons.Terminate();//WRONG
}

Regards,
Niels

PS: Is the new commoncpp2 1.0.x endiansafe for TCP transmission from a Win32
to an Irix 6.5 SGI computer? The reason I'm using 1.9.1 is that some other
people have modified this version to be endiansafe for TCP transmission. I
think they submitted a bug report...
PPS: I have previously downloaded commoncpp2 1.0.8, but haven't had any luck
compiling it (without XML) on Win2000 is this still a problem?



From MAILER-DAEMON Tue Apr 01 08:45:18 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 190M4k-0008US-00
	for mharc-bug-commoncpp@gnu.org; Tue, 01 Apr 2003 08:45:18 -0500
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 190LDe-00067a-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 07:50:26 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 190L8E-0003uO-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 07:44:51 -0500
Received: from tmailb1.svr.pol.co.uk ([195.92.168.141])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 190Knq-0008Ct-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 07:23:46 -0500
Received: from modem-2516.lemur.dialup.pol.co.uk ([217.135.137.212]
	helo=ecs.soton.ac.uk)	by tmailb1.svr.pol.co.uk with esmtp (Exim 4.14)
	id 190Knl-0004OK-1A; Tue, 01 Apr 2003 13:23:41 +0100
Message-ID: <3E8984D3.1040507@ecs.soton.ac.uk>
Date: Tue, 01 Apr 2003 13:23:47 +0100
From: Jon Wilson <jdw100@ecs.soton.ac.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: NTR <niels_tr@hotmail.com>
References: <OE22Y1heBm1FSt7rALC0002e105@hotmail.com>
In-Reply-To: <OE22Y1heBm1FSt7rALC0002e105@hotmail.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Mailman-Approved-At: Tue, 01 Apr 2003 08:45:15 -0500
cc: bug-commoncpp@gnu.org
Subject: Re: Thread termination & Mutex bug?
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 01 Apr 2003 13:14:23 -0000

I have a working build on win2000/XP without the use of LibXML. I 
removed(commented) the
#define HAVE_LIBXML
in win32/c++/config.h
And then simply compiled the source without the makefile. (excluding 
xml.cpp) and linked with
-lwsock32 -lws2_32.
I was using gcc3.2 under MingW and hence also had to remove 
HAVE_OLD_IOSTREAM
from the config as above.
You don't mention which compiler you are using?
Also there is a know issue with Thread::join() since it is in a #ifndef 
__WIN32__ and needs to be moved up the header outside of the block.
(That fix was sent to me by someone else on the group thanks again).
Hope this is of some help.
Jon Wilson

NTR wrote:

>Hi,
>
>I have been working with CommonC++ 1.9.1 on Win2000 using the Thread, Mutex,
>Semaphore classes in a multi-threaded and I'm having problems with
>terminating threads from "main(...)" as this cannot call "Terminate()" as it
>is protected. What is the reason for this? Couldn't it be public instead?
>Could I just derive my own thread class and make a public "MyTerminate"
>method which calls "this->Terminate()"?
>
>Anyway, I assume there is a good reason for this so ... how can I terminate
>a thread from the main method? I have noticed the Thread(bool), which is
>supposed to construct a context for the main thread. However, I have no idea
>how to use this ... if anybody has an example it would be highly
>appreciated.
>
>In addition, I'm experiencing problems with Mutex and Semaphore not being
>thread safe in a producer/consumer scenario. Is this a known bug in 1.9.1?
>
>My scenario is something like:
>main()
>{
>   ProducerConsumerBuffer buf;
>   ProducerThread prod(buf);//Puts data in buf ... overwrites data in buf
>   ConsumerThread cons(buf);//Waits on semaphore for data in buf
>   prod.Start();
>   cons.Start();
>
>   ccxx_sleep(100000);//In my case I process user input until ESC has been
>pressed
>
>   //Due to various reasons I cannot simply let threads
>   //delete themselves when the main thread stops but have
>   //to stop the threads first
>   prod.Terminate();//WRONG
>   cons.Terminate();//WRONG
>}
>
>Regards,
>Niels
>
>PS: Is the new commoncpp2 1.0.x endiansafe for TCP transmission from a Win32
>to an Irix 6.5 SGI computer? The reason I'm using 1.9.1 is that some other
>people have modified this version to be endiansafe for TCP transmission. I
>think they submitted a bug report...
>PPS: I have previously downloaded commoncpp2 1.0.8, but haven't had any luck
>compiling it (without XML) on Win2000 is this still a problem?
>
>
>_______________________________________________
>Bug-commoncpp mailing list
>Bug-commoncpp@gnu.org
>http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>
>  
>





From MAILER-DAEMON Tue Apr 01 21:48:54 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 190YHx-0002TD-00
	for mharc-bug-commoncpp@gnu.org; Tue, 01 Apr 2003 21:47:45 -0500
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 190YHh-0001Qv-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 21:47:29 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 190YHa-0000yq-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 21:47:25 -0500
Received: from pool-141-153-149-56.mad.east.verizon.net ([141.153.149.56]
	helo=home.bayonne.dyndns.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 190YHV-0000Gb-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 21:47:17 -0500
Received: from 192.168.1.104 ([192.168.1.104])
	by home.bayonne.dyndns.org (8.11.6/8.11.6) with ESMTP id h323Wif19682;
	Tue, 1 Apr 2003 22:32:44 -0500
From: David Sugar <dyfet@ostel.com>
To: "NTR" <niels_tr@hotmail.com>, <bug-commoncpp@gnu.org>
Date: Tue, 1 Apr 2003 21:33:24 -0500
User-Agent: KMail/1.5
References: <OE22Y1heBm1FSt7rALC0002e105@hotmail.com>
In-Reply-To: <OE22Y1heBm1FSt7rALC0002e105@hotmail.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304012133.24333.dyfet@ostel.com>
Subject: Re: Thread termination & Mutex bug?
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Wed, 02 Apr 2003 02:47:43 -0000

In the case of terminate, it was originally meant to be internal, but then we 
did add it to the destructor inline for convenience to remove duplicate code.  
So yes, it probably should become public.

On Tuesday 01 April 2003 06:35 am, NTR wrote:
> Hi,
>
> I have been working with CommonC++ 1.9.1 on Win2000 using the Thread,
> Mutex, Semaphore classes in a multi-threaded and I'm having problems with
> terminating threads from "main(...)" as this cannot call "Terminate()" as
> it is protected. What is the reason for this? Couldn't it be public
> instead? Could I just derive my own thread class and make a public
> "MyTerminate" method which calls "this->Terminate()"?
>
> Anyway, I assume there is a good reason for this so ... how can I terminate
> a thread from the main method? I have noticed the Thread(bool), which is
> supposed to construct a context for the main thread. However, I have no
> idea how to use this ... if anybody has an example it would be highly
> appreciated.
>
> In addition, I'm experiencing problems with Mutex and Semaphore not being
> thread safe in a producer/consumer scenario. Is this a known bug in 1.9.1?
>
> My scenario is something like:
> main()
> {
>    ProducerConsumerBuffer buf;
>    ProducerThread prod(buf);//Puts data in buf ... overwrites data in buf
>    ConsumerThread cons(buf);//Waits on semaphore for data in buf
>    prod.Start();
>    cons.Start();
>
>    ccxx_sleep(100000);//In my case I process user input until ESC has been
> pressed
>
>    //Due to various reasons I cannot simply let threads
>    //delete themselves when the main thread stops but have
>    //to stop the threads first
>    prod.Terminate();//WRONG
>    cons.Terminate();//WRONG
> }
>
> Regards,
> Niels
>
> PS: Is the new commoncpp2 1.0.x endiansafe for TCP transmission from a
> Win32 to an Irix 6.5 SGI computer? The reason I'm using 1.9.1 is that some
> other people have modified this version to be endiansafe for TCP
> transmission. I think they submitted a bug report...
> PPS: I have previously downloaded commoncpp2 1.0.8, but haven't had any
> luck compiling it (without XML) on Win2000 is this still a problem?
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




From MAILER-DAEMON Tue Apr 01 22:15:56 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 190Yiw-0003Fa-00
	for mharc-bug-commoncpp@gnu.org; Tue, 01 Apr 2003 22:15:38 -0500
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 190Yie-0002FV-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 22:15:20 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 190Yhx-00012C-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 22:14:37 -0500
Received: from pool-141-153-149-56.mad.east.verizon.net ([141.153.149.56]
	helo=home.bayonne.dyndns.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 190Yhe-0000Tp-00
	for bug-commoncpp@gnu.org; Tue, 01 Apr 2003 22:14:18 -0500
Received: from 192.168.1.104 ([192.168.1.104])
	by home.bayonne.dyndns.org (8.11.6/8.11.6) with ESMTP id h323xmf19881;
	Tue, 1 Apr 2003 22:59:48 -0500
From: David Sugar <dyfet@ostel.com>
To: "Ian Gough" <igough@gridironsoftware.com>,
   "'Nacho de los =?iso-8859-1?q?R=EDos?= Tormo'" <irios@proin.es>,
   <bug-commoncpp@gnu.org>
Date: Tue, 1 Apr 2003 22:00:28 -0500
User-Agent: KMail/1.5
References: <003101c2f7b2$27aacea0$1202a8c0@gridironnetworks.com>
In-Reply-To: <003101c2f7b2$27aacea0$1202a8c0@gridironnetworks.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Message-Id: <200304012200.28391.dyfet@ostel.com>
Subject: Re: Thread::detach() call doesn't return
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Wed, 02 Apr 2003 03:15:36 -0000

"detach" is meant to be used in place of "start" to start a constructed thr=
ead=20
which has no sync/start/signaling sempahore passed as part of it's=20
constructor.  If a thread is started, it is normally in the joinable state.=
 =20
Using detach as an alternate to start creates a thread context that is=20
detached and cannot be joined.  You cannot delete a detached object safely,=
=20
since it may still have an active execution context.  Detached thread objec=
ts=20
must self delete, typically by using "delete this" in their Final() method.=
 =20
In any case, neither detach nor start may be called from a constructor.

On Monday 31 March 2003 01:20 pm, Ian Gough wrote:
> If you are linking in the older code as a dynamic lib, make sure that it
> was compiled with the multithreaded libs.
>
> I don't know if this will help, but I would try fully constructing the
> thread object before attempting to start/detach it. Is there a
> difference between how your program works using start() instead of
> detach()? Try:
>
>  class MyClass1 : public Thread
>  {
>      void run(void)
>      {
>          int i =3D 0;
>          while(true)
>              if (++i =3D=3D 0) cout << "Rollover!" << endl;
>      };
>
>      public:
>      MyClass1 (void)
>      {
>      }
>  };
>
>  void main(void)
>  {
>      MyClass1* p1;
>
>      p1 =3D new MyClass1();
>      p1.start();
>      cout << "MESSAGE" << endl;
>      Thread::sleep( 10000 );
>  }
>
> > -----Original Message-----
> > From:
> > bug-commoncpp-bounces+igough=3Dgridironsoftware.com@gnu.org
> > [mailto:bug-commoncpp-bounces+igough=3Dgridironsoftware.com@gnu.
> > org] On Behalf Of Nacho de los R=EDos Tormo
> > Sent: Monday, March 31, 2003 11:00 AM
> > To: bug-commoncpp@gnu.org
> > Subject: Re: Thread::detach() call doesn't return
> >
> >
> > Hello,
> >
> > After a week with no replies, I must face the fact that
> > either nobody knows an
> > answer or, more likely, nobody made could make heads nor
> > tails of a poor (and
> > too long) explanation.
> >
> > My problem is: sometimes, in my Thread subclasses, the moment
> > I call detach()
> > (whether from the constructor or at a later point), the
> > current thread is
> > permanently lost.
> >
> > This only happens when I link in some older code we've got,
> > even if this older
> > code is not called and is left dead.
> >
> > This older code is some older single-thread code that runs fine if:
> >
> > a)compiled as a single thread program
> > b)its original main() function is called from the run()
> >   method of a Thread subclass (though in this case control
> >   won't return to the calling thread).
> >
> > In the example below, when linking the other code, message
> > "MESSAGE" would
> > never get printed; however, not linking that other code,
> > "MESSAGE" would be
> > printed. In both cases, I would get periodic "Rollover!" messages.
> >
> > What so toxic might be lurking in the old code that could
> > make this happen?
> >
> > Thanks for your attention,
> >
> > Nacho de los Rios.
> >
> > ----------------------------------------------------
> >
> > class MyClass1 : public Thread
> > {
> >     void run(void)
> >     {
> >         int i =3D 0;
> >         while(true)
> >             if (++i =3D=3D 0) cout << "Rollover!" << endl;
> >     };
> >
> >     public:
> >     MyClass1 (void)
> >     {
> > 	detach();
> >     }
> > };
> >
> > void main(void)
> > {
> >     MyClass1* p1;
> >
> >     p1 =3D new MyClass1();
> >     cout << "MESSAGE" << endl;
> > }
> >
> >
> > _______________________________________________
> > Bug-commoncpp mailing list
> > Bug-commoncpp@gnu.org
> > http://mail.gnu.org/mailman/listinfo/bug-> commoncpp
>
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




From MAILER-DAEMON Wed Apr 02 09:53:41 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 190jat-0004PC-00
	for mharc-bug-commoncpp@gnu.org; Wed, 02 Apr 2003 09:52:03 -0500
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 190jF7-0002YL-00
	for bug-commoncpp@gnu.org; Wed, 02 Apr 2003 09:29:33 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 190j8T-0007gA-00
	for bug-commoncpp@gnu.org; Wed, 02 Apr 2003 09:22:42 -0500
Received: from oe53.law10.hotmail.com ([64.4.14.46] helo=hotmail.com)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 190j3F-0004V9-00
	for bug-commoncpp@gnu.org; Wed, 02 Apr 2003 09:17:17 -0500
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Wed, 2 Apr 2003 02:10:58 -0800
Received: from 80.62.87.69 by oe53.law10.hotmail.com with DAV;
	Wed, 02 Apr 2003 10:10:58 +0000
X-Originating-IP: [80.62.87.69]
X-Originating-Email: [niels_tr@hotmail.com]
From: "NTR" <niels_tr@hotmail.com>
To: "Jon Wilson" <jdw100@ecs.soton.ac.uk>
References: <OE22Y1heBm1FSt7rALC0002e105@hotmail.com>
	<3E8984D3.1040507@ecs.soton.ac.uk>
Date: Wed, 2 Apr 2003 10:25:40 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <OE539Cq6F8PRYgYmxR90000fa6e@hotmail.com>
X-OriginalArrivalTime: 02 Apr 2003 10:10:58.0496 (UTC)
	FILETIME=[27ED1400:01C2F900]
cc: bug-commoncpp@gnu.org
Subject: Re: Thread termination & Mutex bug?
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Wed, 02 Apr 2003 14:52:01 -0000

Hi,

thanks for the reply. I'm using Visual C++ 6 SP5 and did all of the things
you mentioned. The problem lies in compiling the ccext2 libraries
(commoncpp2 1.0.8), which produces the following compile warning:
---
..\include\cc++/digest.h(386) : warning C4275: non dll-interface class
'ost::SHADigest<unsigned __int64,64>' used as base for dll-interface class
'ost::SHA64DigestHelper'
        ..\include\cc++/digest.h(386) : see declaration of
'SHA64DigestHelper'
..\include\cc++/digest.h(388) : warning C4251: 'h' : class
'ost::SHATumbler<unsigned __int32>' needs to have dll-interface to be used
by clients of class 'ost::SHA64DigestHelper'
..\include\cc++/digest.h(389) : warning C4251: 'a' : class
'ost::SHATumbler<unsigned __int32>' needs to have dll-interface to be used
by clients of class 'ost::SHA64DigestHelper'
---
Apparently these warnings cause linking for the Release build (Debug library
works fine) to fail:
---
Creating library Release/ccext2.lib and object Release/ccext2.exp
digest.obj : error LNK2001: unresolved external symbol "public: unsigned int
__thiscall ost::SHATumbler<unsigned __int32>::placeInBuffer(unsigned char
*)" (?placeInBuffer@?$SHATumbler@_I@ost@@QAEIPAE@Z)
md5.obj : error LNK2001: unresolved external symbol "public: unsigned int
__thiscall ost::SHATumbler<unsigned __int32>::placeInBuffer(unsigned char
*)" (?placeInBuffer@?$SHATumbler@_I@ost@@QAEIPAE@Z)
Release/ccext2.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
---

Regards,
Niels

PS: The Mutex bug was a mistake on my behalf. Sorry. It works fine in
CommonC++ 1.9.1.

> I have a working build on win2000/XP without the use of LibXML. I
> removed(commented) the
> #define HAVE_LIBXML
> in win32/c++/config.h
> And then simply compiled the source without the makefile. (excluding
> xml.cpp) and linked with
> -lwsock32 -lws2_32.
> I was using gcc3.2 under MingW and hence also had to remove
> HAVE_OLD_IOSTREAM
> from the config as above.
> You don't mention which compiler you are using?
> Also there is a know issue with Thread::join() since it is in a #ifndef
> __WIN32__ and needs to be moved up the header outside of the block.
> (That fix was sent to me by someone else on the group thanks again).
> Hope this is of some help.
> Jon Wilson
>
> NTR wrote:
>
> >Hi,
> >
> >I have been working with CommonC++ 1.9.1 on Win2000 using the Thread,
Mutex,
> >Semaphore classes in a multi-threaded and I'm having problems with
> >terminating threads from "main(...)" as this cannot call "Terminate()" as
it
> >is protected. What is the reason for this? Couldn't it be public instead?
> >Could I just derive my own thread class and make a public "MyTerminate"
> >method which calls "this->Terminate()"?
> >
> >Anyway, I assume there is a good reason for this so ... how can I
terminate
> >a thread from the main method? I have noticed the Thread(bool), which is
> >supposed to construct a context for the main thread. However, I have no
idea
> >how to use this ... if anybody has an example it would be highly
> >appreciated.
> >
> >In addition, I'm experiencing problems with Mutex and Semaphore not being
> >thread safe in a producer/consumer scenario. Is this a known bug in
1.9.1?
> >
> >My scenario is something like:
> >main()
> >{
> >   ProducerConsumerBuffer buf;
> >   ProducerThread prod(buf);//Puts data in buf ... overwrites data in buf
> >   ConsumerThread cons(buf);//Waits on semaphore for data in buf
> >   prod.Start();
> >   cons.Start();
> >
> >   ccxx_sleep(100000);//In my case I process user input until ESC has
been
> >pressed
> >
> >   //Due to various reasons I cannot simply let threads
> >   //delete themselves when the main thread stops but have
> >   //to stop the threads first
> >   prod.Terminate();//WRONG
> >   cons.Terminate();//WRONG
> >}
> >
> >Regards,
> >Niels
> >
> >PS: Is the new commoncpp2 1.0.x endiansafe for TCP transmission from a
Win32
> >to an Irix 6.5 SGI computer? The reason I'm using 1.9.1 is that some
other
> >people have modified this version to be endiansafe for TCP transmission.
I
> >think they submitted a bug report...
> >PPS: I have previously downloaded commoncpp2 1.0.8, but haven't had any
luck
> >compiling it (without XML) on Win2000 is this still a problem?
> >
> >
> >_______________________________________________
> >Bug-commoncpp mailing list
> >Bug-commoncpp@gnu.org
> >http://mail.gnu.org/mailman/listinfo/bug-commoncpp
> >
> >
> >
>
>
>



From MAILER-DAEMON Thu Apr 03 05:34:53 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 19123Y-0005aa-00
	for mharc-bug-commoncpp@gnu.org; Thu, 03 Apr 2003 05:34:52 -0500
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 19123V-0005Rd-00
	for bug-commoncpp@gnu.org; Thu, 03 Apr 2003 05:34:49 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 19123T-0005Pu-00
	for bug-commoncpp@gnu.org; Thu, 03 Apr 2003 05:34:49 -0500
Received: from f66.law9.hotmail.com ([64.4.9.66] helo=hotmail.com)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 19123T-0005PY-00
	for bug-commoncpp@gnu.org; Thu, 03 Apr 2003 05:34:47 -0500
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Thu, 3 Apr 2003 02:34:46 -0800
Received: from 212.141.192.253 by lw9fd.law9.hotmail.msn.com with HTTP;
	Thu, 03 Apr 2003 10:34:45 GMT
X-Originating-IP: [212.141.192.253]
X-Originating-Email: [d_berardi@hotmail.com]
From: "Danilo Berardi" <d_berardi@hotmail.com>
To: bug-commoncpp@gnu.org
Bcc: 
Date: Thu, 03 Apr 2003 10:34:45 +0000
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Message-ID: <F66hJumD6I9EsJaa1KV000251ed@hotmail.com>
X-OriginalArrivalTime: 03 Apr 2003 10:34:46.0126 (UTC)
	FILETIME=[A545E0E0:01C2F9CC]
Subject: Compiling error with Tru64, cxx, alpha platform
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Thu, 03 Apr 2003 10:34:51 -0000

Hi,
I can't compile CommonC++ 2.08 with Digital UNIX V.4.0D (alpha platform).

Running make i take some error.

Anybody can help me?

Thanks in advance.
Danilo


-----------------------------
$ make
Making all in include
make[1]: Entering directory 
`/home/berardi/commonC++/commoncpp2-1.0.8/include'
make  all-recursive
make[2]: Entering directory 
`/home/berardi/commonC++/commoncpp2-1.0.8/include'
Making all in cc++
make[3]: Entering directory 
`/home/berardi/commonC++/commoncpp2-1.0.8/include/cc++'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory 
`/home/berardi/commonC++/commoncpp2-1.0.8/include/cc++'
make[3]: Entering directory 
`/home/berardi/commonC++/commoncpp2-1.0.8/include'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory 
`/home/berardi/commonC++/commoncpp2-1.0.8/include'
make[2]: Leaving directory 
`/home/berardi/commonC++/commoncpp2-1.0.8/include'
make[1]: Leaving directory 
`/home/berardi/commonC++/commoncpp2-1.0.8/include'
Making all in src
make[1]: Entering directory `/home/berardi/commonC++/commoncpp2-1.0.8/src'
/bin/ksh ../libtool --mode=compile cxx -DHAVE_CONFIG_H -I. -I. -I../include  
    -I../src -DCCXX_EXPORT_LIBRARY  -g -D_GNU_SOURCE -D_REENTRANT 
-I../include -c thread.cpp
mkdir .libs
cxx -DHAVE_CONFIG_H -I. -I. -I../include -I../src -DCCXX_EXPORT_LIBRARY -g 
-D_GNU_SOURCE -D_REENTRANT -I../include -c thread.cpp  -DPIC -o 
.libs/thread.lo
cxx: Error: /usr/include/pthread.h, line 998: type
          "__pthreadConstructor_t" may not be initialized
typedef void                    *(*__pthreadConstructor_t)(
-----------------------------------^
cxx: Error: /usr/include/pthread.h, line 999: identifier "pthread_key_t" is
          undefined
        pthread_key_t, pthread_t);
--------^
cxx: Error: /usr/include/pthread.h, line 999: expected a ")"
        pthread_key_t, pthread_t);
---------------------^
cxx: Error: /usr/include/pthread.h, line 1047: identifier "pthread_t" is
          undefined
extern pthread_t  _PTHREAD_CALL_  pthread_self (void);
-------^
cxx: Error: /usr/include/pthread.h, line 1220: identifier "pthread_t" is
          undefined
        pthread_t       thread,
--------^
cxx: Error: /usr/include/pthread.h, line 1225: identifier
          "pthread_mutexattr_t" is undefined
        pthread_mutexattr_t     *attr);
--------^
cxx: Error: /usr/include/pthread.h, line 1225: identifier "attr" is 
undefined
        pthread_mutexattr_t     *attr);
---------------------------------^
cxx: Error: /usr/include/pthread.h, line 1238: identifier "pthread_mutex_t"
          is undefined
        pthread_mutex_t                 *mutex,
--------^
cxx: Error: /usr/include/pthread.h, line 1238: identifier "mutex" is 
undefined
        pthread_mutex_t                 *mutex,
-----------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1238: expected a ")"
        pthread_mutex_t                 *mutex,
----------------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1378: identifier 
"pthread_condattr_t"
          is undefined
        pthread_condattr_t      *attr);
--------^
cxx: Error: /usr/include/pthread.h, line 1391: identifier "pthread_cond_t" 
is
          undefined
        pthread_cond_t                  *cond,
--------^
cxx: Error: /usr/include/pthread.h, line 1391: identifier "cond" is 
undefined
        pthread_cond_t                  *cond,
-----------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1391: expected a ")"
        pthread_cond_t                  *cond,
---------------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1444: expected a ")"
        pthread_cond_t          *cond,
-------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1458: expected a ")"
        pthread_cond_t          *cond,
-------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1466: identifier "pthread_attr_t" 
is
          undefined
        pthread_attr_t          *attr,
--------^
cxx: Error: /usr/include/pthread.h, line 1466: expected a ")"
        pthread_attr_t          *attr,
-------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1470: expected a type specifier
        const pthread_attr_t    *attr,
--------------^
cxx: Error: /usr/include/pthread.h, line 1474: expected a ")"
        pthread_attr_t          *attr,
-------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1478: expected a type specifier
        const pthread_attr_t    *attr,
--------------^
cxx: Error: /usr/include/pthread.h, line 1489: expected a ")"
        pthread_attr_t          *attr,
-------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1503: expected a type specifier
        const pthread_attr_t    *attr,
--------------^
cxx: Error: /usr/include/pthread.h, line 1510: expected a ")"
        pthread_attr_t          *attr,
-------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1514: expected a type specifier
        const pthread_attr_t    *attr,
--------------^
cxx: Error: /usr/include/pthread.h, line 1518: expected a ")"
        pthread_attr_t                  *attr,
---------------------------------------------^
cxx: Error: /usr/include/pthread.h, line 1522: expected a type specifier
        const pthread_attr_t    *attr,
--------------^
cxx: Error: /usr/include/pthread.h, line 1526: identifier "pthread_t" is
          undefined
        pthread_t               thread,
--------^
cxx: Error: /usr/include/pthread.h, line 1531: identifier "pthread_t" is
          undefined
        pthread_t                       thread,
--------^
cxx: Error: /usr/include/pthread.h, line 1554: expected a ")"
        pthread_attr_t          *attr,
-------------------------------------^
cxx: Info: Error limit reached.
cxx: Info: 30 errors detected in the compilation of "thread.cpp".
cxx: Info: Compilation terminated.
make[1]: *** [thread.lo] Error 1
make[1]: Leaving directory `/home/berardi/commonC++/commoncpp2-1.0.8/src'
make: *** [all-recursive] Error 1
$



_________________________________________________________________
Invia messaggi istantanei gratuitamente! http://www.msn.it/messenger/




From MAILER-DAEMON Sun Apr 06 10:33:32 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 192BCM-0000m1-00
	for mharc-bug-commoncpp@gnu.org; Sun, 06 Apr 2003 10:32:42 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 192BCC-0000Wd-00
	for bug-commoncpp@gnu.org; Sun, 06 Apr 2003 10:32:32 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 192BBu-0007pf-00
	for bug-commoncpp@gnu.org; Sun, 06 Apr 2003 10:32:21 -0400
Received: from bulbasaur.rediris.es ([130.206.194.34])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 192BB9-0006nX-00; Sun, 06 Apr 2003 10:31:27 -0400
Received: from fedemp by bulbasaur.rediris.es with local (Exim 3.36 #1
	(Debian))	id 192BFa-00051p-00; Sun, 06 Apr 2003 16:36:02 +0200
Date: Sun, 6 Apr 2003 16:36:02 +0200
From: Federico Montesino Pouzols <fedemp@altern.org>
To: glodas <gglodas@cvf.fr>
Message-ID: <20030406143601.GA15357@bulbasaur.rediris.es>
Mail-Followup-To: glodas <gglodas@cvf.fr>, David Sugar <dyfet@ostel.com>,
	Guillaume FRAYSSE <gfraysse@cvf.fr>, ccrtp-devel@gnu.org,
	bug-commoncpp@gnu.org
References: <87r88le14n.fsf@gfraysse.dev75.cvf> <20030402094237.GA454@pcutec>
	<3E8ACB7B.6030805@ostel.com> <1049285435.14902.27.camel@portable12.dev75.cvf>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <1049285435.14902.27.camel@portable12.dev75.cvf>
User-Agent: Mutt/1.5.3i
Sender: Federico Montesino Pouzols <fedemp@bulbasaur.rediris.es>
cc: ccrtp-devel@gnu.org
cc: bug-commoncpp@gnu.org
cc: David Sugar <dyfet@ostel.com>
cc: Guillaume FRAYSSE <gfraysse@cvf.fr>
Subject: Re: [Ccrtp-devel] missing memory desallocation
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: Federico Montesino Pouzols <fedemp@altern.org>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 06 Apr 2003 14:32:41 -0000


	It is fixed in CVS. I have added a new data member in which
the string returned by getHostname is stored.

On Wed, Apr 02, 2003 at 02:10:34PM +0200, glodas wrote:
> Hi,
> 
> we've found another problem in source.cpp:212 in the function
> RTPApplication::findCNAME you call const char
> *InetAddress::getHostname(void) const
> (inaddr.cpp from package commonc++ 1.0.8) which is buggy
> 
> inaddr.cpp :
>    382         if(hp)
>    383                 return hp->h_name
> hp points on the stack variable hb which content points on the stack
> array hbuf.
> hp->h_name is removed from the stack at the end of the function, so the
> pointer is no more valid,
> 
> As you seem to be involved in common c++ too... ;)
> 
> Guillaume Fraysse,
> Guillaume Glodas
> 
> 
> 
> 
> Le mer 02/04/2003 à 13:37, David Sugar a écrit :
> > We can do a 1.0.1 this week if nessisary.
> > 
> > Federico Montesino Pouzols wrote:
> > 
> > >	Hi,
> > >
> > >	it is fixed in CVS. ccRTP 1.0 has been released the last week,
> > >so the leak will be fixed in 1.0.1. Note that 1.0 comes with an
> > >important bug fix with respect to 1.0pre2, so I recommend you to
> > >upgrade.
> > >
> > >On Wed, Apr 02, 2003 at 10:48:08AM +0200, Guillaume FRAYSSE wrote:
> > >  
> > >
> > >>Hello,
> > >>
> > >>While lokking for memory leaks with valgrind in an application we've written we found one in ccRTP, in the class TRTPSessionBase in  rtp.h, the dso and cso object are never desallocated.
> > >>
> > >>We fixed this in the endSocket method like this :
> > >>
> > >>inline void
> > >>endSocket()
> > >>{ 
> > >>        dso->endSocket(); 
> > >>        cso->endSocket();
> > >>        if (dso) delete dso; dso = NULL;
> > >>        if(cso) delete cso; cso = NULL;
> > >>}
> > >>
> > >>We use the pre2 but I didn't see a fix in the CVS repository neither.
> > >>Will this be fixed in a later release ?
> > >>
> > >>Hope this helps,
> > >>Cheers,
> > >>Guillaume
> > >>
> > >>
> > >>_______________________________________________
> > >>Ccrtp-devel mailing list
> > >>Ccrtp-devel@gnu.org
> > >>http://mail.gnu.org/mailman/listinfo/ccrtp-devel
> > >>    
> > >>
> > >
> > >
> > >_______________________________________________
> > >Ccrtp-devel mailing list
> > >Ccrtp-devel@gnu.org
> > >http://mail.gnu.org/mailman/listinfo/ccrtp-devel
> > >  
> > >
> > 
> > 
> 
> 



From MAILER-DAEMON Sun Apr 06 10:44:18 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 192BMQ-0005c5-00
	for mharc-bug-commoncpp@gnu.org; Sun, 06 Apr 2003 10:43:06 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 192BME-00052g-00
	for bug-commoncpp@gnu.org; Sun, 06 Apr 2003 10:42:54 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 192BMB-0004yH-00
	for bug-commoncpp@gnu.org; Sun, 06 Apr 2003 10:42:52 -0400
Received: from bulbasaur.rediris.es ([130.206.194.34])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 192BM7-0004nk-00
	for bug-commoncpp@gnu.org; Sun, 06 Apr 2003 10:42:47 -0400
Received: from fedemp by bulbasaur.rediris.es with local (Exim 3.36 #1
	(Debian))	id 192BQe-0005FP-00; Sun, 06 Apr 2003 16:47:28 +0200
Date: Sun, 6 Apr 2003 16:47:27 +0200
From: Federico Montesino Pouzols <fedemp@altern.org>
To: Marcelo Dalmas <mad@brasmap.com.br>
Message-ID: <20030406144727.GA19366@bulbasaur.rediris.es>
Mail-Followup-To: Marcelo Dalmas <mad@brasmap.com.br>,
	bug-commoncpp@gnu.org
References: <LLEGJHOMPFHINGBACKKLEEMGCHAA.mikes@in-tune.com>
	<20030129094029.743bc346.mad@brasmap.com.br>
	<20030129135136.GA274@bulbasaur.rediris.es>
	<20030129151422.39db57bc.mad@brasmap.com.br>
	<20030328144841.1f91e7db.mad@brasmap.com.br>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20030328144841.1f91e7db.mad@brasmap.com.br>
User-Agent: Mutt/1.5.3i
Sender: Federico Montesino Pouzols <fedemp@bulbasaur.rediris.es>
cc: bug-commoncpp@gnu.org
Subject: Re: DateTime() constructor
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: Federico Montesino Pouzols <fedemp@altern.org>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 06 Apr 2003 14:43:04 -0000


	Ok, it is in CVS.

On Fri, Mar 28, 2003 at 02:48:41PM -0300, Marcelo Dalmas wrote:
> Hi,
> 
> I'm sending a patch with original fromSeconds and a patch for commoncpp2.spec.in.
> 
> On Wed, 29 Jan 2003 15:14:22 -0200
> Marcelo Dalmas <mad@brasmap.com.br> wrote:
> 
> > The patch for fromSeconds method should't be apply because methods like
> > getHour,
> > getMinute, etc., use fromSeconds.
> > 
> [snip]
> > 
> > 
> > On Wed, 29 Jan 2003 14:51:36 +0100
> > Federico Montesino Pouzols <fedemp@altern.org> wrote:
> > 
> > > 
> > > 	Ok, it is in CVS. Marcelo, this patch seems to include your
> > > previous one for Time, however I see a little difference as for the
> > > fromSeconds method. Should we apply to CVS the changes to fromSeconds
> > > that you included in the first patch?
> 
> 
> -- 
> Marcelo Dalmas
> BRASMAP Sistemas
> www.brasmap.com.br
> Fone/Fax: (48) 333-2218 ramal 2114
> 
> Linux user #114373 http://counter.li.org/
> 



> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




From MAILER-DAEMON Mon Apr 07 12:47:42 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 192ZmY-0006yc-00
	for mharc-bug-commoncpp@gnu.org; Mon, 07 Apr 2003 12:47:42 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 192ZmV-0006wq-00
	for bug-commoncpp@gnu.org; Mon, 07 Apr 2003 12:47:39 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 192Ziy-00062L-00
	for bug-commoncpp@gnu.org; Mon, 07 Apr 2003 12:44:01 -0400
Received: from ns1.futurnet.es ([62.97.84.3] helo=smtp2.futurnet.es)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 192Ze3-0004dA-00
	for bug-commoncpp@gnu.org; Mon, 07 Apr 2003 12:38:55 -0400
Received: from galadriel.proinnet (217-125-21-246.uc.nombres.ttd.es
	[217.125.21.246])	by smtp2.futurnet.es (Postfix) with ESMTP
	id 7AD41380DB; Mon,  7 Apr 2003 18:38:48 +0200 (CEST)
Received: from nacho.proinnet (nacho.proinnet [10.0.0.33])
	by galadriel.proinnet (Postfix on SuSE Linux 7.3 (i386)) with ESMTP
	id 302791DD79; Mon,  7 Apr 2003 18:43:21 +0200 (CEST)
From: Nacho de los =?iso-8859-1?q?R=EDos=20Tormo?= <irios@proin.es>
Organization: Proin SL
To: David Sugar <dyfet@ostel.com>,
	"Ian Gough" <igough@gridironsoftware.com>, <bug-commoncpp@gnu.org>
Date: Mon, 7 Apr 2003 18:41:21 +0200
User-Agent: KMail/1.5
References: <003101c2f7b2$27aacea0$1202a8c0@gridironnetworks.com>
	<200304012200.28391.dyfet@ostel.com>
In-Reply-To: <200304012200.28391.dyfet@ostel.com>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Message-Id: <200304071841.21239.irios@proin.es>
Subject: Re: Thread::detach() call doesn't return
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Mon, 07 Apr 2003 16:47:40 -0000

> On Monday 31 March 2003 01:20 pm, Ian Gough wrote:
> > If you are linking in the older code as a dynamic lib, make sure that it
> > was compiled with the multithreaded libs.

I do link with 'g++ -lpthreads'. Is this enough, or am I missing some optio=
n=20
in the compiler command line?

> > I don't know if this will help, but I would try fully constructing the
> > thread object before attempting to start/detach it. Is there a
> > difference between how your program works using start() instead of
> > detach()?

Thank you for the suggestion. However, I've found it makes no difference=20
whether I use detach() or start() within the constructor or outside.

El Mi=E9rcoles, 2 de Abril de 2003 05:00, David Sugar escribi=F3:
> "detach" is meant to be used in place of "start" to start a constructed
> thread which has no sync/start/signaling sempahore passed as part of it's
> constructor.  If a thread is started, it is normally in the joinable stat=
e.
> Using detach as an alternate to start creates a thread context that is
> detached and cannot be joined.  You cannot delete a detached object safel=
y,
> since it may still have an active execution context.  Detached thread
> objects must self delete, typically by using "delete this" in their Final=
()
> method. In any case, neither detach nor start may be called from a
> constructor.

Thanks for the clarification -- I've still much to understand about the=20
underlying system. But the examples in the documentation show detach() bein=
g=20
called from the constructors ... Anyway, as I say above, it makes no=20
difference in my case.

The objects are never deleted, in my program, and it is meant to be ran=20
forever: this will surely demand improvement later on.

There MUST be something in the preexisting code that causes the thread syst=
em=20
to die or malfunction, just for BEING THERE. Once this code is linked, even=
=20
if it is not called at all, or if if it is called from main(), the first=20
thread to be ran or detached starts up and never returns. It runs fine,=20
though, and might create further threads if it needs to.



From MAILER-DAEMON Tue Apr 08 11:13:48 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 192unC-0003p5-00
	for mharc-bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:13:46 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 192umj-0002yo-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:13:17 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 192ulp-000245-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:12:23 -0400
Received: from acate.com.br ([200.215.17.89] helo=cli004.brasmap.com.br)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 192ukC-0001pr-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:10:41 -0400
Received: from cli004.brasmap.com.br (localhost.localdomain [127.0.0.1])
	by cli004.brasmap.com.br (Postfix) with SMTP id D951A5B924
	for <bug-commoncpp@gnu.org>; Tue,  8 Apr 2003 12:14:36 -0300 (BRT)
Date: Tue, 8 Apr 2003 12:14:31 -0300
From: Marcelo Dalmas <mad@brasmap.com.br>
To: ccxx <bug-commoncpp@gnu.org>
Message-Id: <20030408121431.5fe74faa.mad@brasmap.com.br>
Organization: BRASMAP Sistemas
X-Mailer: Sylpheed version 0.8.11 (GTK+ 1.2.10; i586-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature";
 micalg="pgp-sha1"; boundary="=.ANRtam2/SwJZv7"
Subject: date patch
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 08 Apr 2003 15:13:44 -0000

--=.ANRtam2/SwJZv7
Content-Type: multipart/mixed;
 boundary="Multipart_Tue__8_Apr_2003_12:14:31_-0300_08225770"


--Multipart_Tue__8_Apr_2003_12:14:31_-0300_08225770
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit


Hi, 

In annex: a patch with adjustments in buffers and exceptions.

-- 
Marcelo Dalmas
BRASMAP Sistemas
www.brasmap.com.br
Fone/Fax: (48) 333-2218 ramal 2114

Linux user #114373 http://counter.li.org/




--Multipart_Tue__8_Apr_2003_12:14:31_-0300_08225770
Content-Type: application/octet-stream;
 name="date-20030408.patch"
Content-Disposition: attachment;
 filename="date-20030408.patch"
Content-Transfer-Encoding: base64

SW5kZXg6IHNyYy9kYXRlLmNwcAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3Zzcm9vdC9jb21tb25j
cHAvY29tbW9uY3BwMi9zcmMvZGF0ZS5jcHAsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMTcKZGlm
ZiAtdSAtcjEuMTcgZGF0ZS5jcHAKLS0tIHNyYy9kYXRlLmNwcAk2IEFwciAyMDAzIDE0OjQzOjA5
IC0wMDAwCTEuMTcKKysrIHNyYy9kYXRlLmNwcAk4IEFwciAyMDAzIDE0OjMxOjI3IC0wMDAwCkBA
IC00NjQsNyArNDY0LDcgQEAKIAogdGltZV90IFRpbWU6OmdldFRpbWUodm9pZCkKIHsKLQljaGFy
IGJ1Zls5XTsKKwljaGFyIGJ1Zls3XTsKIAlzdHJ1Y3QgdG0gZHQ7CiAJbWVtc2V0KCZkdCwgMCwg
c2l6ZW9mKGR0KSk7CiAJZnJvbVNlY29uZHMoYnVmKTsKQEAgLTQ4MCw3ICs0ODAsNyBAQAogCiBp
bnQgVGltZTo6Z2V0SG91cih2b2lkKQogewotCWNoYXIgYnVmWzldOworCWNoYXIgYnVmWzddOwog
CWZyb21TZWNvbmRzKGJ1Zik7CiAJWk51bWJlciBudW0oYnVmLCAyKTsKIAlyZXR1cm4gbnVtKCk7
CkBAIC00ODgsNyArNDg4LDcgQEAKIAogaW50IFRpbWU6OmdldE1pbnV0ZSh2b2lkKQogewotCWNo
YXIgYnVmWzldOworCWNoYXIgYnVmWzddOwogCWZyb21TZWNvbmRzKGJ1Zik7CiAJWk51bWJlciBu
dW0oYnVmICsgMiwgMik7CiAJcmV0dXJuIG51bSgpOwpAQCAtNDk2LDcgKzQ5Niw3IEBACiAKIGlu
dCBUaW1lOjpnZXRTZWNvbmQodm9pZCkKIHsKLQljaGFyIGJ1Zls5XTsKKwljaGFyIGJ1Zls3XTsK
IAlmcm9tU2Vjb25kcyhidWYpOwogCVpOdW1iZXIgbnVtKGJ1ZiArIDQsIDIpOwogCXJldHVybiBu
dW0oKTsKQEAgLTUzOSw3ICs1MzksNyBAQAogCiBzdHJpbmcgVGltZTo6b3BlcmF0b3IoKSgpCiB7
Ci0JY2hhciBidWZbOV07CisJY2hhciBidWZbN107CiAKIAlmcm9tU2Vjb25kcyhidWYpOwogCXN0
cmluZyB0aW1lKGJ1Zik7CkBAIC02MTQsMTQgKzYxNCwxNSBAQAogewogCXNlY29uZHMgPSAtMTsK
IAkKLQlpZiAoaG91ciA+IDIzKQotCQlyZXR1cm47Ci0KLQlpZiAobWludXRlID4gNTkpCi0JCXJl
dHVybjsKLQotCWlmIChzZWNvbmQgPiA1OSkKKwlpZiAoaG91ciA+IDIzIHx8bWludXRlID4gNTkg
fHxzZWNvbmQgPiA1OSkgeworCQlpZihnZXRFeGNlcHRpb24oKSA9PSBUaHJlYWQ6OnRocm93T2Jq
ZWN0KSB7CisJCQl0aHJvdyB0aGlzOworCQl9CisJCWVsc2UgaWYoZ2V0RXhjZXB0aW9uKCkgPT0g
VGhyZWFkOjp0aHJvd0V4Y2VwdGlvbikgeworCQkJdGhyb3cgRXhjZXB0aW9uKCJUaW1lOjp0b1Nl
Y29uZHMoKTogSW52YWxpZCB0aW1lLiIpOworCQl9CiAJCXJldHVybjsKKwl9CiAKIAlzZWNvbmRz
ID0gMzYwMCAqIGhvdXIgKyA2MCAqIG1pbnV0ZSArIHNlY29uZDsKIH0KQEAgLTYzNSw3ICs2MzYs
NyBAQAogCWhvdXIgPSBzZWNvbmRzIC8gMzYwMDsKIAltaW51dGUgPSAoc2Vjb25kcyAtICgzNjAw
ICogaG91cigpKSkgLyA2MDsKIAlzZWNvbmQgPSBzZWNvbmRzIC0gKDM2MDAgKiBob3VyKCkpIC0g
KDYwICogbWludXRlKCkpOwotCWJ1ZmZlcls4XSA9ICdcMCc7CisJYnVmZmVyWzZdID0gJ1wwJzsK
IH0KIAogVGltZSBvcGVyYXRvcisoVGltZSAmdGltZTEsIFRpbWUgJnRpbWUyKQo=

--Multipart_Tue__8_Apr_2003_12:14:31_-0300_08225770--

--=.ANRtam2/SwJZv7
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+kudc95NRejZp8BwRAhlYAKDbQukoOKAVE1GxBev04SqNnFNbvACePwHb
iTKnayMsIeRt7V+bbhYFqJM=
=xqQp
-----END PGP SIGNATURE-----

--=.ANRtam2/SwJZv7--



From MAILER-DAEMON Tue Apr 08 11:25:13 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 192uyG-0003ZT-00
	for mharc-bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:25:12 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 192uy0-0003IS-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:24:56 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 192uxy-0003Es-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:24:55 -0400
Received: from titan.imse.cnm.es ([150.214.7.30] helo=mx.imse.cnm.es)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 192uxx-0002xO-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:24:53 -0400
Received: from pcutec.imse.cnm.es (mail@pcutec [150.214.7.153])
	by mx.imse.cnm.es (8.12.9/8.12.3) with ESMTP id h38FOaO1024709;
	Tue, 8 Apr 2003 17:24:37 +0200 (MEST)
Received: from fedemp by pcutec.imse.cnm.es with local (Exim 3.35 #1 (Debian))
	id 192v14-0000WL-00; Tue, 08 Apr 2003 17:28:06 +0200
Date: Tue, 8 Apr 2003 17:28:05 +0200
From: Federico Montesino Pouzols <fedemp@altern.org>
To: Marcelo Dalmas <mad@brasmap.com.br>
Message-ID: <20030408152805.GA1247@pcutec>
Mail-Followup-To: Marcelo Dalmas <mad@brasmap.com.br>,
	ccxx <bug-commoncpp@gnu.org>
References: <20030408121431.5fe74faa.mad@brasmap.com.br>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20030408121431.5fe74faa.mad@brasmap.com.br>
User-Agent: Mutt/1.3.28i
Sender: Federico Montesino Pouzols <fedemp@imse.cnm.es>
cc: ccxx <bug-commoncpp@gnu.org>
Subject: Re: date patch
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: Federico Montesino Pouzols <fedemp@altern.org>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 08 Apr 2003 15:25:11 -0000


	Hi, it is in CVS.

On Tue, Apr 08, 2003 at 12:14:31PM -0300, Marcelo Dalmas wrote:
> 
> Hi, 
> 
> In annex: a patch with adjustments in buffers and exceptions.
> 
> -- 
> Marcelo Dalmas
> BRASMAP Sistemas
> www.brasmap.com.br
> Fone/Fax: (48) 333-2218 ramal 2114
> 
> Linux user #114373 http://counter.li.org/
> 
> 
> 





> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




From MAILER-DAEMON Tue Apr 08 11:39:16 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 192vBj-0007cj-00
	for mharc-bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:39:07 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 192uao-0000L0-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 11:00:58 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 192uZk-0008Aj-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 10:59:53 -0400
Received: from cvis163.marconicomms.com ([128.87.251.113])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 192uVe-0006n5-00
	for bug-commoncpp@gnu.org; Tue, 08 Apr 2003 10:55:38 -0400
Received: from cvis152.mail.marconicomms.com by cvis163.marconicomms.com with
	ESMTP	(8.11.6+Sun/mcig-3) id h38EtWE04198;
	Tue, 8 Apr 2003 15:55:32 +0100 (BST)
Received: from cvdgwy01.uk.marconicomms.com (unverified) by 
    cvis151.mail.marconicomms.com (Content Technologies SMTPRS 4.3.1) with 
    ESMTP id <T617a65fd72c0a899e12ac@cvis151.mail.marconicomms.com> for 
    <bug-commoncpp@gnu.org>; Tue, 8 Apr 2003 15:55:32 +0100
To: bug-commoncpp@gnu.org
X-Mailer: Lotus Notes Release 5.0.8  June 18, 2001
Message-ID: <OF81F4A6B1.00DE6380-ONC1256D02.00504146@uk.marconicomms.com>
From: "Georg Soffel" <Georg.Soffel@marconi.com>
Date: Tue, 8 Apr 2003 16:55:28 +0200
X-MIMETrack: Serialize by Router on CVDGWY01/S/EXT/MC1 
    (Release 5.0.11  |July 24, 2002) at 08/04/2003 15:55:28
MIME-Version: 1.0
Content-type: text/plain; charset="us-ascii"
X-Mailman-Approved-At: Tue, 08 Apr 2003 11:39:06 -0400
Subject: request for changes in the examples tcp.cpp, ...
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 08 Apr 2003 15:01:28 -0000

Hello,

at the end of the tcp.cpp example is the following code:

        catch(Socket *socket)
        {
                tpport_t port;
                InetAddress saddr = (InetAddress)socket->getPeer(&port);
                cerr << "socket error " << saddr << ":" << port << endl;
                cout << "error number " << socket->getErrorNumber() <<
endl;
                if(socket->getErrorNumber() == Socket::errResourceFailure)
                {
                        cerr << "bind failed; no resources" << endl;
                        exit(-1);
                }
                if(socket->getErrorNumber() == Socket::errBindingFailed)
                {
                        cerr << "bind failed; port busy" << endl;
                        exit(-1);
                }
        }

This is probably not what is wanted.
By calling the function  socket->getPeer(&port) the error number of the
socket
is set to errSuccess and the two if statements will never be executed.
Something like:

        catch(Socket *socket)
        {
                cout << "error number " << socket->getErrorNumber() <<
endl;
                if(socket->getErrorNumber() == Socket::errResourceFailure)
                {
                        cerr << "bind failed; no resources" << endl;
                }
                if(socket->getErrorNumber() == Socket::errBindingFailed)
                {
                        cerr << "bind failed; port busy" << endl;
                }
                tpport_t port;
                InetAddress saddr = (InetAddress)socket->getPeer(&port);
                cerr << "socket error " << saddr << ":" << port << endl;
                exit(-1);
        }

is probably better. This problem occurs in other examples as well.
Furthermore I think some hints on

        InetAddress addr;
        addr = "255.255.255.255";
        cout << "testing addr: " << addr << ":" << 4096 << endl;
        addr = "127.0.0.1";
        cout << "binding for: " << addr << ":" << 4096 << endl;

might be helpfull to other users. Like:

        InetAddress addr;
        addr = "255.255.255.255";
        cout << "testing addr: " << addr << ":" << 4096 << endl; // FIXME:
Comment on what is tested here
        addr = "127.0.0.1"; // INADDR_LOOPBACK for access from the local
host only or
        //addr = "0.0.0.0"  // INADDR_ANY for access from any host
        cout << "binding for: " << addr << ":" << 4096 << endl;

Hope your are not disturbed from these minor problems.

Regards
Georg Soffel

Marconi Communications GmbH    Phone: +49 (7191) 13    2155
Postfach: 1920                                       Fax:       +49 (7191)
13 6 2155
D-71509 Backnang
mailto:Georg.Soffel@marconi.com
Germany










From MAILER-DAEMON Thu Apr 10 11:09:59 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 193dfP-0007kK-00
	for mharc-bug-commoncpp@gnu.org; Thu, 10 Apr 2003 11:08:43 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 193dfI-0007fx-00
	for bug-commoncpp@gnu.org; Thu, 10 Apr 2003 11:08:36 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 193dej-0006wm-00
	for bug-commoncpp@gnu.org; Thu, 10 Apr 2003 11:08:11 -0400
Received: from raven.ecs.soton.ac.uk ([152.78.70.1])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 193de4-0005p1-00
	for bug-commoncpp@gnu.org; Thu, 10 Apr 2003 11:07:20 -0400
Received: from crow.ecs.soton.ac.uk (crow.ecs.soton.ac.uk [152.78.71.3])
	by raven.ecs.soton.ac.uk (8.9.3/8.9.3) with ESMTP id QAA22893
	for <bug-commoncpp@gnu.org>; Thu, 10 Apr 2003 16:07:16 +0100 (BST)
Received: from bigfoot.com (ug-vpn28 [152.78.236.28])
	by crow.ecs.soton.ac.uk (8.9.3p2/8.9.3) with ESMTP id QAA01543
	for <bug-commoncpp@gnu.org>; Thu, 10 Apr 2003 16:07:13 +0100 (BST)
Message-ID: <3E95889C.3070105@bigfoot.com>
Date: Thu, 10 Apr 2003 16:07:08 +0100
From: Jon Wilson <sendmemymail@bigfoot.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact helpdesk@ecs.soton.ac.uk for more
	information
X-ECS-MailScanner: Found to be clean
Subject: Reading from a tcpstream
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Thu, 10 Apr 2003 15:08:42 -0000

I have the following code...
However, when I try and use the inserter for the tcpstream it segfaults, 
and if I try to cast first, I get an error code of 1. Which if I am 
right means errCreateFailed.
I create one WithdrawServer and one DepositServer, both running on 
different ports, on "localhost". Each of them runs as a thread creating 
another thread should a connection be stablished on the socket. I have 
to use a tcpstream* since I need control over the destructor for when 
the thread is terminated. The same is true for the socket. I cannot rely 
on the run methods completing for memory management since they may not 
complete should the threads be terminated from main.
The serverthread and server classes are both virtual. The main creates a 
WithdrawServer, this waits on a connection and then creates a tcpstream 
from the TCPSocket. This is then passed to the constructor (as a 
pointer) of another thread which it starts for processing. However, even 
as soon as the stream is first created, calling the inserter segfaults! 
See astrisks.
Is there another way to do this? The docs mentioned about the tcpstream 
being  a...

more natural C++ "tcpstream" class for use by non-threaded applications. 
C++ "fstream" style tcpstream class.
This class behaves a lot more like fstream and similar classes.
Does that mean that it isn't thread safe? Is there another thread safe 
version???
Many Thanks.
Jon Wilson

class ServerThread:public Thread{
    public:
        ServerThread(tcpstream* tcp){
                cout << "\tTHREAD" << endl;
                this->tcp=tcp;
                setCancel(Thread::cancelImmediate);
                start();
        }
        ~ServerThread(){
                cout << "\t~THREAD" << endl;
                terminate();
                delete tcp;
        }
        virtual void run()=0;
    protected:
        tcpstream* tcp;
};
class WithdrawThread:public ServerThread{
    public:
        WithdrawThread(tcpstream* tcp):ServerThread(tcp){
            cout << (void*)tcp << endl;
        }
        void run();
};
class DepositThread:public ServerThread{
    public:
        DepositThread(tcpstream* tcp):ServerThread(tcp){}
        void run();
};
class Server:public Thread{
    public:
        list<ServerThread*> threads;
        Server(){
                cout << "SERVER" << endl;
                setCancel(Thread::cancelImmediate);
                start();
        }
        ~Server(){
                cout << "~SERVER" << endl;
                terminate();
                delete sock;
                while(threads.size()){
                    delete threads.front();
                    threads.pop_front();
                }
        }
        virtual void run()=0;
        static void setHost(char* host){
            Server::host=host;
        };
        static void setPorts(int withdraw,int deposit){
            withdraw_port=withdraw;
            deposit_port=deposit;
        }
    protected:
        static char* host;
        static tpport_t withdraw_port;
        static tpport_t deposit_port;
        TCPSocket* sock;
};
class WithdrawServer:public Server{
    public:
        WithdrawServer(){
            this->port=Server::withdraw_port;
        }
        void run();
    private:
        tpport_t port;
};
class DepositServer:public Server{
    public:
        DepositServer(){
            this->port=Server::deposit_port;
        }
        void run();
    private:
        tpport_t port;
};
void DepositServer::run(){
    InetAddress addr(Server::host);
    sock=new TCPSocket(addr,port);
    while(true){
        if(sock->isPendingConnection()){
            cout << "D Connected" << endl;
            tcpstream* tcp=new tcpstream(*sock)
            tcp << "HELLO" << endl; 
//*********************************************************** THIS WOULD 
CAUSE A SEGFAULT
            threads.push_back(new DepositThread(tcp));
            yield();
        }
    }
}
void WithdrawThread::run(){
    try{
        static int i=0;
        while(true){
            cout << (typeid(tcp)==typeid(tcpstream*)?"OK":"NOT OK") << endl;
            cout << (void*)tcp << endl;
            (tcpstream)*tcp << "W" << i << endl;
            cout << "W" << i++ << endl;
            yield();
        }
    }catch(Socket* s){
        if(s->getErrorNumber() == Socket::errResourceFailure){
                cerr << "bind failed; no resources" << endl;
        }
        if(s->getErrorNumber() == Socket::errBindingFailed){
                cerr << "bind failed; port busy" << endl;
        }
        cout << "ERR " << s->getErrorNumber() << endl;
    }
};




From MAILER-DAEMON Fri Apr 11 10:19:55 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 193zNi-00033L-00
	for mharc-bug-commoncpp@gnu.org; Fri, 11 Apr 2003 10:19:54 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 193zNf-00031d-00
	for bug-commoncpp@gnu.org; Fri, 11 Apr 2003 10:19:51 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 193zNc-0002zF-00
	for bug-commoncpp@gnu.org; Fri, 11 Apr 2003 10:19:49 -0400
Received: from raven.ecs.soton.ac.uk ([152.78.70.1])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 193zFV-0000xP-00
	for bug-commoncpp@gnu.org; Fri, 11 Apr 2003 10:11:26 -0400
Received: from crow.ecs.soton.ac.uk (crow.ecs.soton.ac.uk [152.78.71.3])
	by raven.ecs.soton.ac.uk (8.9.3/8.9.3) with ESMTP id PAA04936
	for <bug-commoncpp@gnu.org>; Fri, 11 Apr 2003 15:11:24 +0100 (BST)
Received: from bigfoot.com (ug-vpn28 [152.78.236.28])
	by crow.ecs.soton.ac.uk (8.9.3p2/8.9.3) with ESMTP id PAA24518
	for <bug-commoncpp@gnu.org>; Fri, 11 Apr 2003 15:11:18 +0100 (BST)
Message-ID: <3E96CCFE.6090702@bigfoot.com>
Date: Fri, 11 Apr 2003 15:11:10 +0100
From: Jon Wilson <sendmemymail@bigfoot.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact helpdesk@ecs.soton.ac.uk for more
	information
X-ECS-MailScanner: Found to be clean
Subject: Passing a TCPSocket* to construct a TCPStream.
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Fri, 11 Apr 2003 14:19:52 -0000

I think I have narrowed down the problem I was having.
The constructor for the TCPStream requires a TCPSocket& passed by 
reference. However, I need to use a TCPSocket* since as I terminate a 
thread I cannot guarantee that the run() method completes and hence the 
socket goes out of scope and gets deleted. For that reason, I need to 
use a pointed type (TCPSocket*) and handle the "delete" myself in the 
destructor. However, I need to use this to create a TCPStream. Is it 
possible to do this???

Server::host="localhost";
InetAddress* addr=new InetAddress(Server::host);
TCPSocket* sock=new TCPSocket(*addr,port);
TCPStream* tcp=new TCPStream(*sock);

My slightly more complex code is as follows...
But I am pretty sure that this is the problem, is there another way I 
should do things?


class ServerThread:public TCPSession{
     public:
         ServerThread(TCPSocket& sock):TCPSession(sock){
                 cout << "\tTHREAD" << endl;
                 setCancel(Thread::cancelImmediate);
                 start();
         }
         ~ServerThread(){
                 cout << "\t~THREAD" << endl;
                 terminate();
         }
         virtual void run()=0;
     protected:
};
class WithdrawThread:public ServerThread{
     public:
         WithdrawThread(TCPSocket& sock):ServerThread(sock){
             cout << "\tWithdrawThread" << endl;
         }
         void run();
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////
class Server:public Thread{
     public:
         list<ServerThread*> threads;
         Server(){
                 cout << "SERVER" << endl;
                 setCancel(Thread::cancelImmediate);
                 start();
         }
         ~Server(){
                 cout << "~SERVER" << endl;
                 terminate();
                 delete sock;
                 delete addr;
                 while(threads.size()){
                     delete threads.front();
                     threads.pop_front();
                 }
         }
         virtual void run()=0;
         static void setHost(char* host){
             Server::host=host;
         };
         static void setPorts(int withdraw,int deposit){
             withdraw_port=withdraw;
             deposit_port=deposit;
         }
     protected:
         InetAddress* addr;
         static char* host;
         static tpport_t withdraw_port;
         static tpport_t deposit_port;
         TCPSocket* sock;
};


class WithdrawServer:public Server{
     public:
         WithdrawServer(){
             this->port=Server::withdraw_port;
         }
         void run();
     private:
         tpport_t port;
};


void WithdrawServer::run(){
     addr=new InetAddress(Server::host);
     sock=new TCPSocket(*addr,port);
     while(true){
         if(sock->isPendingConnection()){
             cout << "W Connected" << endl;
             threads.push_back(new WithdrawThread(*sock));
             cout << "Added to list" << endl;
             yield();
         }
     }
}
It seems that constructing the WithdrawThread seems to make things segfault.




From MAILER-DAEMON Fri Apr 11 10:30:38 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 193zXH-0007Gr-00
	for mharc-bug-commoncpp@gnu.org; Fri, 11 Apr 2003 10:29:47 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 193zXC-0007B5-00
	for bug-commoncpp@gnu.org; Fri, 11 Apr 2003 10:29:42 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 193zX9-00076P-00
	for bug-commoncpp@gnu.org; Fri, 11 Apr 2003 10:29:40 -0400
Received: from raven.ecs.soton.ac.uk ([152.78.70.1])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 193zX0-00073y-00
	for bug-commoncpp@gnu.org; Fri, 11 Apr 2003 10:29:30 -0400
Received: from crow.ecs.soton.ac.uk (crow.ecs.soton.ac.uk [152.78.71.3])
	by raven.ecs.soton.ac.uk (8.9.3/8.9.3) with ESMTP id PAA05129
	for <bug-commoncpp@gnu.org>; Fri, 11 Apr 2003 15:29:29 +0100 (BST)
Received: from bigfoot.com (ug-vpn28 [152.78.236.28])
	by crow.ecs.soton.ac.uk (8.9.3p2/8.9.3) with ESMTP id PAA24829
	for <bug-commoncpp@gnu.org>; Fri, 11 Apr 2003 15:29:21 +0100 (BST)
Message-ID: <3E96D137.5030100@bigfoot.com>
Date: Fri, 11 Apr 2003 15:29:11 +0100
From: Jon Wilson <sendmemymail@bigfoot.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact helpdesk@ecs.soton.ac.uk for more
	information
X-ECS-MailScanner: Found to be clean
Subject: Found the bug
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Fri, 11 Apr 2003 14:29:46 -0000

Sorry for all the previous posts, seems that the -mms-bitfields used to 
compile the Gtk code along side it disagreed with CommonCPP!
Have to find a work around.
Sorry again.
Jon




From MAILER-DAEMON Sat Apr 12 09:22:16 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 194KxM-00037J-00
	for mharc-bug-commoncpp@gnu.org; Sat, 12 Apr 2003 09:22:08 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 194KxH-0002uF-00
	for bug-commoncpp@gnu.org; Sat, 12 Apr 2003 09:22:03 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 194KxC-0002gR-00
	for bug-commoncpp@gnu.org; Sat, 12 Apr 2003 09:21:58 -0400
Received: from n297p022.adsl.highway.telekom.at ([213.33.37.22]
	helo=triendl.kj)	by monty-python.gnu.org with smtp (Exim 4.10.13)
	id 194Kx7-0002NC-00
	for bug-commoncpp@gnu.org; Sat, 12 Apr 2003 09:21:54 -0400
Received: (qmail 1359 invoked from network); 12 Apr 2003 13:21:46 -0000
Received: from unknown (HELO triendl.kj) (127.0.0.1)
  by loopback with SMTP; 12 Apr 2003 13:21:46 -0000
Date: Sat, 12 Apr 2003 15:21:46 +0200
From: triendl klaus <triendl.kj@aon.at>
To: bug-commoncpp@gnu.org
Message-Id: <20030412152146.2d4ac426.triendl.kj@aon.at>
X-Mailer: Sylpheed version 0.8.11 (GTK+ 1.2.10; i386-debian-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: change of socketport constructor
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sat, 12 Apr 2003 13:22:06 -0000

hi,

i derived my own class from socketport and tested the whole server-implemenentation with socketservice(s) and attached socketports thoroughly on windows (2000 and xp) and discovered severe problems with the teamwork of socketservice and my socketport during construction.

the point is that the socketport constructor expects a valid socketservice to which it attaches itself after establishing the connection with the client. after attaching itself it causes the socketservice to update itself. then the construction of the derived class can continue. so far so good.
now, the problem is that the socketservice runs in its own thread which is so quick that if there is already pending data on the socket it calls SocketPort::pending() BEFORE the virtual function pointers of the derived class and other variables are initialized.


therefore i changed the code so far that the class derived from socketport has to attach itself now - after all variables have been initialized.
if you agree i would send a patch.


--
klaus triendl



From MAILER-DAEMON Sun Apr 13 08:08:10 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 194gHJ-0007Ae-00
	for mharc-bug-commoncpp@gnu.org; Sun, 13 Apr 2003 08:08:09 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 194gGX-0005hQ-00
	for bug-commoncpp@gnu.org; Sun, 13 Apr 2003 08:07:21 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 194gFz-0004V8-00
	for bug-commoncpp@gnu.org; Sun, 13 Apr 2003 08:06:48 -0400
Received: from thumbler.kulnet.kuleuven.ac.be ([134.58.240.45])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 194gFj-000486-00
	for bug-commoncpp@gnu.org; Sun, 13 Apr 2003 08:06:31 -0400
Received: from localhost (localhost [127.0.0.1])
	by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id BCB471377DF
	for <bug-commoncpp@gnu.org>; Sun, 13 Apr 2003 14:06:28 +0200 (CEST)
Received: from crassus.kulnet.kuleuven.ac.be (crassus.kulnet.kuleuven.ac.be
	[134.58.240.63])
	by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 4FFD11377CA
	for <bug-commoncpp@gnu.org>; Sun, 13 Apr 2003 14:06:28 +0200 (CEST)
Received: from 10-67-120-25.kotnet.org (10-67-120-25.kotnet.org
	[10.67.120.25])
	by crassus.kulnet.kuleuven.ac.be (Postfix) with ESMTP id A1A9F13EC0B
	for <bug-commoncpp@gnu.org>; Sun, 13 Apr 2003 14:06:27 +0200 (CEST)
From: Dimitar Dimitrov <dimitar@yucom.be>
To: bug-commoncpp@gnu.org
Date: Sun, 13 Apr 2003 14:06:23 +0200
User-Agent: KMail/1.5
References: <20030412152146.2d4ac426.triendl.kj@aon.at>
In-Reply-To: <20030412152146.2d4ac426.triendl.kj@aon.at>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304131406.23064.dimitar@yucom.be>
X-Virus-Scanned: by KULeuven Antivirus Cluster
Subject: Re: change of socketport constructor 
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 13 Apr 2003 12:08:07 -0000

Hi,

What you mention is correct. The situation is even worse. The socketservice 
thread can call the destructor of your socketport class before the 
constructor of the object has finished.  I tried to mention this some time 
ago, but it seems nobody noticed. And it is not only Win32 issue, looks more 
like design problem. 

I'll be very interested in your patch.

Regards,
Dimitar


On Saturday 12 April 2003 15:21, triendl klaus wrote:
> hi,
>
> i derived my own class from socketport and tested the whole
> server-implemenentation with socketservice(s) and attached socketports
> thoroughly on windows (2000 and xp) and discovered severe problems with the
> teamwork of socketservice and my socketport during construction.
>
> the point is that the socketport constructor expects a valid socketservice
> to which it attaches itself after establishing the connection with the
> client. after attaching itself it causes the socketservice to update
> itself. then the construction of the derived class can continue. so far so
> good. now, the problem is that the socketservice runs in its own thread
> which is so quick that if there is already pending data on the socket it
> calls SocketPort::pending() BEFORE the virtual function pointers of the
> derived class and other variables are initialized.
>
>
> therefore i changed the code so far that the class derived from socketport
> has to attach itself now - after all variables have been initialized. if
> you agree i would send a patch.
>
>
> --
> klaus triendl
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




From MAILER-DAEMON Sun Apr 13 10:59:38 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 194ixG-00039t-00
	for mharc-bug-commoncpp@gnu.org; Sun, 13 Apr 2003 10:59:38 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 194ixD-000348-00
	for bug-commoncpp@gnu.org; Sun, 13 Apr 2003 10:59:35 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 194ixB-00032N-00
	for bug-commoncpp@gnu.org; Sun, 13 Apr 2003 10:59:34 -0400
Received: from pool-138-89-34-217.mad.east.verizon.net ([138.89.34.217]
	helo=home.bayonne.dyndns.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 194ixB-00031x-00
	for bug-commoncpp@gnu.org; Sun, 13 Apr 2003 10:59:33 -0400
Received: from 192.168.1.104 ([192.168.1.104])
	by home.bayonne.dyndns.org (8.11.6/8.11.6) with ESMTP id h3DFkff13132;
	Sun, 13 Apr 2003 11:46:41 -0400
From: David Sugar <dyfet@ostel.com>
To: bug-commoncpp@gnu.org
Date: Sun, 13 Apr 2003 10:47:22 -0400
User-Agent: KMail/1.5
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304131047.22766.dyfet@ostel.com>
cc: cplusplus-devel@lists.sourceforge.net
Subject: dynamic loading and mach/macosx
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 13 Apr 2003 14:59:36 -0000

I have rewritten the dso class for support of mach/macosx (which has some 
specialized low level functions for dloading) and also for hpux (which uses 
shl_load rather than dlopen) for what will be 1.0.10.  It's still not quite 
correct and is a bit hard to test in part because macosx does not generate 
valid "modules" using automake/autoconf.  It seems the versions that are 
included in Darwin do not know how to use the -bundle flag and other options 
which are needed when creating plugins.

I think resolving issues with the extending dynamic loading to new targets, 
and perhaps fixes for SocketPort/SocketService, should be the focus of 
1.0.10.





From MAILER-DAEMON Mon Apr 14 18:15:20 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 195CER-0002Cl-00
	for mharc-bug-commoncpp@gnu.org; Mon, 14 Apr 2003 18:15:19 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 195CEO-0002B7-00
	for bug-commoncpp@gnu.org; Mon, 14 Apr 2003 18:15:16 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 195CEJ-00025p-00
	for bug-commoncpp@gnu.org; Mon, 14 Apr 2003 18:15:15 -0400
Received: from n292p022.adsl.highway.telekom.at ([213.33.36.118]
	helo=triendl.kj)	by monty-python.gnu.org with smtp (Exim 4.10.13)
	id 195CEI-000245-00
	for bug-commoncpp@gnu.org; Mon, 14 Apr 2003 18:15:10 -0400
Received: (qmail 1041 invoked from network); 14 Apr 2003 22:15:06 -0000
Received: from unknown (HELO triendl.kj) (127.0.0.1)
  by loopback with SMTP; 14 Apr 2003 22:15:06 -0000
Date: Tue, 15 Apr 2003 00:15:06 +0200
From: klaus triendl <triendl.kj@aon.at>
To: Dimitar Dimitrov <dimitar@yucom.be>
Message-Id: <20030415001506.77e62c18.triendl.kj@aon.at>
In-Reply-To: <200304131406.23064.dimitar@yucom.be>
References: <20030412152146.2d4ac426.triendl.kj@aon.at>
	<200304131406.23064.dimitar@yucom.be>
X-Mailer: Sylpheed version 0.8.11 (GTK+ 1.2.10; i386-debian-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
cc: bug-commoncpp@gnu.org
Subject: Re: change of socketport constructor
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: triendl.kj@aon.at
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Mon, 14 Apr 2003 22:15:17 -0000

well, before i make the patch i wanna address another issue:
before waiting for events in run(), the socketservice recalculates the port timers, eventually calls Port::expired() (and tries again in this case):

----
while(port)
{
	onCallback(port);
	//find out and set events to listen to
	...
		
retry:
	expires = port->getTimer();
	if(expires > 0)
		if(expires < timer)
			timer = expires;
	// if we expire, get new scheduling now
	if(!expires)
	{
		port->endTimer();
		port->expired();
		goto retry;
	}
	port = port->next;
}
----

what about self-deleting socketports? somewhen it has to be destroyed and freed (because e.g. i chose to close the port if the timer has expired). the deletion would happen in expired(); but in this case the port object is not valid anymore, port->getTimer() fails and port->next also (tested).
furthermore, if the port is deleted, no event listening has to take place.
we have to know somehow from expired() whether the port was deleted.


regards
klaus






On Sun, 13 Apr 2003 14:06:23 +0200
Dimitar Dimitrov <dimitar@yucom.be> wrote:

> Hi,
> 
> What you mention is correct. The situation is even worse. The socketservice 
> thread can call the destructor of your socketport class before the 
> constructor of the object has finished.  I tried to mention this some time 
> ago, but it seems nobody noticed. And it is not only Win32 issue, looks more 
> like design problem. 
> 
> I'll be very interested in your patch.
> 
> Regards,
> Dimitar



From MAILER-DAEMON Tue Apr 15 04:44:41 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 195M3U-0007Bm-00
	for mharc-bug-commoncpp@gnu.org; Tue, 15 Apr 2003 04:44:40 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 195M3S-0007B8-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 04:44:38 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 195M3R-0007AN-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 04:44:37 -0400
Received: from nebula.skynet.be ([195.238.2.112])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 195M3Q-00079v-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 04:44:36 -0400
Received: from linux.lan (6.138-136-217.adsl.skynet.be [217.136.138.6])
	id h3F8iSf7014791;	Tue, 15 Apr 2003 10:44:28 +0200
	(envelope-from <dimitar@yucom.be>)
From: Dimitar Dimitrov <dimitar@yucom.be>
To: triendl.kj@aon.at
Date: Tue, 15 Apr 2003 03:50:24 +0200
User-Agent: KMail/1.5
References: <20030412152146.2d4ac426.triendl.kj@aon.at>
	<200304131406.23064.dimitar@yucom.be>
	<20030415001506.77e62c18.triendl.kj@aon.at>
In-Reply-To: <20030415001506.77e62c18.triendl.kj@aon.at>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="windows-1251"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304150350.24902.dimitar@yucom.be>
cc: bug-commoncpp@gnu.org
Subject: Re: change of socketport constructor
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 15 Apr 2003 08:44:39 -0000

On Tuesday 15 April 2003 00:15, klaus triendl wrote:
[cut]
> what about self-deleting socketports? somewhen it has to be destroyed and
> freed (because e.g. i chose to close the port if the timer has expired).
> the deletion would happen in expired(); but in this case the port object is
> not valid anymore, port->getTimer() fails and port->next also (tested).
> furthermore, if the port is deleted, no event listening has to take place.
> we have to know somehow from expired() whether the port was deleted.
[cut]

This comes obvious from one of the examples, doesn't it? The idea of 
expired(), as far as I got it, apart from simply notifying about the 
expiration is that one can reset the timer and that's why it should be 
checked again in that "goto" loop. I don't know... may be a bool result will 
be good enough. expired() returns true and that's it, it really expired.. end 
of story... we don't "goto retry" again.
BTW, isn't it better if expired() is moved to TimePort interface. After all it 
deals with time issues. 

Some other remarks. They concern more Win32 implementation with which I played 
some time ago, so I may have forgotten something.  

For example something that becomes obvious very fast is the difference in 
semantic of the SocketService::Sync class and the pipe used in non-Win32 
implementation. The thing is that SocketService::Sync object has a place to 
hold only one byte. What happens at the end of ~SocketService(). If there is 
no thread anymore (after update(0) and terminate() the thread should be gone) 
to read the flag from the Sync instance and to release the semaphore then the 
attempt to delete the next port object

while(first)
	delete first;

will block because destructor of the port tries to call update() and that one 
blocks on the semaphore. Not to mention that the Sync object is already 
gone!!! BTW, the non-Win32 implementation doesn't look more correct, but 
there at least I can write to the pipe and my thread will not block. It also 
will not hurt if the pipe descriptors are closed at the end.

Also in connection with this I think (but I can be wrong) that 
SocketService::Sync::getFlag() should realease the semaphore if the flag is 0 
as far as 0 is a valid value.

Another issue if I remember correctly was with calculating the time in Win32 
implementation of TimePort. The GetTickCount() will wrap around after some 
period of time which is quite long, but in some cases even very long is not 
long enough. All depends on the view point. I don't remember the period 
exactly, but it was in terms of days which is quite different from what 
gettimeofday() gives.

OK. It become a long e-mail...

Best regards,
Dimitar



From MAILER-DAEMON Tue Apr 15 09:33:26 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 195QYw-000350-00
	for mharc-bug-commoncpp@gnu.org; Tue, 15 Apr 2003 09:33:26 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 195QCo-0007zh-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 09:10:34 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 195Q8Z-0006PY-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 09:06:15 -0400
Received: from cmailg4.svr.pol.co.uk ([195.92.195.174])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 195Q85-0005p1-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 09:05:41 -0400
Received: from modem-577.lemur.dialup.pol.co.uk ([217.135.130.65])
	by cmailg4.svr.pol.co.uk with esmtp (Exim 4.14)
	id 195Q82-0002b3-Hc
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 14:05:39 +0100
From: Jon <jdw100@ecs.soton.ac.uk>
To: bug-commoncpp@gnu.org
Date: Tue, 15 Apr 2003 14:05:39 -0400
User-Agent: KMail/1.5
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304151405.39277.jdw100@ecs.soton.ac.uk>
X-Mailman-Approved-At: Tue, 15 Apr 2003 09:33:24 -0400
Subject: Pure Virtual Method call problem. (Bug in library?)
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 15 Apr 2003 13:13:36 -0000

I keep getting a runtime error when using the following code. As you can see, 
both of the derived classes have their own run() method, however, the base 
class defines this method as virtual and required for all subclasses. The 
problem occurs when start() is called in the constructor of the derived 
class. I get a pure virtual method call runtime exception and the program 
dies. This is compiling under gcc3.2 in Linux, however, in windows MingW with 
gcc3.2 everything is fine!!! Since I have no compiler directives and the same 
compiler on each system, I cannot see what could be the problem.

Is this a difference in the port of gcc? Or is it caused by the library 
calling run() from the start() method call? I am using 1.0.9 without 
modification on Linux, however, I had to comment HAVE_OLD_IOSTREAM on 
windows.

I can provide the full source code if necessary


#ifndef SERVER_H
#define SERVER_H
#include "thread.h"
#include <cc++/thread.h>
#include <cc++/socket.h>
#include <list>
#define DEFAULT_WITHDRAW_PORT 1234
#define DEFAULT_DEPOSIT_PORT 5678
using namespace std;
using namespace ost;
class Server:public Thread{
    public:
        Server(){
                cout << "SERVER" << endl;
                setCancel(Thread::cancelImmediate);
        }
        ~Server(){
                cout << "~SERVER" << endl;
                terminate();
                delete sock;
                delete addr;
        }
        virtual void run()=0;
        static void setHost(char* host){
            Server::host=host;
        };
        static void setPorts(int withdraw,int deposit){
            withdraw_port=withdraw;
            deposit_port=deposit;
        }
        static Server* withdraw;
        static Server* deposit;
    protected:
        InetAddress* addr;
        static char* host;
        static tpport_t withdraw_port;
        static tpport_t deposit_port;
        TCPSocket* sock;
};
class WithdrawServer:public Server{
    public:
        WithdrawServer(){
            this->port=Server::withdraw_port;
	    start();
        }
        void run();
    private:
        tpport_t port;
};
class DepositServer:public Server{
    public:
        DepositServer(){
            this->port=Server::deposit_port;
	    start();
        }
        void run();
    private:
        tpport_t port;
};
#endif
//////////////////////////////////////////////////////////////////////////////////////////
char* Server::host;
tpport_t Server::withdraw_port;
tpport_t Server::deposit_port;
Server* Server::withdraw;
Server* Server::deposit;

void WithdrawServer::run(){
    if(!Server::host)return;
    addr=new InetAddress(Server::host);
    sock=new TCPSocket(*addr,port);
    while(true){
        if(sock->isPendingConnection()){
            cout << "W Connected" << endl;
            new WithdrawThread(*sock);
            cout << "Added to list" << endl;
            yield();
        }
    }
}
void DepositServer::run(){
    if(!Server::host)return;
    addr=new InetAddress(Server::host);
    sock=new TCPSocket(*addr,port);
    while(true){
        if(sock->isPendingConnection()){
            cout << "D Connected" << endl;
            new DepositThread(*sock);
            yield();
        }
    }
}




From MAILER-DAEMON Tue Apr 15 09:57:05 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 195QvI-00083P-00
	for mharc-bug-commoncpp@gnu.org; Tue, 15 Apr 2003 09:56:32 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 195QvG-0007zR-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 09:56:30 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 195Qv3-0007YL-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 09:56:19 -0400
Received: from mail.via.net ([209.81.9.12])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 195Qum-0007Et-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 09:56:00 -0400
Received: from ostel.com (pool-138-89-34-217.mad.east.verizon.net
	[138.89.34.217])
	by mail.via.net (8.12.8/8.12.7) with ESMTP id h3FDtGEx030476;
	Tue, 15 Apr 2003 06:55:16 -0700 (PDT)	(envelope-from dyfet@ostel.com)
Message-ID: <3E9C0F65.1080708@ostel.com>
Date: Tue, 15 Apr 2003 09:55:49 -0400
From: David Sugar <dyfet@ostel.com>
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
	rv:1.3) Gecko/20030312
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Jon <jdw100@ecs.soton.ac.uk>
References: <200304151405.39277.jdw100@ecs.soton.ac.uk>
In-Reply-To: <200304151405.39277.jdw100@ecs.soton.ac.uk>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
cc: bug-commoncpp@gnu.org
Subject: Re: Pure Virtual Method call problem. (Bug in library?)
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 15 Apr 2003 13:56:31 -0000

The C++ standard does not permit virtual methods to be called from 
constructors or destructors.  In many cases older compilers had ignored 
this, since often the virtual table is populated anyway before the 
constructor is called, but that is implimentation specific behavior and 
should not be relied upon.  Hence, things that can invoke virtuals 
cannot be specified in constructors or destructors either.

Jon wrote:

>I keep getting a runtime error when using the following code. As you can see, 
>both of the derived classes have their own run() method, however, the base 
>class defines this method as virtual and required for all subclasses. The 
>problem occurs when start() is called in the constructor of the derived 
>class. I get a pure virtual method call runtime exception and the program 
>dies. This is compiling under gcc3.2 in Linux, however, in windows MingW with 
>gcc3.2 everything is fine!!! Since I have no compiler directives and the same 
>compiler on each system, I cannot see what could be the problem.
>
>Is this a difference in the port of gcc? Or is it caused by the library 
>calling run() from the start() method call? I am using 1.0.9 without 
>modification on Linux, however, I had to comment HAVE_OLD_IOSTREAM on 
>windows.
>
>I can provide the full source code if necessary
>
>
>#ifndef SERVER_H
>#define SERVER_H
>#include "thread.h"
>#include <cc++/thread.h>
>#include <cc++/socket.h>
>#include <list>
>#define DEFAULT_WITHDRAW_PORT 1234
>#define DEFAULT_DEPOSIT_PORT 5678
>using namespace std;
>using namespace ost;
>class Server:public Thread{
>    public:
>        Server(){
>                cout << "SERVER" << endl;
>                setCancel(Thread::cancelImmediate);
>        }
>        ~Server(){
>                cout << "~SERVER" << endl;
>                terminate();
>                delete sock;
>                delete addr;
>        }
>        virtual void run()=0;
>        static void setHost(char* host){
>            Server::host=host;
>        };
>        static void setPorts(int withdraw,int deposit){
>            withdraw_port=withdraw;
>            deposit_port=deposit;
>        }
>        static Server* withdraw;
>        static Server* deposit;
>    protected:
>        InetAddress* addr;
>        static char* host;
>        static tpport_t withdraw_port;
>        static tpport_t deposit_port;
>        TCPSocket* sock;
>};
>class WithdrawServer:public Server{
>    public:
>        WithdrawServer(){
>            this->port=Server::withdraw_port;
>	    start();
>        }
>        void run();
>    private:
>        tpport_t port;
>};
>class DepositServer:public Server{
>    public:
>        DepositServer(){
>            this->port=Server::deposit_port;
>	    start();
>        }
>        void run();
>    private:
>        tpport_t port;
>};
>#endif
>//////////////////////////////////////////////////////////////////////////////////////////
>char* Server::host;
>tpport_t Server::withdraw_port;
>tpport_t Server::deposit_port;
>Server* Server::withdraw;
>Server* Server::deposit;
>
>void WithdrawServer::run(){
>    if(!Server::host)return;
>    addr=new InetAddress(Server::host);
>    sock=new TCPSocket(*addr,port);
>    while(true){
>        if(sock->isPendingConnection()){
>            cout << "W Connected" << endl;
>            new WithdrawThread(*sock);
>            cout << "Added to list" << endl;
>            yield();
>        }
>    }
>}
>void DepositServer::run(){
>    if(!Server::host)return;
>    addr=new InetAddress(Server::host);
>    sock=new TCPSocket(*addr,port);
>    while(true){
>        if(sock->isPendingConnection()){
>            cout << "D Connected" << endl;
>            new DepositThread(*sock);
>            yield();
>        }
>    }
>}
>
>
>
>_______________________________________________
>Bug-commoncpp mailing list
>Bug-commoncpp@gnu.org
>http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>  
>





From MAILER-DAEMON Tue Apr 15 10:16:40 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 195REW-0003mf-00
	for mharc-bug-commoncpp@gnu.org; Tue, 15 Apr 2003 10:16:24 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 195REM-0003Af-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 10:16:14 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 195REB-0002ps-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 10:16:04 -0400
Received: from viefep13-int.chello.at ([213.46.255.15])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 195RDv-0002Rr-00
	for bug-commoncpp@gnu.org; Tue, 15 Apr 2003 10:15:48 -0400
Received: from dev1xp ([80.109.135.71]) by viefep13-int.chello.at
          (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with SMTP
          id <20030415141546.SOVI29131.viefep13-int.chello.at@dev1xp>;
          Tue, 15 Apr 2003 16:15:46 +0200
From: "klaus triendl" <triendl.kj@aon.at>
To: "Dimitar Dimitrov" <dimitar@yucom.be>
Date: Tue, 15 Apr 2003 16:15:45 +0200
Message-ID: <MNENKPHMOOKIHGCMGMEBAEAKCDAA.triendl.kj@aon.at>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="windows-1251"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <200304150350.24902.dimitar@yucom.be>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
cc: bug-commoncpp@gnu.org
Subject: RE: change of socketport constructor
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 15 Apr 2003 14:16:22 -0000

> Behalf Of Dimitar Dimitrov
> Sent: Tuesday, April 15, 2003 3:50 AM
> checked again in that "goto" loop. I don't know... may be a bool
> result will
> be good enough. expired() returns true and that's it, it really
> expired.. end

ok


> BTW, isn't it better if expired() is moved to TimePort interface.

to be discussed



> Some other remarks. They concern more Win32 implementation with
> which I played
> some time ago, so I may have forgotten something.
>
> For example something that becomes obvious very fast is the difference in
> semantic of the SocketService::Sync class and the pipe used in non-Win32
> implementation. The thing is that SocketService::Sync object has
> a place to
> hold only one byte. What happens at the end of ~SocketService().
> If there is
> no thread anymore (after update(0) and terminate() the thread
> should be gone)
> to read the flag from the Sync instance and to release the
> semaphore then the
> attempt to delete the next port object
>
> while(first)
> 	delete first;
>
> will block because destructor of the port tries to call update()
> and that one
> blocks on the semaphore. Not to mention that the Sync object is already
> gone!!! BTW, the non-Win32 implementation doesn't look more correct, but
> there at least I can write to the pipe and my thread will not
> block. It also
> will not hurt if the pipe descriptors are closed at the end.

this is right and another thing with selfdeleting socketports also in
expired().. several calls to SocketService::update block (at least in
win32)!
also setTimer() (e.g. used in the example in ResetReadTimeout()) does not
need to update the SocketService because the timer is typically set in one
of the event methods and SocketService checks the timer after the event is
processed. i suggest to take out the parts of the code of SocketPort which
control the SocketService (setTimer(), ~SocketPort() ..) and that expired()
returns a bool whether the SocketPort deleted itself (as i did already).
as the SocketService controls the SocketPort and the two classes don't act
asynchronously this shouldn't be a problem, i think.



so, after all, what i would do for the patch is:
change ``SocketPort::SocketPort()" not to accept a service anymore;
change ``void SocketPort::expired()" in ``bool SocketPort::expired()";
don't proceed with ``retry:" and don't put the port into the event array if
expired() returns true
SocketService::~SocketService sets SocketPort::service = NULL before
deleting SocketPort
change SocketService::detach() not to update the service (is detaching and
attaching to another service ever needed?)
SocketPort::setTimer()+incTimer() don't update the service anymore
what about setDetectXXX()? should they still update the service?


opinions?


klaus




From MAILER-DAEMON Fri Apr 18 12:34:52 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 196YoX-0004O1-00
	for mharc-bug-commoncpp@gnu.org; Fri, 18 Apr 2003 12:34:13 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 196YnQ-000313-00
	for bug-commoncpp@gnu.org; Fri, 18 Apr 2003 12:33:04 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 196Yn2-0002SZ-00
	for bug-commoncpp@gnu.org; Fri, 18 Apr 2003 12:32:40 -0400
Received: from viefep14-int.chello.at ([213.46.255.13])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 196Ymj-00020k-00
	for bug-commoncpp@gnu.org; Fri, 18 Apr 2003 12:32:21 -0400
Received: from dev1xp ([80.109.135.71]) by viefep14-int.chello.at
          (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with SMTP
          id <20030418163219.ZLXE11943.viefep14-int.chello.at@dev1xp>;
          Fri, 18 Apr 2003 18:32:19 +0200
From: "klaus triendl" <triendl.kj@aon.at>
To: "Dimitar Dimitrov" <dimitar@yucom.be>
Date: Fri, 18 Apr 2003 18:32:18 +0200
Message-ID: <MNENKPHMOOKIHGCMGMEBGEBACDAA.triendl.kj@aon.at>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0005_01C305D8.D7659760"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Importance: Normal
In-Reply-To: <MNENKPHMOOKIHGCMGMEBAEAKCDAA.triendl.kj@aon.at>
cc: bug-commoncpp@gnu.org
Subject: RE: change of socketport constructor
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Fri, 18 Apr 2003 16:34:11 -0000

This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C305D8.D7659760
Content-Type: text/plain;
	charset="windows-1251"
Content-Transfer-Encoding: 7bit

now, here is the patch (against the commoncpp2-1.0.9 release, hope this is
ok);
apply it in the root of commoncpp2 with ``patch -p1 < ccgnu2.diff"; only
``include/cc++/socket.h" and ``src/port.cpp" are patched;


what it does:

change ``SocketPort::SocketPort()" not to accept a service anymore;
change ``void SocketPort::expired()" in ``bool SocketPort::expired()";
don't proceed with ``retry:" and don't put the port into the event array if
expired() returns true
SocketService::~SocketService iterates the socketports itself and sets
SocketPort::service = NULL before deleting SocketPort in order to prevent
updating the SocketService
change SocketService::detach() not to update the service
SocketPort::setTimer()+incTimer() don't update the service anymore
adds SocketPort::detach() to be able to detach from the SocketService in
e.g. expired() (i need this because the data processing is threaded because
it could take a long time, so it is possible that the socket expires and is
closed before the data processing finishes)

------=_NextPart_000_0005_01C305D8.D7659760
Content-Type: application/octet-stream;
	name="ccgnu2.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="ccgnu2.diff"

diff -a -u -r 2/include/cc++/socket.h 3/include/cc++/socket.h=0A=
--- 2/include/cc++/socket.h	2003-04-18 08:53:31.000000000 -0700=0A=
+++ 3/include/cc++/socket.h	2003-04-18 08:53:51.000000000 -0700=0A=
@@ -1878,21 +1878,21 @@=0A=
 	 * Construct an accepted TCP socket connection from a specific=0A=
 	 * bound TCP server.  This is meant to derive advanced application=0A=
 	 * specific TCP servers that can be thread pooled.=0A=
+	 * Now, derived class must attach itself to its svc pool thread object=0A=
 	 *=0A=
-	 * @param svc pool thread object.=0A=
 	 * @param tcp socket object to accept.=0A=
 	 */=0A=
-	SocketPort(SocketService *svc, TCPSocket &tcp);=0A=
+	SocketPort(TCPSocket &tcp);=0A=
 =0A=
 	/**=0A=
 	 * Construct a bound UDP socket for use in deriving realtime=0A=
 	 * UDP streaming protocols handled by thread pool objects.=0A=
+	 * Now, derived class must attach itself to its svc pool thread object=0A=
 	 *=0A=
-	 * @param svc pool thread object.=0A=
 	 * @param ia address of interface to bind.=0A=
 	 * @param port number to bind to.=0A=
 	 */=0A=
-	SocketPort(SocketService *svc, const InetAddress &ia, tpport_t port);=0A=
+	SocketPort(const InetAddress &ia, tpport_t port);=0A=
 =0A=
 	/**=0A=
 	 * A non-blocking constructor for outbound tcp connections.=0A=
@@ -1902,20 +1902,24 @@=0A=
 	 * SocketPort::disconnect() when the connect failed.  at the=0A=
 	 * moment you should set the socket state to "CONNECTED" when=0A=
 	 * SocketPort::output() get's called for the first time.=0A=
+	 * Now, derived class must attach itself to its svc pool thread object=0A=
 	 *=0A=
-	 * @param svc pool thread object.=0A=
 	 * @param ih addess to connect to.=0A=
 	 * @param port number to connect to.=0A=
 	 **/=0A=
-	SocketPort(SocketService *svc, const InetHostAddress &ih, tpport_t =
port);=0A=
+	SocketPort(const InetHostAddress &ih, tpport_t port);=0A=
 =0A=
 	/** =0A=
 	 * Attach yourself to the service pool thread object. The later =
version.=0A=
 	 *=0A=
 	 * @param svc pool thread object =0A=
 	 */	 =0A=
-	 void attach( SocketService* svc );=0A=
+	void attach( SocketService* svc );=0A=
 =0A=
+	/** =0A=
+	 * Detach yourself from the service pool thread object.=0A=
+	 */=0A=
+	void detach();=0A=
 =0A=
 	/**=0A=
 	 * Disconnect the socket from the service thread pool and=0A=
@@ -1950,9 +1954,10 @@=0A=
 	/**=0A=
 	 * Called by the service thread pool when the objects timer=0A=
 	 * has expired.  Used for timed events.=0A=
+	 * @return whether object deleted itself or not=0A=
 	 */=0A=
-	virtual void expired(void)=0A=
-		{return;};=0A=
+	virtual bool expired(void)=0A=
+		{return false;};=0A=
 =0A=
 	/**=0A=
 	 * Called by the service thread pool when input data is pending=0A=
diff -a -u -r 2/src/port.cpp 3/src/port.cpp=0A=
--- 2/src/port.cpp	2003-04-18 08:53:20.000000000 -0700=0A=
+++ 3/src/port.cpp	2003-04-18 08:53:47.000000000 -0700=0A=
@@ -179,7 +179,7 @@=0A=
 }=0A=
 #endif=0A=
 =0A=
-SocketPort::SocketPort(SocketService *svc, TCPSocket &tcp) :=0A=
+SocketPort::SocketPort(TCPSocket &tcp) :=0A=
 	Socket(accept(tcp.so, NULL, NULL)),=0A=
 	detect_pending(true),=0A=
 	detect_output(false),=0A=
@@ -198,14 +198,10 @@=0A=
 #else=0A=
 	if(so !=3D INVALID_SOCKET)=0A=
 #endif=0A=
-	{=0A=
 		setError(false);=0A=
-		if(svc)=0A=
-			svc->attach(this);=0A=
-	}=0A=
 }=0A=
 =0A=
-SocketPort::SocketPort(SocketService *svc, const InetAddress &ia, =0A=
+SocketPort::SocketPort(const InetAddress &ia, =0A=
 		       tpport_t port) :=0A=
 Socket(AF_INET, SOCK_DGRAM, 0)=0A=
 {=0A=
@@ -229,11 +225,9 @@=0A=
 	}=0A=
 	state =3D BOUND;=0A=
 	setError(false);=0A=
-	if(svc)=0A=
-		svc->attach(this);=0A=
 }=0A=
 =0A=
-SocketPort::SocketPort(SocketService *svc, const InetHostAddress &ih, =0A=
+SocketPort::SocketPort(const InetHostAddress &ih, =0A=
 		       tpport_t port) :=0A=
 Socket(AF_INET, SOCK_STREAM, 0)=0A=
 {=0A=
@@ -290,8 +284,6 @@=0A=
 #endif=0A=
 =0A=
 	setError(false);=0A=
-	if(svc)=0A=
-		svc->attach(this);=0A=
         if(state =3D=3D CONNECTING)=0A=
                 setDetectOutput(true);=0A=
 }=0A=
@@ -316,6 +308,13 @@=0A=
 		svc->attach(this);=0A=
 }=0A=
 =0A=
+void SocketPort::detach()=0A=
+{=0A=
+	if (service)=0A=
+		service->detach(this);=0A=
+	service =3D NULL;=0A=
+}=0A=
+=0A=
 Socket::Error SocketPort::connect(const InetAddress &ia, tpport_t port)=0A=
 {=0A=
 	struct sockaddr_in addr;=0A=
@@ -348,15 +347,21 @@=0A=
 void SocketPort::setTimer(timeout_t ptimer)=0A=
 {=0A=
 	TimerPort::setTimer(ptimer);=0A=
-	if(service)=0A=
-		service->update();=0A=
+	// dangerous because multiple calls to update block in win32=0A=
+	// and not needed because the timer is typically set in a synchronous=0A=
+	// event handling=0A=
+	//if(service)=0A=
+	//	service->update();=0A=
 }=0A=
 =0A=
 void SocketPort::incTimer(timeout_t ptimer)=0A=
 {=0A=
 	TimerPort::incTimer(ptimer);=0A=
-	if(service)=0A=
-		service->update();=0A=
+	// dangerous because multiple calls to update block in win32=0A=
+	// and not needed because the timer is typically set in a synchronous=0A=
+	// event handling=0A=
+	//if(service)=0A=
+	//	service->update();=0A=
 }=0A=
 =0A=
 void SocketPort::setDetectPending( bool val )=0A=
@@ -469,8 +474,13 @@=0A=
 =0A=
 	terminate();=0A=
 =0A=
-	while(first)=0A=
-		delete first;=0A=
+	SocketPort* p;=0A=
+	while(p =3D first)=0A=
+	{=0A=
+		first =3D p->next;=0A=
+		p->service =3D NULL; // prevent socketport from updating service=0A=
+		delete p;=0A=
+	}=0A=
 }=0A=
 =0A=
 void SocketService::attach(SocketPort *port)=0A=
@@ -529,7 +539,10 @@=0A=
 	=0A=
 	--count;=0A=
 	leaveMutex();=0A=
-	update();=0A=
+	// removed because dangerous, e.g. consider the following:=0A=
+	// multiple self-deleting socketports are deleted in expired() - the =
2nd call=0A=
+	// to update() would block in win32=0A=
+	//update();=0A=
 }=0A=
 =0A=
 =0A=
@@ -624,8 +637,10 @@=0A=
 		MUTEX_START=0A=
 		onEvent();=0A=
 		port =3D first;=0A=
+		SocketPort* portnext;=0A=
 		while(port)=0A=
 		{=0A=
+			portnext =3D port->next;=0A=
 			onCallback(port);=0A=
 			if ( ( p_ufd =3D port->ufd ) ) {=0A=
 =0A=
@@ -662,11 +677,11 @@=0A=
 			if(!expires)=0A=
 			{=0A=
 				port->endTimer();=0A=
-				port->expired();=0A=
-				goto retry;=0A=
+				if (!port->expired())=0A=
+					goto retry;=0A=
 			}=0A=
 =0A=
-			port =3D port->next;=0A=
+			port =3D portnext;=0A=
 		}=0A=
 =0A=
 		//=0A=
@@ -702,15 +717,17 @@=0A=
 		MUTEX_START=0A=
 		onEvent();=0A=
 		port =3D first;=0A=
+		SocketPort* portnext;=0A=
 		while(port)=0A=
 		{=0A=
+			portnext =3D port->next;=0A=
 			onCallback(port);=0A=
 			so =3D port->so;=0A=
 			if(FD_ISSET(so, &err)) {=0A=
 				port->detect_disconnect =3D false;=0A=
 				=0A=
 				SocketPort* p =3D port;=0A=
-				port =3D port->next;=0A=
+				port =3D portnext;=0A=
 				p->disconnect();=0A=
 				continue;=0A=
 			}=0A=
@@ -732,11 +749,11 @@=0A=
 			if(!expires)=0A=
 			{=0A=
 				port->endTimer();=0A=
-				port->expired();=0A=
-				goto retry;=0A=
+				if (!port->expired())=0A=
+					goto retry;=0A=
 			}=0A=
 =0A=
-			port =3D port->next;=0A=
+			port =3D portnext;=0A=
 		}=0A=
 =0A=
 		FD_ZERO(&inp);=0A=
@@ -777,28 +794,14 @@=0A=
 		hv[0] =3D sync->GetSync();=0A=
 		numHandle =3D 1;=0A=
 		port =3D first;=0A=
+		SocketPort* portnext;=0A=
+		bool bDeleted;=0A=
 		while(port)=0A=
 		{=0A=
+			portnext =3D port->next;=0A=
+			bDeleted =3D false;=0A=
 			onCallback(port);=0A=
 =0A=
-			long events =3D 0;=0A=
-=0A=
-			if(port->detect_pending)=0A=
-				events |=3D FD_READ;=0A=
-=0A=
-			if(port->detect_output)=0A=
-				events |=3D FD_WRITE;=0A=
-=0A=
-			if(port->detect_disconnect)=0A=
-				events |=3D FD_CLOSE;=0A=
-=0A=
-			// !!! ignore some socket on overflow !!!=0A=
-			if (events && numHandle < MAXIMUM_WAIT_OBJECTS)=0A=
-			{=0A=
-				WSAEventSelect(port->so,port->event,events);=0A=
-				hv[numHandle++] =3D port->event;=0A=
-			}=0A=
-=0A=
 retry:=0A=
 			expires =3D port->getTimer();=0A=
 			if(expires > 0)=0A=
@@ -810,11 +813,32 @@=0A=
 			if(!expires)=0A=
 			{=0A=
 				port->endTimer();=0A=
-				port->expired();=0A=
-				goto retry;=0A=
+				bDeleted =3D port->expired();=0A=
+				if (!bDeleted)=0A=
+					goto retry;=0A=
 			}=0A=
 =0A=
-			port =3D port->next;=0A=
+			if (!bDeleted)=0A=
+			{=0A=
+				long events =3D 0;=0A=
+=0A=
+				if(port->detect_pending)=0A=
+					events |=3D FD_READ;=0A=
+=0A=
+				if(port->detect_output)=0A=
+					events |=3D FD_WRITE;=0A=
+=0A=
+				if(port->detect_disconnect)=0A=
+					events |=3D FD_CLOSE;=0A=
+=0A=
+				// !!! ignore some socket on overflow !!!=0A=
+				if (events && numHandle < MAXIMUM_WAIT_OBJECTS)=0A=
+				{=0A=
+					WSAEventSelect(port->so,port->event,events);=0A=
+					hv[numHandle++] =3D port->event;=0A=
+				}=0A=
+			}=0A=
+			port =3D portnext;=0A=
 		}=0A=
 		=0A=
 		MUTEX_END=0A=

------=_NextPart_000_0005_01C305D8.D7659760--




From MAILER-DAEMON Fri Apr 18 14:31:40 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 196adT-0006OO-00
	for mharc-bug-commoncpp@gnu.org; Fri, 18 Apr 2003 14:30:55 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 195u45-0001p1-00
	for bug-commoncpp@gnu.org; Wed, 16 Apr 2003 17:03:33 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 195u42-0001jp-00
	for bug-commoncpp@gnu.org; Wed, 16 Apr 2003 17:03:31 -0400
Received: from f123.law11.hotmail.com ([64.4.17.123] helo=hotmail.com)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 195u3v-0001P1-00
	for bug-commoncpp@gnu.org; Wed, 16 Apr 2003 17:03:24 -0400
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
	 Wed, 16 Apr 2003 14:03:21 -0700
Received: from 209.98.189.153 by lw11fd.law11.hotmail.msn.com with HTTP;
	Wed, 16 Apr 2003 21:03:21 GMT
X-Originating-IP: [209.98.189.153]
X-Originating-Email: [brandonb_visi@hotmail.com]
From: "Brandon B" <brandonb_visi@hotmail.com>
To: bug-commoncpp@gnu.org
Bcc: 
Date: Wed, 16 Apr 2003 16:03:21 -0500
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
Message-ID: <Law11-F123IDT8zAJ950000cdf9@hotmail.com>
X-OriginalArrivalTime: 16 Apr 2003 21:03:21.0516 (UTC)
	FILETIME=[9CC46EC0:01C3045B]
X-Mailman-Approved-At: Fri, 18 Apr 2003 14:30:53 -0400
Subject: bug in sockets getSender() commoncpp2-1.0.9
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Wed, 16 Apr 2003 21:03:45 -0000

The sockets->getSender() function is peeking the incoming packet with a max 
length of 1 byte. This causes any packet over 1 byte to get an error, which 
wipes out the senders ip/port.

I think a better way to approach this is to have the return value be 
ignored.  Instead, check the last length parameter of the recvfrom to see if 
there was a valid sender address passed back, if that is 0, wipe out the 
senders ip/port otherwise return it.

This is the way I worked around the issue.

InetHostAddress Socket::getSender(tpport_t *port) const
{

	struct sockaddr_in from;
	char buf;
	socklen_t len = sizeof(from);

	int rc = ::recvfrom(so, &buf, 1, MSG_PEEK,
			    (struct sockaddr *)&from, &len);

  if(len > 0)
  {
    *port = ntohs(from.sin_port);
  }
  else
  {
    *port = 0;
    memset(&from.sin_addr, 0, sizeof(from.sin_addr));
  }

	return InetHostAddress(from.sin_addr);
}

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail




From MAILER-DAEMON Fri Apr 18 14:32:10 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 196adT-0006OM-00
	for mharc-bug-commoncpp@gnu.org; Fri, 18 Apr 2003 14:30:55 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 195tCD-00062v-00
	for bug-commoncpp@gnu.org; Wed, 16 Apr 2003 16:07:53 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 195tBw-0005Sq-00
	for bug-commoncpp@gnu.org; Wed, 16 Apr 2003 16:07:37 -0400
Received: from tmailb1.svr.pol.co.uk ([195.92.168.141])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 195tB8-0004kU-00
	for bug-commoncpp@gnu.org; Wed, 16 Apr 2003 16:06:46 -0400
Received: from modem-3324.llama.dialup.pol.co.uk ([217.135.188.252]
	helo=ecs.soton.ac.uk)	by tmailb1.svr.pol.co.uk with esmtp (Exim 4.14)
	id 195tAw-0006RQ-Fk; Wed, 16 Apr 2003 21:06:35 +0100
Message-ID: <3E9DB7CA.5010607@ecs.soton.ac.uk>
Date: Wed, 16 Apr 2003 21:06:34 +0100
From: Jon Wilson <jdw100@ecs.soton.ac.uk>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: David Sugar <dyfet@ostel.com>
References: <200304151405.39277.jdw100@ecs.soton.ac.uk>
	<3E9C0F65.1080708@ostel.com>
In-Reply-To: <3E9C0F65.1080708@ostel.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Mailman-Approved-At: Fri, 18 Apr 2003 14:30:53 -0400
cc: bug-commoncpp@gnu.org
Subject: Re: Pure Virtual Method call problem. (Bug in library?)
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Wed, 16 Apr 2003 20:08:07 -0000

Many thanks for your help. I will look into a work around. Just seemed 
odd that the same compiler should work Ok on one platform, but not another.
Jon Wilson

David Sugar wrote:

> The C++ standard does not permit virtual methods to be called from 
> constructors or destructors.  In many cases older compilers had 
> ignored this, since often the virtual table is populated anyway before 
> the constructor is called, but that is implimentation specific 
> behavior and should not be relied upon.  Hence, things that can invoke 
> virtuals cannot be specified in constructors or destructors either.
>
> Jon wrote:
>
>> I keep getting a runtime error when using the following code. As you 
>> can see, both of the derived classes have their own run() method, 
>> however, the base class defines this method as virtual and required 
>> for all subclasses. The problem occurs when start() is called in the 
>> constructor of the derived class. I get a pure virtual method call 
>> runtime exception and the program dies. This is compiling under 
>> gcc3.2 in Linux, however, in windows MingW with gcc3.2 everything is 
>> fine!!! Since I have no compiler directives and the same compiler on 
>> each system, I cannot see what could be the problem.
>>
>> Is this a difference in the port of gcc? Or is it caused by the 
>> library calling run() from the start() method call? I am using 1.0.9 
>> without modification on Linux, however, I had to comment 
>> HAVE_OLD_IOSTREAM on windows.
>>
>> I can provide the full source code if necessary
>>
>>
>> #ifndef SERVER_H
>> #define SERVER_H
>> #include "thread.h"
>> #include <cc++/thread.h>
>> #include <cc++/socket.h>
>> #include <list>
>> #define DEFAULT_WITHDRAW_PORT 1234
>> #define DEFAULT_DEPOSIT_PORT 5678
>> using namespace std;
>> using namespace ost;
>> class Server:public Thread{
>>    public:
>>        Server(){
>>                cout << "SERVER" << endl;
>>                setCancel(Thread::cancelImmediate);
>>        }
>>        ~Server(){
>>                cout << "~SERVER" << endl;
>>                terminate();
>>                delete sock;
>>                delete addr;
>>        }
>>        virtual void run()=0;
>>        static void setHost(char* host){
>>            Server::host=host;
>>        };
>>        static void setPorts(int withdraw,int deposit){
>>            withdraw_port=withdraw;
>>            deposit_port=deposit;
>>        }
>>        static Server* withdraw;
>>        static Server* deposit;
>>    protected:
>>        InetAddress* addr;
>>        static char* host;
>>        static tpport_t withdraw_port;
>>        static tpport_t deposit_port;
>>        TCPSocket* sock;
>> };
>> class WithdrawServer:public Server{
>>    public:
>>        WithdrawServer(){
>>            this->port=Server::withdraw_port;
>>         start();
>>        }
>>        void run();
>>    private:
>>        tpport_t port;
>> };
>> class DepositServer:public Server{
>>    public:
>>        DepositServer(){
>>            this->port=Server::deposit_port;
>>         start();
>>        }
>>        void run();
>>    private:
>>        tpport_t port;
>> };
>> #endif
>> //////////////////////////////////////////////////////////////////////////////////////////
>> char* Server::host;
>> tpport_t Server::withdraw_port;
>> tpport_t Server::deposit_port;
>> Server* Server::withdraw;
>> Server* Server::deposit;
>>
>> void WithdrawServer::run(){
>>    if(!Server::host)return;
>>    addr=new InetAddress(Server::host);
>>    sock=new TCPSocket(*addr,port);
>>    while(true){
>>        if(sock->isPendingConnection()){
>>            cout << "W Connected" << endl;
>>            new WithdrawThread(*sock);
>>            cout << "Added to list" << endl;
>>            yield();
>>        }
>>    }
>> }
>> void DepositServer::run(){
>>    if(!Server::host)return;
>>    addr=new InetAddress(Server::host);
>>    sock=new TCPSocket(*addr,port);
>>    while(true){
>>        if(sock->isPendingConnection()){
>>            cout << "D Connected" << endl;
>>            new DepositThread(*sock);
>>            yield();
>>        }
>>    }
>> }
>>
>>
>>
>> _______________________________________________
>> Bug-commoncpp mailing list
>> Bug-commoncpp@gnu.org
>> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>>  
>>
>
>
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>





From MAILER-DAEMON Sat Apr 19 08:07:53 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 196r6M-00021g-00
	for mharc-bug-commoncpp@gnu.org; Sat, 19 Apr 2003 08:05:50 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 196jgE-0006na-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 00:10:22 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 196jgB-0006kq-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 00:10:21 -0400
Received: from cpe-203-51-25-200.nsw.bigpond.net.au ([203.51.25.200]
	helo=purcell.homeip.net)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 196jg5-00065h-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 00:10:15 -0400
Received: from [192.168.2.128] (helo=htpc.purcell.homeip.net ident=msp)
	by purcell.homeip.net with esmtp (Exim 3.35 #1 (Debian))
	id 196jfm-00029O-00; Sat, 19 Apr 2003 14:09:54 +1000
From: Mark Purcell <msp@debian.org>
To: bug-commoncpp@gnu.org
Date: Sat, 19 Apr 2003 14:09:20 +1000
User-Agent: KMail/1.5.1
MIME-Version: 1.0
Content-Type: Multipart/Mixed;
  boundary="Boundary-00=_xvMo+3HLgq/CjiT"
Message-Id: <200304191409.30776.msp@debian.org>
X-Mailman-Approved-At: Sat, 19 Apr 2003 08:05:49 -0400
cc: 188881-forwarded@bugs.debian.org
cc: glcpu@packages.debian.org
Subject: Fwd: Bug#188881: libcommoncpp2: libccgnu2.so is unusable (won't link)
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: 188881@bugs.debian.org
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sat, 19 Apr 2003 04:10:22 -0000


--Boundary-00=_xvMo+3HLgq/CjiT
Content-Type: Text/Plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Description: clearsigned data
Content-Disposition: inline

=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David, (and others on bug-commoncpp)

I have found it necessary to rebuild the libtool chain for commoncpp2 to=20
ensure it's correct linking for the hppa architecture. You might also like =
to=20
rebuild your libtool chain in the upstream source for the next release of=20
commoncpp2.

The commoncpp2 build on hppa log is available here:
http://buildd.debian.org/build.php?&pkg=3Dlibcommoncpp2&ver=3D1.0.7-4&arch=
=3Dhppa

The glcpu build on hppa log is available here:
http://buildd.debian.org/fetch.php?&pkg=3Dglcpu&ver=3D1.0.1-3&arch=3Dhppa&s=
tamp=3D1049594883&file=3Dlog&as=3Draw

The complete diff of changes to get commoncpp2 building across the Debian=20
GNU/Linux architectures is available here:
http://packages.debian.org/unstable/libdevel/libcommoncpp2-dev.html

Mark
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+oMv3oCzanz0IthIRAt6TAJ4zrW4snW+eESj/RDL4RxoDOTQJwQCfcFB7
poMtw1sX8twV7wAyhCXL5SU=3D
=3DoJcF
=2D----END PGP SIGNATURE-----

--Boundary-00=_xvMo+3HLgq/CjiT
Content-Type: message/rfc822;
  name="forwarded message"
Content-Transfer-Encoding: 8bit
Content-Description: LaMont Jones <lamont@hp.com>: Bug#188881: libcommoncpp2:
	libccgnu2.so is unusable (won't link)

Envelope-to: debian@purcell.homeip.net
Received: from mail by purcell.homeip.net with spam-scanned (Exim 3.35 #1
	(Debian))	id 194muZ-00086I-00
	for <debian@purcell.homeip.net>; Mon, 14 Apr 2003 05:13:32 +1000
Received: from [65.125.64.135] (helo=master.debian.org ident=mail)
	by purcell.homeip.net with esmtp (Exim 3.35 #1 (Debian))
	id 194muX-00086D-00
	for <debian@purcell.homeip.net>; Mon, 14 Apr 2003 05:13:06 +1000
Received: from debbugs by master.debian.org with local (Exim 3.12 1 (Debian))
	id 194mkq-00043V-00; Sun, 13 Apr 2003 14:03:04 -0500
X-Loop: owner@bugs.debian.org
Subject: Bug#188881: libcommoncpp2: libccgnu2.so is unusable (won't link)
Reply-To: LaMont Jones <lamont@hp.com>,
 188881@bugs.debian.org
Resent-From: LaMont Jones <lamont@hp.com>
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: Mark Purcell <msp@debian.org>,
 libcommoncpp2@packages.qa.debian.org
Resent-Date: Sun, 13 Apr 2003 19:03:02 GMT
Resent-Message-ID: <handler.188881.B.10502597549961@bugs.debian.org>
X-Debian-PR-Message: report 188881
X-Debian-PR-Package: libcommoncpp2
X-Debian-PR-Keywords: 
Received: via spool by submit@bugs.debian.org id=B.10502597549961
          (code B ref -1); Sun, 13 Apr 2003 19:03:02 GMT
Received: (at submit) by bugs.debian.org; 13 Apr 2003 18:49:14 +0000
Received: from atlrel6.hp.com [156.153.255.205] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 194mXR-0002aO-00; Sun, 13 Apr 2003 13:49:13 -0500
Received: from security.hp.com (security.hp.com [15.238.4.200])
	by atlrel6.hp.com (Postfix) with ESMTP id 6E4FC1C01023
	for <submit@bugs.debian.org>; Sun, 13 Apr 2003 14:49:13 -0400 (EDT)
Received: by security.hp.com (Postfix, from userid 1000)
	id 21FBEB18E4; Sun, 13 Apr 2003 12:49:13 -0600 (MDT)
From: LaMont Jones <lamont@hp.com>
To: submit@bugs.debian.org
X-Mailer: bug 3.3.10.1
Message-Id: <20030413184913.21FBEB18E4@security.hp.com>
Date: Sun, 13 Apr 2003 12:49:13 -0600 (MDT)
Delivered-To: submit@bugs.debian.org
Resent-Sender: Debian BTS <debbugs@master.debian.org>
X-Spam-Status: No, hits=-3.2 required=5.0
	tests=SENT_BY_BTS,FORGED_RCVD_FOUND,NO_MX_FOR_FROM
	version=2.30
X-Spam-Level: 
Content-Type: 
X-UID: 27063

Package: libcommoncpp2
Version: 1.0.7-4
Severity: serious

c++ apps must be linked with g++, not gcc.  rebuilding the libtool
stuff with a current libtool (sid) should be sufficient to fix this.

lamont

> /bin/sh ../libtool --mode=link c++  ... -o libccgnu2.la ..
> rm -fr .libs/libccgnu2.la .libs/libccgnu2.* .libs/libccgnu2-1.0.*
> gcc -shared ...

yields the following in glcpu's build:
> g++ main.o parser.o config.o -L/usr/X11R6/lib -lX11 -lXext -lXmu -L/usr/lib -lccgnu2 -ldl -pthread -lGL -lGLU -lglut -lpthread -o glcpu
> /usr/lib/libccgnu2.so: undefined reference to `__gxx_personality_v0'
> /usr/lib/libccgnu2.so: undefined reference to `_Unwind_Resume'
> collect2: ld returned 1 exit status

-- System Information
Debian Release: 3.0
Kernel Version: Linux security.hp.com 2.4.20-pa27 #2 Sat Mar 1 02:32:55 MST 2003 parisc64 unknown



--Boundary-00=_xvMo+3HLgq/CjiT--




From MAILER-DAEMON Sat Apr 19 16:02:44 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 196yXi-0001gt-00
	for mharc-bug-commoncpp@gnu.org; Sat, 19 Apr 2003 16:02:34 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 196yXR-00015z-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 16:02:17 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 196yXG-0000Uc-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 16:02:07 -0400
Received: from pool-138-89-34-217.mad.east.verizon.net ([138.89.34.217]
	helo=home.bayonne.dyndns.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 196yWz-0008KA-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 16:01:49 -0400
Received: from localhost (dyfet@localhost)
	by home.bayonne.dyndns.org (8.11.6/8.11.6) with ESMTP id h3JKnHW26933;
	Sat, 19 Apr 2003 16:49:17 -0400
X-Authentication-Warning: home.sys: dyfet owned process doing -bs
Date: Sat, 19 Apr 2003 16:49:17 -0400 (EDT)
From: David Sugar <dyfet@ostel.com>
X-X-Sender: dyfet@home.sys
To: 188881@bugs.debian.org
In-Reply-To: <200304191409.30776.msp@debian.org>
Message-ID: <Pine.LNX.4.44.0304191648200.26907-100000@home.sys>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
cc: 188881-forwarded@bugs.debian.org
cc: bug-commoncpp@gnu.org
cc: glcpu@packages.debian.org
Subject: Re: Fwd: Bug#188881: libcommoncpp2: libccgnu2.so is unusable (won't
 link)
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sat, 19 Apr 2003 20:02:32 -0000

Which version of libtool, autoconf, and automake do you recommend using?  
I can just update the build machine I use to the most correct/useful 
version...



On Sat, 19 Apr 2003, Mark Purcell wrote:

> --[PinePGP]--------------------------------------------------[begin]--
> David, (and others on bug-commoncpp)
> 
> I have found it necessary to rebuild the libtool chain for commoncpp2 to
> ensure it's correct linking for the hppa architecture. You might also like to
> rebuild your libtool chain in the upstream source for the next release of
> commoncpp2.
> 
> The commoncpp2 build on hppa log is available here:
> http://buildd.debian.org/build.php?&pkg=libcommoncpp2&ver=1.0.7-4&arch=hppa
> 
> The glcpu build on hppa log is available here:
> http://buildd.debian.org/fetch.php?&pkg=glcpu&ver=1.0.1-3&arch=hppa&stamp=1049594883&file=log&as=raw
> 
> The complete diff of changes to get commoncpp2 building across the Debian
> GNU/Linux architectures is available here:
> http://packages.debian.org/unstable/libdevel/libcommoncpp2-dev.html
> 
> Mark
> --[PinePGP]-----------------------------------------------------------
> gpg: Warning: using insecure memory!
> gpg: Signature made Sat 19 Apr 2003 12:09:27 AM EDT using DSA key ID 3D08B612
> gpg: Can't check signature: public key not found
> PinePGP: Encryption backend encountered error.
> --[PinePGP]----------------------------------------------------[end]--
> 




From MAILER-DAEMON Sat Apr 19 16:23:01 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 196yrV-0002H3-00
	for mharc-bug-commoncpp@gnu.org; Sat, 19 Apr 2003 16:23:01 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 196yrS-0002G5-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 16:22:58 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 196yrR-0002FS-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 16:22:58 -0400
Received: from pool-138-89-34-217.mad.east.verizon.net ([138.89.34.217]
	helo=home.bayonne.dyndns.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 196yqT-00023V-00
	for bug-commoncpp@gnu.org; Sat, 19 Apr 2003 16:21:57 -0400
Received: from localhost (dyfet@localhost)
	by home.bayonne.dyndns.org (8.11.6/8.11.6) with ESMTP id h3JL9Qv27051;
	Sat, 19 Apr 2003 17:09:26 -0400
X-Authentication-Warning: home.sys: dyfet owned process doing -bs
Date: Sat, 19 Apr 2003 17:09:26 -0400 (EDT)
From: David Sugar <dyfet@ostel.com>
X-X-Sender: dyfet@home.sys
To: Jon Wilson <jdw100@ecs.soton.ac.uk>
In-Reply-To: <3E9DB7CA.5010607@ecs.soton.ac.uk>
Message-ID: <Pine.LNX.4.44.0304191703500.27025-100000@home.sys>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
cc: bug-commoncpp@gnu.org
Subject: Re: Pure Virtual Method call problem. (Bug in library?)
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sat, 19 Apr 2003 20:22:59 -0000


That is not surprising.  I have found even stranger wierdness on macosx.  
I am at the moment of the belief that the dynamic loader is broken for c++ 
shared libraries on macosx.  That particular problem is best illustrated 
in the tests/ programs; digest runs while url1 freezes.  I found that in 
the case of digest that the ccgnu2 constructors for library based static 
objects ran, while in the case of url1, they did not!  It turned out the 
only way to get constructors for objects in shared libraries to run was to 
stick a related object into the local image.  Hence, the only reason 
digest worked was because it included ost::MD5digest as a local static 
object in tests/digest.cpp.  In fact, if you create a static instance of 
any valid ost::xxx object in url1.cpp, then suddenly the constructors for 
all libccgnu2.dylib ohects also run, and everything is fine.  If you 
don't, then the static objects inside libccgnu2.dylib also never 
initialize...very wierd.

On Wed, 16 Apr 2003, Jon Wilson wrote:

> Many thanks for your help. I will look into a work around. Just seemed 
> odd that the same compiler should work Ok on one platform, but not another.
> Jon Wilson
> 
> David Sugar wrote:
> 
> > The C++ standard does not permit virtual methods to be called from 
> > constructors or destructors.  In many cases older compilers had 
> > ignored this, since often the virtual table is populated anyway before 
> > the constructor is called, but that is implimentation specific 
> > behavior and should not be relied upon.  Hence, things that can invoke 
> > virtuals cannot be specified in constructors or destructors either.
> >
> > Jon wrote:
> >
> >> I keep getting a runtime error when using the following code. As you 
> >> can see, both of the derived classes have their own run() method, 
> >> however, the base class defines this method as virtual and required 
> >> for all subclasses. The problem occurs when start() is called in the 
> >> constructor of the derived class. I get a pure virtual method call 
> >> runtime exception and the program dies. This is compiling under 
> >> gcc3.2 in Linux, however, in windows MingW with gcc3.2 everything is 
> >> fine!!! Since I have no compiler directives and the same compiler on 
> >> each system, I cannot see what could be the problem.
> >>
> >> Is this a difference in the port of gcc? Or is it caused by the 
> >> library calling run() from the start() method call? I am using 1.0.9 
> >> without modification on Linux, however, I had to comment 
> >> HAVE_OLD_IOSTREAM on windows.
> >>
> >> I can provide the full source code if necessary
> >>
> >>
> >> #ifndef SERVER_H
> >> #define SERVER_H
> >> #include "thread.h"
> >> #include <cc++/thread.h>
> >> #include <cc++/socket.h>
> >> #include <list>
> >> #define DEFAULT_WITHDRAW_PORT 1234
> >> #define DEFAULT_DEPOSIT_PORT 5678
> >> using namespace std;
> >> using namespace ost;
> >> class Server:public Thread{
> >>    public:
> >>        Server(){
> >>                cout << "SERVER" << endl;
> >>                setCancel(Thread::cancelImmediate);
> >>        }
> >>        ~Server(){
> >>                cout << "~SERVER" << endl;
> >>                terminate();
> >>                delete sock;
> >>                delete addr;
> >>        }
> >>        virtual void run()=0;
> >>        static void setHost(char* host){
> >>            Server::host=host;
> >>        };
> >>        static void setPorts(int withdraw,int deposit){
> >>            withdraw_port=withdraw;
> >>            deposit_port=deposit;
> >>        }
> >>        static Server* withdraw;
> >>        static Server* deposit;
> >>    protected:
> >>        InetAddress* addr;
> >>        static char* host;
> >>        static tpport_t withdraw_port;
> >>        static tpport_t deposit_port;
> >>        TCPSocket* sock;
> >> };
> >> class WithdrawServer:public Server{
> >>    public:
> >>        WithdrawServer(){
> >>            this->port=Server::withdraw_port;
> >>         start();
> >>        }
> >>        void run();
> >>    private:
> >>        tpport_t port;
> >> };
> >> class DepositServer:public Server{
> >>    public:
> >>        DepositServer(){
> >>            this->port=Server::deposit_port;
> >>         start();
> >>        }
> >>        void run();
> >>    private:
> >>        tpport_t port;
> >> };
> >> #endif
> >> //////////////////////////////////////////////////////////////////////////////////////////
> >> char* Server::host;
> >> tpport_t Server::withdraw_port;
> >> tpport_t Server::deposit_port;
> >> Server* Server::withdraw;
> >> Server* Server::deposit;
> >>
> >> void WithdrawServer::run(){
> >>    if(!Server::host)return;
> >>    addr=new InetAddress(Server::host);
> >>    sock=new TCPSocket(*addr,port);
> >>    while(true){
> >>        if(sock->isPendingConnection()){
> >>            cout << "W Connected" << endl;
> >>            new WithdrawThread(*sock);
> >>            cout << "Added to list" << endl;
> >>            yield();
> >>        }
> >>    }
> >> }
> >> void DepositServer::run(){
> >>    if(!Server::host)return;
> >>    addr=new InetAddress(Server::host);
> >>    sock=new TCPSocket(*addr,port);
> >>    while(true){
> >>        if(sock->isPendingConnection()){
> >>            cout << "D Connected" << endl;
> >>            new DepositThread(*sock);
> >>            yield();
> >>        }
> >>    }
> >> }
> >>
> >>
> >>
> >> _______________________________________________
> >> Bug-commoncpp mailing list
> >> Bug-commoncpp@gnu.org
> >> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
> >>  
> >>
> >
> >
> >
> >
> > _______________________________________________
> > Bug-commoncpp mailing list
> > Bug-commoncpp@gnu.org
> > http://mail.gnu.org/mailman/listinfo/bug-commoncpp
> >
> 
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
> 




From MAILER-DAEMON Sun Apr 20 07:36:46 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 197D67-0006OB-00
	for mharc-bug-commoncpp@gnu.org; Sun, 20 Apr 2003 07:35:03 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 197D4r-0005Ui-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 07:33:45 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 197D4j-0005Q2-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 07:33:37 -0400
Received: from raven.ecs.soton.ac.uk ([152.78.70.1])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 197D0B-0004HF-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 07:28:55 -0400
Received: from crow.ecs.soton.ac.uk (crow.ecs.soton.ac.uk [152.78.71.3])
	by raven.ecs.soton.ac.uk (8.9.3/8.9.3) with ESMTP id MAA08165
	for <bug-commoncpp@gnu.org>; Sun, 20 Apr 2003 12:28:53 +0100 (BST)
Received: from bigfoot.com (ug-vpn4 [152.78.236.4])
	by crow.ecs.soton.ac.uk (8.9.3p2/8.9.3) with ESMTP id MAA06517
	for <bug-commoncpp@gnu.org>; Sun, 20 Apr 2003 12:28:49 +0100 (BST)
Message-ID: <3EA2846F.5070208@bigfoot.com>
Date: Sun, 20 Apr 2003 12:28:47 +0100
From: Jon Wilson <sendmemymail@bigfoot.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-MailScanner-Information: Please contact helpdesk@ecs.soton.ac.uk for more
	information
X-ECS-MailScanner: Found to be clean
Subject: Clarification of the isPendingConnection() call.
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 20 Apr 2003 11:35:00 -0000

I am trying to implement the TCPSocket's isPendingConnection() call, 
however, I can't work out form the docs how it works, and the source is 
a little long for just a minor thing.
I have a few questions about it...
1) Does the call block until the timeout is reached or the socket connected?
2) What units is the timeout in? Seconds? Milliseconds or tenths (or 
something else)?
3) What happens when the connection times out? Is an exception thrown or 
does it just return false?

Thanks for clearing this up for me.
Jon Wilson




From MAILER-DAEMON Sun Apr 20 08:30:35 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 197Dxq-0004y2-00
	for mharc-bug-commoncpp@gnu.org; Sun, 20 Apr 2003 08:30:34 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 197Dxn-0004xT-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 08:30:31 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 197Dxl-0004uP-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 08:30:30 -0400
Received: from bulbasaur.rediris.es ([130.206.194.34])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 197Dxk-0004qB-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 08:30:28 -0400
Received: from fedemp by bulbasaur.rediris.es with local (Exim 3.36 #1
	(Debian))	id 197E2r-0003G7-00; Sun, 20 Apr 2003 14:35:45 +0200
Date: Sun, 20 Apr 2003 14:35:44 +0200
From: Federico Montesino Pouzols <fedemp@altern.org>
To: Jon Wilson <sendmemymail@bigfoot.com>
Message-ID: <20030420123544.GA12182@bulbasaur.rediris.es>
Mail-Followup-To: Jon Wilson <sendmemymail@bigfoot.com>,
	bug-commoncpp@gnu.org
References: <3EA2846F.5070208@bigfoot.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3EA2846F.5070208@bigfoot.com>
User-Agent: Mutt/1.5.3i
Sender: Federico Montesino Pouzols <fedemp@bulbasaur.rediris.es>
cc: bug-commoncpp@gnu.org
Subject: Re: Clarification of the isPendingConnection() call.
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: Federico Montesino Pouzols <fedemp@altern.org>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 20 Apr 2003 12:30:32 -0000


	Hi, isPendingConnection is implemented using
Socket::isPending, so ...

On Sun, Apr 20, 2003 at 12:28:47PM +0100, Jon Wilson wrote:
> I am trying to implement the TCPSocket's isPendingConnection() call, 
> however, I can't work out form the docs how it works, and the source is 
> a little long for just a minor thing.
> I have a few questions about it...
> 1) Does the call block until the timeout is reached or the socket connected?

	Yes, and if no timeout is specified, TIMEOUT_INF is used, so
it will block till the socket is connected.

> 2) What units is the timeout in? Seconds? Milliseconds or tenths (or 
> something else)?

	In milliseconds.

> 3) What happens when the connection times out? Is an exception thrown or 
> does it just return false?
> 

	No exception is thrown (at least purposely), it just returns
true or false.

	I have added a few notes to this method's documentation in
CVS.

> Thanks for clearing this up for me.
> Jon Wilson
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp



From MAILER-DAEMON Sun Apr 20 09:51:57 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 197FEa-00068Q-00
	for mharc-bug-commoncpp@gnu.org; Sun, 20 Apr 2003 09:51:56 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 197FEY-00065R-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 09:51:54 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 197FEX-00065E-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 09:51:54 -0400
Received: from bulbasaur.rediris.es ([130.206.194.34])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 197FEX-00065A-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 09:51:53 -0400
Received: from fedemp by bulbasaur.rediris.es with local (Exim 3.36 #1
	(Debian))	id 197FJe-0005aB-00; Sun, 20 Apr 2003 15:57:10 +0200
Date: Sun, 20 Apr 2003 15:57:10 +0200
From: Federico Montesino Pouzols <fedemp@altern.org>
To: klaus triendl <triendl.kj@aon.at>
Message-ID: <20030420135710.GC12182@bulbasaur.rediris.es>
Mail-Followup-To: klaus triendl <triendl.kj@aon.at>,
	Dimitar Dimitrov <dimitar@yucom.be>, bug-commoncpp@gnu.org
References: <MNENKPHMOOKIHGCMGMEBAEAKCDAA.triendl.kj@aon.at>
	<MNENKPHMOOKIHGCMGMEBGEBACDAA.triendl.kj@aon.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <MNENKPHMOOKIHGCMGMEBGEBACDAA.triendl.kj@aon.at>
User-Agent: Mutt/1.5.3i
Sender: Federico Montesino Pouzols <fedemp@bulbasaur.rediris.es>
cc: bug-commoncpp@gnu.org
Subject: Re: change of socketport constructor
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: Federico Montesino Pouzols <fedemp@altern.org>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 20 Apr 2003 13:51:55 -0000


	Yes, I think the patch is ready to be applied, and it solves
an important issue that has been pending for a long time. I would
apply it immediately, but since the patch implies many functional
changes, I think we should wait to see if there are people already
using the old code and if this change could break and make it
difficult to update some applications.

	Anyway, I personally think the patch should be applied, and if
there are applications using the old version of SocketService, they
should be better updated to use the new version. Opinions?

On Fri, Apr 18, 2003 at 06:32:18PM +0200, klaus triendl wrote:
> now, here is the patch (against the commoncpp2-1.0.9 release, hope this is
> ok);
> apply it in the root of commoncpp2 with ``patch -p1 < ccgnu2.diff"; only
> ``include/cc++/socket.h" and ``src/port.cpp" are patched;
> 
> 
> what it does:
> 
> change ``SocketPort::SocketPort()" not to accept a service anymore;
> change ``void SocketPort::expired()" in ``bool SocketPort::expired()";
> don't proceed with ``retry:" and don't put the port into the event array if
> expired() returns true
> SocketService::~SocketService iterates the socketports itself and sets
> SocketPort::service = NULL before deleting SocketPort in order to prevent
> updating the SocketService
> change SocketService::detach() not to update the service
> SocketPort::setTimer()+incTimer() don't update the service anymore
> adds SocketPort::detach() to be able to detach from the SocketService in
> e.g. expired() (i need this because the data processing is threaded because
> it could take a long time, so it is possible that the socket expires and is
> closed before the data processing finishes)


> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




From MAILER-DAEMON Sun Apr 20 10:56:27 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 197GF0-0001DO-00
	for mharc-bug-commoncpp@gnu.org; Sun, 20 Apr 2003 10:56:26 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 197GEx-0001CB-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 10:56:23 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 197GEw-00017q-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 10:56:23 -0400
Received: from pool-138-89-34-217.mad.east.verizon.net ([138.89.34.217]
	helo=home.bayonne.dyndns.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 197GEv-00017k-00
	for bug-commoncpp@gnu.org; Sun, 20 Apr 2003 10:56:21 -0400
Received: from 192.168.1.104 ([192.168.1.104])
	by home.bayonne.dyndns.org (8.11.6/8.11.6) with ESMTP id h3KFiQf09893;
	Sun, 20 Apr 2003 11:44:26 -0400
From: David Sugar <dyfet@ostel.com>
To: Federico Montesino Pouzols <fedemp@altern.org>,
   klaus triendl <triendl.kj@aon.at>
Date: Sun, 20 Apr 2003 10:45:08 -0400
User-Agent: KMail/1.5
References: <MNENKPHMOOKIHGCMGMEBAEAKCDAA.triendl.kj@aon.at>
	<MNENKPHMOOKIHGCMGMEBGEBACDAA.triendl.kj@aon.at>
	<20030420135710.GC12182@bulbasaur.rediris.es>
In-Reply-To: <20030420135710.GC12182@bulbasaur.rediris.es>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304201045.08180.dyfet@ostel.com>
cc: bug-commoncpp@gnu.org
Subject: Re: change of socketport constructor
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 20 Apr 2003 14:56:24 -0000

I know I have nothing which would break with this change, but I cannot say if 
others do or don't.  Maybe we could temporarily add a special configure flag 
to --enable-old-socketservice, with appropriate defines, to build the old 
broken behavior.  At least that way people who depend on the broken behavior, 
if such applications exist, can still build a library with it until they 
migrate the application...

On Sunday 20 April 2003 09:57 am, Federico Montesino Pouzols wrote:
> Yes, I think the patch is ready to be applied, and it solves
> an important issue that has been pending for a long time. I would
> apply it immediately, but since the patch implies many functional
> changes, I think we should wait to see if there are people already
> using the old code and if this change could break and make it
> difficult to update some applications.
>
> 	Anyway, I personally think the patch should be applied, and if
> there are applications using the old version of SocketService, they
> should be better updated to use the new version. Opinions?
>
> On Fri, Apr 18, 2003 at 06:32:18PM +0200, klaus triendl wrote:
> > now, here is the patch (against the commoncpp2-1.0.9 release, hope this
> > is ok);
> > apply it in the root of commoncpp2 with ``patch -p1 < ccgnu2.diff"; only
> > ``include/cc++/socket.h" and ``src/port.cpp" are patched;
> >
> >
> > what it does:
> >
> > change ``SocketPort::SocketPort()" not to accept a service anymore;
> > change ``void SocketPort::expired()" in ``bool SocketPort::expired()";
> > don't proceed with ``retry:" and don't put the port into the event array
> > if expired() returns true
> > SocketService::~SocketService iterates the socketports itself and sets
> > SocketPort::service = NULL before deleting SocketPort in order to prevent
> > updating the SocketService
> > change SocketService::detach() not to update the service
> > SocketPort::setTimer()+incTimer() don't update the service anymore
> > adds SocketPort::detach() to be able to detach from the SocketService in
> > e.g. expired() (i need this because the data processing is threaded
> > because it could take a long time, so it is possible that the socket
> > expires and is closed before the data processing finishes)
> >
> >
> > _______________________________________________
> > Bug-commoncpp mailing list
> > Bug-commoncpp@gnu.org
> > http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




From MAILER-DAEMON Tue Apr 22 08:07:24 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 197wJV-0002Eo-00
	for mharc-bug-commoncpp@gnu.org; Tue, 22 Apr 2003 07:51:53 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 197rQc-0000cY-00
	for bug-commoncpp@gnu.org; Tue, 22 Apr 2003 02:38:54 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 197rQF-0007yj-00
	for bug-commoncpp@gnu.org; Tue, 22 Apr 2003 02:38:33 -0400
Received: from cc19990-a.groni1.gr.home.nl ([217.121.128.15]
	helo=zolder.ath.cx)	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 197rQE-0007je-00
	for bug-commoncpp@gnu.org; Tue, 22 Apr 2003 02:38:30 -0400
Received: from localhost (orion@localhost)
	by zolder.ath.cx (8.11.6/8.10.0) with ESMTP id h3M6faT11805
	for <bug-commoncpp@gnu.org>; Tue, 22 Apr 2003 08:41:37 +0200
Date: Tue, 22 Apr 2003 08:41:36 +0200 (CEST)
From: "W.J." <miathan@goliath.darktech.org>
X-X-Sender: orion@zolder
To: bug-commoncpp@gnu.org
Message-ID: <Pine.LNX.4.44.0304220821001.11731-100000@zolder>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Mailman-Approved-At: Tue, 22 Apr 2003 07:51:52 -0400
Subject: CommonC++ questions/comments
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 22 Apr 2003 06:39:02 -0000

Hi,

I seem to miss three things very badly in CommonC++, making it very
difficult or even impossible to do what I want:

- A decent way to do completely async network I/O. We have the SocketPort,
but that one lacks the ability to construct ports to listen in a (TCP)
machine/port address in asynchronous fashion. (There is a SocketPort()
constructor to create a bound UDP socket. Why not a TCP one?)

The SampleSocketPort example uses a seperate thread(!) to do the listening
and accepting part, I don't like this, furthermore the method used does
not work when we want to listen on multiple ports.

Another way for pseudo async i/o would have beee to use
Socket.isPending(), but this methods lacks a way to 'select' on
multiple sockets/streams.

- A SocketPort() constructor that creates a SocketPort from a already
existing Socket.
Would be useful if, like in my progam, the connection and initialisation
part is synchronous, but tha server main loop is async. (it is a
proxy-kind of application, that needs to watch two streams and convert
between them)

- TCPStream::readsome does not work as it should? It always returns
0, and reads nothing.
I thought the semantics of readsome should be 'wait for the first byte,
then read as much as is available'.

It is possible to circumvent this 'glitch' with the following
construction, though:

s.read(&buffer[0], 1);
n = s.readsome(&buffer[1], BUFSIZE-1) + 1;

I tried this too, without success (never gets anything even if data is
available):

if(s.isPending(Socket::pendingRead)) {
	n = s.readsome(&buffer, BUFSIZE);
}

[Operating system Linux 2.4.19 glibc 2.3.1, have not tested in win32 yet]

--

I could give a shot at implementing/fixing the above things myself, but
I'd like to know first if things are this way for a reason.

Wladimir




From MAILER-DAEMON Thu Apr 24 10:24:05 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 198hZe-0000uK-00
	for mharc-bug-commoncpp@gnu.org; Thu, 24 Apr 2003 10:19:42 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 198hZL-000088-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 10:19:23 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 198hZ7-0007kz-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 10:19:15 -0400
Received: from mail.rdslink.ro ([193.231.236.20])
	by monty-python.gnu.org with smtp (Exim 4.10.13)
	id 198hYu-00079r-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 10:18:56 -0400
Received: (qmail 795 invoked from network); 24 Apr 2003 14:21:28 -0000
Received: from unknown (HELO 81.196.81.90) (81.196.81.90)
  by mail.rdslink.ro with SMTP; 24 Apr 2003 14:21:28 -0000
Date: Thu, 24 Apr 2003 17:12:08 +0200
From: Liviu  <liviu@netonwave.com>
X-Mailer: The Bat! (v1.62i) Personal
X-Priority: 3 (Normal)
Message-ID: <1655562868.20030424171208@netonwave.com>
To: bug-commoncpp@gnu.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: None
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: Liviu <liviu@netonwave.com>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Thu, 24 Apr 2003 14:19:40 -0000

Hello,

I'am trying to write a simple client that connects to a telnet server
using the tcpstream class.
My code goes like this:

tcpserver tcp;
try {
    tcp.open("127.0.0.1:23");
}
catch(Socket* socket)
{
    cerr << "An exception was thrown." << endl;
}

If the telnet server is running everything goes ok.
It the telnet server is NOT RUNNING (so the open should fail) the open
function doesn't throw any exception.

My question is: How do I know if my client connected or not to the
server ???


    


  

-- 
Best regards,
 Liviu                          mailto:liviu@netonwave.com




From MAILER-DAEMON Thu Apr 24 10:40:55 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 198hrC-0003hL-00
	for mharc-bug-commoncpp@gnu.org; Thu, 24 Apr 2003 10:37:50 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 198hr0-0003Cb-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 10:37:38 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 198hqQ-0002Tx-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 10:37:02 -0400
Received: from mail.rdslink.ro ([193.231.236.20])
	by monty-python.gnu.org with smtp (Exim 4.10.13)
	id 198hpt-0002BI-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 10:36:29 -0400
Received: (qmail 23395 invoked from network); 24 Apr 2003 14:39:03 -0000
Received: from unknown (HELO 81.196.81.90) (81.196.81.90)
  by mail.rdslink.ro with SMTP; 24 Apr 2003 14:39:03 -0000
Date: Thu, 24 Apr 2003 17:36:32 +0200
From: Liviu <liviu@netonwave.com>
X-Mailer: The Bat! (v1.62i) Personal
X-Priority: 3 (Normal)
Message-ID: <1547026763.20030424173632@netonwave.com>
To: bug-commoncpp@gnu.org
Resent-from: Liviu  <liviu@netonwave.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Resent-Message-Id: <E198hpt-0002BI-00@monty-python.gnu.org>
Resent-Date: Thu, 24 Apr 2003 10:36:29 -0400
Subject: tcpstream::open thrown exceptions
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
Reply-To: Liviu <liviu@netonwave.com>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Thu, 24 Apr 2003 14:37:48 -0000

Hello,

I'am trying to write a simple client that connects to a telnet server
using the tcpstream class.
My code goes like this:

tcpserver tcp;
try {
    tcp.open("127.0.0.1:23");
}
catch(Socket* socket)
{
    cerr << "An exception was thrown." << endl;
}

If the telnet server is running everything goes ok.
It the telnet server is NOT RUNNING (so the open should fail) the open
function doesn't throw any exception.

My question is: How do I know if my client connected or not to the
server ???


    


  

-- 
Best regards,
 Liviu                          mailto:liviu@netonwave.com




From MAILER-DAEMON Thu Apr 24 20:13:14 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 198qpN-0003HO-00
	for mharc-bug-commoncpp@gnu.org; Thu, 24 Apr 2003 20:12:33 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 198qmW-0002VF-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 20:09:36 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 198qk5-0001aB-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 20:07:06 -0400
Received: from pool-138-89-34-217.mad.east.verizon.net ([138.89.34.217]
	helo=home.bayonne.dyndns.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 198qj7-0001Rq-00
	for bug-commoncpp@gnu.org; Thu, 24 Apr 2003 20:06:05 -0400
Received: from 192.168.1.104 ([192.168.1.104])
	by home.bayonne.dyndns.org (8.11.6/8.11.6) with ESMTP id h3P0sjT27821;
	Thu, 24 Apr 2003 20:54:45 -0400
From: David Sugar <dyfet@ostel.com>
To: bug-commoncpp@gnu.org
Date: Thu, 24 Apr 2003 19:55:27 -0400
User-Agent: KMail/1.5
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304241955.27276.dyfet@ostel.com>
cc: thevas@mac.com
Subject: macosx broken constructors in libraries
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Fri, 25 Apr 2003 00:12:32 -0000

I finally did find a reference on the web that refers to the exact problem I 
was seeing in macosx with GNU Common C++ and the failure to run constructors 
for objects initialized in the shared library; that in certain cases global 
constructors really do not get executed, unless the object or code section it 
is contained in is implicity referenced.  The only link to this topic I ever 
found is from a libtool discussion: 
 
http://mail.gnu.org/archive/html/libtool/2002-04/msg00060.html

Which has the first excellant summery of the problem that I had been able to 
find, as well as a strange solution through two step linking...certainly 
there has to be a better or less ugly way?!






From MAILER-DAEMON Fri Apr 25 09:41:43 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 1993RS-0003tH-00
	for mharc-bug-commoncpp@gnu.org; Fri, 25 Apr 2003 09:40:42 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 1993RA-0003TN-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 09:40:24 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 1993R4-0003EM-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 09:40:21 -0400
Received: from pool-138-89-34-217.mad.east.verizon.net ([138.89.34.217]
	helo=home.bayonne.dyndns.org)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 1993R2-0003DG-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 09:40:17 -0400
Received: from 192.168.1.104 ([192.168.1.104])
	by home.bayonne.dyndns.org (8.11.6/8.11.6) with ESMTP id h3PET4T02762;
	Fri, 25 Apr 2003 10:29:04 -0400
From: David Sugar <dyfet@ostel.com>
To: bug-commoncpp@gnu.org, cplusplus-devel@lists.sourceforge.net
Date: Fri, 25 Apr 2003 09:29:46 -0400
User-Agent: KMail/1.5
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200304250929.46078.dyfet@ostel.com>
Subject: GNU Common C++ platform notes
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Fri, 25 Apr 2003 13:40:29 -0000

These were my platform specific notes on different targets, and where problems 
exist:

		working		shared c++	thread		can build
platform	c++ compiler	libs			support		plugins

gnu/linux	y			y			pthread		y
freebsd	y			y			pthread		y
netbsd	y			y			(1.7+ pthread)	y
cygwin	y			y			pthread		? no ?
mingw32	y			y			win32		unknown
win32	y			y			win32		untested
macosx	y			glbl ctors fail	pthread		y
solaris	y 			(ver issues)	pthread		y

additional notes:

"can build plugins" means both support for dlopening (or equiv) of 
object modules, and the ability to actually compile and contruct 
C++ stand-alone plugin modules.

"thread support" at the moment means either pthread or win32.

"shared c++ libs" means it can build shared libraries from c++ without
any issues (note, macosx has issues...).

"working c++ compiler" means a generally functional standard conformant
compiler (since most of these use gcc, that is usually not an issue), 
AND the ability to complete the autoconf/automake tests we use.  It
generally means Common C++ configure produces a usable result.

platform specific notes:

macosx:

There are problems with building C++ shared libraries which have 
global objects that have contructors which must be executed when the 
library is loaded.  I have seen reference to the fact that C++ shared 
libraries are loaded in multiple sections rather than at once.  Perhaps
there is a linker option to fix this.

netbsd:

cvs current (and ?1.7? or ?2.0?) promise pthread support.

cygwin:

using the -module option for libtool seems broken in current cygwin; it 
fails to build a target dso plugin, but rather tries to build a .exe, 
and wants all link references resolved.

There may be other issues related to shortcommings of the OMF format, 
particularly related to relative relocations of sized objects in global 
space.

some thread unittest programs do not exit, so there may be issues in cygwin 
pthreads.

mingw32:

we use a seperate "makefile.gcc" to build things here rather than depend 
on autoconf/automake, and use dll tools expressedly.  The 
"makefile.gcc" is build for the mingw32 cross compiler supplied with
Debian.

There may be other issues related to shortcommings of the OMF format,
particularly related to relative relocations of sized objects in global
space.

win32:

There are native .dsp projects to build win32 targets rather than using 
automake/autoconf.  These are built with the native visual studio 
compiler.

Building a plugin through a .dsp has never been tested, but other things 
have generally been confirmed as working.

solaris:

There are odd issues that come up between SunOS/Solaris, and between 
specific Solaris releases, that autoconf/automake macros currently do 
not fully resolve.






From MAILER-DAEMON Fri Apr 25 12:24:01 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 1995yB-0001xn-00
	for mharc-bug-commoncpp@gnu.org; Fri, 25 Apr 2003 12:22:39 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 1995HL-00021x-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 11:38:23 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 1995H6-0001dZ-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 11:38:14 -0400
Received: from [217.121.128.15] (helo=zolder.ath.cx)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 1995Gx-0001RA-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 11:38:00 -0400
Received: from localhost (orion@localhost)
	by zolder.ath.cx (8.11.6/8.10.0) with ESMTP id h3PFfDO06846
	for <bug-commoncpp@gnu.org>; Fri, 25 Apr 2003 17:41:14 +0200
Date: Fri, 25 Apr 2003 17:41:13 +0200 (CEST)
From: "W.J." <miathan@goliath.darktech.org>
X-X-Sender: orion@zolder
To: bug-commoncpp@gnu.org
Message-ID: <Pine.LNX.4.44.0304251729560.6796-100000@zolder>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Mailman-Approved-At: Fri, 25 Apr 2003 12:22:37 -0400
Subject: Compilation under win32 broken
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Fri, 25 Apr 2003 15:38:37 -0000

Hi,

When compiling CommonC++ 1.0.9 under win32 (MSDev 6) I get the following
error:

src\sha.cpp(338): error C2593: 'operator <<' is ambigious

I 'fixed' this by putting (int) in front of h1 and h2, but I have no idea
if this does the right thing..

Furthermore, on linking it gives a error about being unable to find
'_thiscall ost::SHATumbler<unsigned __int32>::placeInBuffer(unsigned
char*)'
(occurences in digest.obj and md5.obj)

Help?

Wladimir




From MAILER-DAEMON Fri Apr 25 14:37:38 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 19983g-0008HX-00
	for mharc-bug-commoncpp@gnu.org; Fri, 25 Apr 2003 14:36:28 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 19983V-0007kQ-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 14:36:17 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 19982y-00074O-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 14:35:45 -0400
Received: from dc-mx08.cluster1.charter.net ([209.225.8.18]
	helo=mx08.cluster1.charter.net)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 19982l-0006Wf-00
	for bug-commoncpp@gnu.org; Fri, 25 Apr 2003 14:35:31 -0400
Received: from [66.190.65.189] (HELO liliwhite.renaissance.oasis)
  by mx08.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6)
  with ESMTP id 73472278; Fri, 25 Apr 2003 14:35:30 -0400
Received: from lizzy by liliwhite.renaissance.oasis with local (Exim 3.35 #1
	(Debian))	id 19982c-0007yM-00; Fri, 25 Apr 2003 13:35:22 -0500
To: "W.J." <miathan@goliath.darktech.org>
References: <Pine.LNX.4.44.0304251729560.6796-100000@zolder>
From: Elizabeth Barham <lizzy@soggytrousers.net>
Date: 25 Apr 2003 13:35:21 -0500
In-Reply-To: "W.J."'s message of "Fri, 25 Apr 2003 17:41:13 +0200 (CEST)"
Message-ID: <87el3qifx2.fsf@liliwhite.renaissance.oasis>
Lines: 83
X-Mailer: Gnus v5.7/Emacs 20.7
Sender: Elizabeth Barham <lizzy@soggytrousers.net>
cc: bug-commoncpp@gnu.org
Subject: Re: Compilation under win32 broken
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Fri, 25 Apr 2003 18:36:26 -0000

"W.J." <miathan@goliath.darktech.org> writes:

> When compiling CommonC++ 1.0.9 under win32 (MSDev 6) I get the
> following error:
> 
> src\sha.cpp(338): error C2593: 'operator <<' is ambigious

template <class int_type>
std::ostream & SHATumbler<int_type>::toString(std::ostream & os)
{
	unsigned i;
	int_type h1, h2;

	for(i = 0 ; i < (unsigned)size ; i++) {
                h1 = h[i] / ( 1 << sizeof(int_type) * 4);
		h2 = h[i] % ( 1 << sizeof(int_type) * 4);
		os << std::hex << std::setw(sizeof(int_type) / 4) << 
			std::setfill('0') << h1 << h2; // <---- here
	}
	return(os);
}

> I 'fixed' this by putting (int) in front of h1 and h2, but I have no
> idea if this does the right thing..

   To be honest with you, I do not know who added h1 and h2 or
why. There was a discussion about this but whoever added h1 and h2 did
not explain his or her self.

   Originally, it looked like this:

template <class int_type>
std::ostream & SHATumbler<int_type>::toString(std::ostream & os)
{
	for(int i = 0 ; i < size ; i++) {
		os << std::hex << std::setw(sizeof(h[i]) * 2) << 
			std::setfill('0') << h[i];
	}
	return(os);
}

   Further, whoever added h1 and h2 messed it up so that the correct
digest wasn't even displayed! I added the:

	h1 = h[i] / ( 1 << sizeof(int_type) * 4);

business which corrected the others errors as I was assuming that
whoever added h1 and h2 did it for very good reasons but was not
monitoring the mailing list or did not want to speak up.

   Ideally, h1 and h2 would be given a type that has a size of
int_type / 2.

   If you modify it back to the way it was, the implementation that
does not use h1 and h2, are there any errors?

   Another idea is to split the "os <<" line into two lines:

		os << std::hex << std::setw(sizeof(int_type) / 4) << 
			std::setfill('0') << h1;
		os << std::hex << std::setw(sizeof(int_type) / 4) << 
			std::setfill('0') << h2;

> Furthermore, on linking it gives a error about being unable to find
> '_thiscall ost::SHATumbler<unsigned __int32>::placeInBuffer(unsigned
> char*)'
> (occurences in digest.obj and md5.obj)

Perhaps because placeInBuffer is not called in sha.cpp the compiler
assumes it is not needed. There should be some kind of work around,
such as adding:

unsigned SHATumbler<unsigned __int32>::placeInBuffer(unsigned char *);

at the end of sha.cpp (or some other kludge).

#ifdef __WIN32__ // whatever it is
unsigned SHATumbler<unsigned __int32>::placeInBuffer(unsigned char *);
#endif

Thanks for letting us know about this.

Elizabeth



From MAILER-DAEMON Sat Apr 26 01:44:02 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 199ITi-0004L8-00
	for mharc-bug-commoncpp@gnu.org; Sat, 26 Apr 2003 01:44:02 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 199ITg-0004GN-00
	for bug-commoncpp@gnu.org; Sat, 26 Apr 2003 01:44:00 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 199ITe-0004DW-00
	for bug-commoncpp@gnu.org; Sat, 26 Apr 2003 01:43:59 -0400
Received: from remt22.cluster1.charter.net ([209.225.8.32])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 199ITe-0004BC-00
	for bug-commoncpp@gnu.org; Sat, 26 Apr 2003 01:43:58 -0400
Received: from [66.190.65.189] (HELO liliwhite.renaissance.oasis)
  by remt22.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6)
  with ESMTP id 16604717; Sat, 26 Apr 2003 01:43:57 -0400
Received: from lizzy by liliwhite.renaissance.oasis with local (Exim 3.35 #1
	(Debian))	id 199ITU-0008La-00; Sat, 26 Apr 2003 00:43:48 -0500
To: "W.J." <miathan@goliath.darktech.org>
References: <Pine.LNX.4.44.0304251729560.6796-100000@zolder>
From: Elizabeth Barham <lizzy@soggytrousers.net>
Date: 26 Apr 2003 00:43:48 -0500
In-Reply-To: "W.J."'s message of "Fri, 25 Apr 2003 17:41:13 +0200 (CEST)"
Message-ID: <878ytxizjf.fsf@liliwhite.renaissance.oasis>
Lines: 47
X-Mailer: Gnus v5.7/Emacs 20.7
Sender: Elizabeth Barham <lizzy@soggytrousers.net>
cc: bug-commoncpp@gnu.org
Subject: Re: Compilation under win32 broken
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sat, 26 Apr 2003 05:44:00 -0000

"W.J." writes:

> When compiling CommonC++ 1.0.9 under win32 (MSDev 6) I get the following
> error:
> 
> src\sha.cpp(338): error C2593: 'operator <<' is ambigious

It seems to me that the best way to solve this situation once and for
all is to re-implement the toString function in SHATumbler<int_type>:

	1) In constructor, allocate two charachter arrays:
		a) for a sprintf format string
		b) for a temporary string representation of the tumbler
                   itself (part of the total sha message)

        2) In constructor, define the sprintf format string such that
           it looks something like "%0[sizeof(int_type * 2)]x" using,
           naturally, sprintf.

        3) In SHATumbler<int_type>::toString(std::ostream & os),
           sprintf is used with the generated sprintf format (in [2])
           to place the tumbler's string representation in the
           temorary string (in [1b]).

        4) The temporary string is piped out to os

        5) Destructor destroys both strings made in consructor.

I'll try to do this in the next few days.
           
> Furthermore, on linking it gives a error about being unable to find
> '_thiscall ost::SHATumbler<unsigned __int32>::placeInBuffer(unsigned
> char*)'
> (occurences in digest.obj and md5.obj)

Did adding this to sha.cpp:

#ifdef __WIN32__
unsigned
SHATumbler<uint32>::placeInBuffer(unsigned char *);
#endif

make any difference?

Thank you,

Elizabeth



From MAILER-DAEMON Sat Apr 26 17:07:27 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 199WsL-0007uF-00
	for mharc-bug-commoncpp@gnu.org; Sat, 26 Apr 2003 17:06:25 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 199Wrp-0006cL-00
	for bug-commoncpp@gnu.org; Sat, 26 Apr 2003 17:05:53 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 199Wrk-0006OV-00
	for bug-commoncpp@gnu.org; Sat, 26 Apr 2003 17:05:49 -0400
Received: from remt22.cluster1.charter.net ([209.225.8.32])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 199WrY-0005qx-00
	for bug-commoncpp@gnu.org; Sat, 26 Apr 2003 17:05:36 -0400
Received: from [66.190.65.189] (HELO liliwhite.renaissance.oasis)
  by remt22.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6)
  with ESMTP id 16850746; Sat, 26 Apr 2003 17:05:28 -0400
Received: from lizzy by liliwhite.renaissance.oasis with local (Exim 3.35 #1
	(Debian))	id 199WrO-0005lK-00; Sat, 26 Apr 2003 16:05:26 -0500
To: "W.J." <miathan@goliath.darktech.org>
References: <Pine.LNX.4.44.0304251729560.6796-100000@zolder>
From: Elizabeth Barham <lizzy@soggytrousers.net>
Date: 26 Apr 2003 16:05:25 -0500
In-Reply-To: "W.J."'s message of "Fri, 25 Apr 2003 17:41:13 +0200 (CEST)"
Message-ID: <877k9hnf56.fsf@liliwhite.renaissance.oasis>
Lines: 24
X-Mailer: Gnus v5.7/Emacs 20.7
Sender: Elizabeth Barham <lizzy@soggytrousers.net>
cc: bug-commoncpp@gnu.org
Subject: Re: Compilation under win32 broken
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sat, 26 Apr 2003 21:06:21 -0000

"W.J." writes:

> When compiling CommonC++ 1.0.9 under win32 (MSDev 6) I get the following
> error:
> 
> src\sha.cpp(338): error C2593: 'operator <<' is ambigious
> 
> I 'fixed' this by putting (int) in front of h1 and h2, but I have no idea
> if this does the right thing..

I just submitted a patch that should resolve this issue:

http://savannah.gnu.org/patch/index.php?func=detailpatch&patch_id=1433&group_id=89

> Furthermore, on linking it gives a error about being unable to find
> '_thiscall ost::SHATumbler<unsigned __int32>::placeInBuffer(unsigned
> char*)'
> (occurences in digest.obj and md5.obj)
> 
> Help?

Anyone?

Elizabeth



From MAILER-DAEMON Sun Apr 27 15:24:59 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 199rld-00067x-00
	for mharc-bug-commoncpp@gnu.org; Sun, 27 Apr 2003 15:24:53 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 199rlE-0005O9-00
	for bug-commoncpp@gnu.org; Sun, 27 Apr 2003 15:24:28 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 199rkz-0004yn-00
	for bug-commoncpp@gnu.org; Sun, 27 Apr 2003 15:24:13 -0400
Received: from remt23.cluster1.charter.net ([209.225.8.33])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 199rkx-0004t4-00
	for bug-commoncpp@gnu.org; Sun, 27 Apr 2003 15:24:11 -0400
Received: from [66.190.65.189] (HELO liliwhite.renaissance.oasis)
  by remt23.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6)
  with ESMTP id 17213282; Sun, 27 Apr 2003 15:24:10 -0400
Received: from lizzy by liliwhite.renaissance.oasis with local (Exim 3.35 #1
	(Debian))	id 199rku-0007FV-00; Sun, 27 Apr 2003 14:24:08 -0500
To: "W.J." <miathan@goliath.darktech.org>
References: <Pine.LNX.4.44.0304271544230.4379-100000@zolder>
From: Elizabeth Barham <lizzy@soggytrousers.net>
Date: 27 Apr 2003 14:24:07 -0500
In-Reply-To: "W.J."'s message of "Sun, 27 Apr 2003 15:53:02 +0200 (CEST)"
Message-ID: <87u1cjn3qg.fsf@liliwhite.renaissance.oasis>
Lines: 12
X-Mailer: Gnus v5.7/Emacs 20.7
Sender: Elizabeth Barham <lizzy@soggytrousers.net>
cc: bug-commoncpp@gnu.org
Subject: Re: Compilation under win32 broken
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 27 Apr 2003 19:24:50 -0000

"W.J." writes:

> A kludge like
> 
> class CCXX_CLASS_EXPORT ost::SHADigest<unsigned __int64,64>;
> 
> Does not solve it.

Surely MS provided *some* method to insure instantiation and
exportation of a template class?

Elizabeth



From MAILER-DAEMON Mon Apr 28 12:06:50 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 19AB9W-0000DZ-00
	for mharc-bug-commoncpp@gnu.org; Mon, 28 Apr 2003 12:06:50 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 199mXt-0005s6-00
	for bug-commoncpp@gnu.org; Sun, 27 Apr 2003 09:50:21 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 199mXQ-0004Tf-00
	for bug-commoncpp@gnu.org; Sun, 27 Apr 2003 09:49:56 -0400
Received: from [217.121.128.15] (helo=zolder.ath.cx)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 199mXM-00045z-00
	for bug-commoncpp@gnu.org; Sun, 27 Apr 2003 09:49:48 -0400
Received: from localhost (orion@localhost)
	by zolder.ath.cx (8.11.6/8.10.0) with ESMTP id h3RDr2604593;
	Sun, 27 Apr 2003 15:53:06 +0200
Date: Sun, 27 Apr 2003 15:53:02 +0200 (CEST)
From: "W.J." <miathan@goliath.darktech.org>
X-X-Sender: orion@zolder
To: bug-commoncpp@gnu.org
In-Reply-To: <878ytxizjf.fsf@liliwhite.renaissance.oasis>
Message-ID: <Pine.LNX.4.44.0304271544230.4379-100000@zolder>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Mailman-Approved-At: Mon, 28 Apr 2003 12:06:48 -0400
cc: Elizabeth Barham <lizzy@soggytrousers.net>
Subject: Re: Compilation under win32 broken
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Sun, 27 Apr 2003 13:51:21 -0000


> > '_thiscall ost::SHATumbler<unsigned __int32>::placeInBuffer(unsigned
> > char*)'
> > (occurences in digest.obj and md5.obj)
>
> Did adding this to sha.cpp:
>
> #ifdef __WIN32__
> unsigned
> SHATumbler<uint32>::placeInBuffer(unsigned char *);
> #endif
>
> make any difference?

Let's see..
It seems VC++ has a problem with dll-exporting 'template' classes, that
is, it totally ignores CCXX_CLASS_EXPORT on them.

sha.cpp
..\include\cc++/digest.h(383) : warning C4275: non dll-interface class
'ost::SHADigest<unsigned __int64,64>' used as base for dll-interface class
'ost::SHA64DigestHelper'
        ..\include\cc++/digest.h(383) : see declaration of
'SHA64DigestHelper'
..\include\cc++/digest.h(385) : warning C4251: 'h' : class
'ost::SHATumbler<unsigned __int32>' needs to have dll-interface to be used
by clients of class 'ost::SHA64DigestHelper'
..\include\cc++/digest.h(386) : warning C4251: 'a' : class
'ost::SHATumbler<unsigned __int32>' needs to have dll-interface to be used
by clients of class 'ost::SHA64DigestHelper'

A kludge like

class CCXX_CLASS_EXPORT ost::SHADigest<unsigned __int64,64>;

Does not solve it.

Wladimir





From MAILER-DAEMON Mon Apr 28 21:57:47 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 19AKMF-0000RP-00
	for mharc-bug-commoncpp@gnu.org; Mon, 28 Apr 2003 21:56:35 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 19AKLw-0008Bu-00
	for bug-commoncpp@gnu.org; Mon, 28 Apr 2003 21:56:16 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 19AKLt-00087F-00
	for bug-commoncpp@gnu.org; Mon, 28 Apr 2003 21:56:13 -0400
Received: from dc-mx14.cluster1.charter.net ([209.225.8.24])
	by monty-python.gnu.org with esmtp (Exim 4.10.13)
	id 19AKLk-0007wW-00
	for bug-commoncpp@gnu.org; Mon, 28 Apr 2003 21:56:04 -0400
Received: from [66.190.65.189] (HELO liliwhite.renaissance.oasis)
  by dc-mx14.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6)
  with ESMTP id 105766704; Mon, 28 Apr 2003 21:56:03 -0400
Received: from lizzy by liliwhite.renaissance.oasis with local (Exim 3.35 #1
	(Debian))	id 19AKLg-000057-00; Mon, 28 Apr 2003 20:56:00 -0500
To: "W.J." <miathan@goliath.darktech.org>
References: <Pine.LNX.4.44.0304271544230.4379-100000@zolder>
From: Elizabeth Barham <lizzy@soggytrousers.net>
Date: 28 Apr 2003 20:56:00 -0500
In-Reply-To: "W.J."'s message of "Sun, 27 Apr 2003 15:53:02 +0200 (CEST)"
Message-ID: <877k9em5hr.fsf@liliwhite.renaissance.oasis>
Lines: 33
X-Mailer: Gnus v5.7/Emacs 20.7
Sender: Elizabeth Barham <lizzy@soggytrousers.net>
cc: bug-commoncpp@gnu.org
Subject: Re: Compilation under win32 broken
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 29 Apr 2003 01:56:33 -0000

Hi W.J., all,

Do the technique displayed on this web-page

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q168/9/58.ASP&NoWebContent=1

make a difference?


> A kludge like
> 
> class CCXX_CLASS_EXPORT ost::SHADigest<unsigned __int64,64>;
> 
> Does not solve it.

That webpage mentions doing something like this for STL instantiations:

    #ifdef EXP_STL
    #    define DECLSPECIFIER __declspec(dllexport)
    #    define EXPIMP_TEMPLATE
    #else
    #    define DECLSPECIFIER __declspec(dllimport)
    #    define EXPIMP_TEMPLATE extern
    #endif

    // Instantiate classes vector<int> and vector<char>
    // This does not create an object. It only forces the generation of all
    // of the members of classes vector<int> and vector<char>. It exports
    // them from the DLL and imports them into the .exe file.
    EXPIMP_TEMPLATE template class DECLSPECIFIER std::vector<int>;
    EXPIMP_TEMPLATE template class DECLSPECIFIER std::vector<char>;

Elizabeth



From MAILER-DAEMON Tue Apr 29 04:54:42 2003
Received: from list by monty-python.gnu.org with archive (Exim 4.10.13)
	id 19AQmq-0001Rs-00
	for mharc-bug-commoncpp@gnu.org; Tue, 29 Apr 2003 04:48:28 -0400
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
	id 19AQmh-0001Qf-00
	for bug-commoncpp@gnu.org; Tue, 29 Apr 2003 04:48:19 -0400
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
	id 19AQhm-0007I8-00
	for bug-commoncpp@gnu.org; Tue, 29 Apr 2003 04:43:15 -0400
Received: from dc-mx09.cluster1.charter.net ([209.225.8.19]
	helo=mx09.cluster1.charter.net)
	by monty-python.gnu.org with esmtp (Exim 4.10.13)	id 19AQfY-0006PJ-00
	for bug-commoncpp@gnu.org; Tue, 29 Apr 2003 04:40:56 -0400
Received: from [66.190.65.189] (HELO liliwhite.renaissance.oasis)
  by mx09.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6)
  with ESMTP id 106785390; Tue, 29 Apr 2003 04:40:55 -0400
Received: from lizzy by liliwhite.renaissance.oasis with local (Exim 3.35 #1
	(Debian))	id 19AQfU-0000PX-00; Tue, 29 Apr 2003 03:40:52 -0500
To: "W.J." <miathan@goliath.darktech.org>
References: <Pine.LNX.4.44.0304271544230.4379-100000@zolder>
From: Elizabeth Barham <lizzy@soggytrousers.net>
Date: 29 Apr 2003 03:40:52 -0500
In-Reply-To: "W.J."'s message of "Sun, 27 Apr 2003 15:53:02 +0200 (CEST)"
Message-ID: <87znm9lmqz.fsf@liliwhite.renaissance.oasis>
Lines: 23
X-Mailer: Gnus v5.7/Emacs 20.7
Sender: Elizabeth Barham <lizzy@soggytrousers.net>
cc: bug-commoncpp@gnu.org
Subject: Re: Compilation under win32 broken
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 29 Apr 2003 08:48:20 -0000

"W.J." writes:

> A kludge like
> 
> class CCXX_CLASS_EXPORT ost::SHADigest<unsigned __int64,64>;
> 
> Does not solve it.

What about things like:

  template class ost::SHADigest<uint64,64>;

or adding:

  CCXX_CLASS_EXPORT template class ost::SHADigest<uint64,64>;

or

  template CCXX_CLASS_EXPORT class ost::SHADigest<uint64,64>;

to the end of sha.cpp? It compiles and links fine on g++.

Elizabeth



