From MAILER-DAEMON Mon Oct 03 05:50:52 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RAfAi-0001xG-Ju
	for mharc-bug-commoncpp@gnu.org; Mon, 03 Oct 2011 05:50:52 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40055)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gharms@hiqinvest.nl>) id 1RAfAf-0001vL-QD
	for bug-commoncpp@gnu.org; Mon, 03 Oct 2011 05:50:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gharms@hiqinvest.nl>) id 1RAfAe-00058A-QM
	for bug-commoncpp@gnu.org; Mon, 03 Oct 2011 05:50:49 -0400
Received: from www.hiqinvest.nl ([213.207.93.87]:37028
	helo=hiqinvest.hostingxs.nl) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gharms@hiqinvest.nl>) id 1RAfAe-00057Z-Ef
	for bug-commoncpp@gnu.org; Mon, 03 Oct 2011 05:50:48 -0400
Received: from [192.168.120.205] (84.207.224.18.not-updated.eunx.net
	[84.207.224.18] (may be forged)) (authenticated bits=0)
	by hiqinvest.hostingxs.nl (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id
	p939ocKM003513
	for <bug-commoncpp@gnu.org>; Mon, 3 Oct 2011 11:50:38 +0200
From: Gunnar Harms <gharms@hiqinvest.nl>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Subject: SockExcpetion getSystemErrorString() method gives unexpected result
Date: Mon, 3 Oct 2011 11:50:37 +0200
Message-Id: <7D5516B8-63CF-4358-8E08-855985AA3DFD@hiqinvest.nl>
To: bug-commoncpp@gnu.org
Mime-Version: 1.0 (Apple Message framework v1081)
X-Mailer: Apple Mail (2.1081)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 213.207.93.87
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 03 Oct 2011 09:50:50 -0000

Hello list,

I am migrating a program from Mac OS-X to Linux and have some issues =
with Socket/SockException classes. On both Mac OS-X as well as Linux the =
commoncpp libs were built with configure script. Before posting the =
actual build configurations I'll just show you the issue, and perhaps =
someone immediately recognizes the cause of my issue.


When the application catches a SockException it logs for example:

	catch (SockException& e) {
		log(string("processNextMessage() : caught a =
SockException: ") + e.getString() + ": " + e.getSystemErrorString());
	}



On Mac OS-X this give log lines like:

processNextMessage() : caught a SockException during connect(): Could =
not connect to remote host: Connection refused




But on Linux I see in log file like:

processNextMessage() : caught a SockException: Could not connect to =
remote host: ?u?0



So, the getSystemErrorString() returned "?u?0" in this case, but this =
varies but is always garbage (eg. "P??0", "?" etc.)



Version of commoncpp is 2-1.8.0 and uname -msr tells me that the Linux =
version is Linux 2.6.18-128.el5 x86_64.

Thank you for your time.

Gunnar



From MAILER-DAEMON Tue Oct 04 07:42:10 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RB3Ny-0001CW-7J
	for mharc-bug-commoncpp@gnu.org; Tue, 04 Oct 2011 07:42:10 -0400
Received: from eggs.gnu.org ([140.186.70.92]:59614)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gharms@hiqinvest.nl>) id 1RB3Ns-0001CN-QD
	for bug-commoncpp@gnu.org; Tue, 04 Oct 2011 07:42:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gharms@hiqinvest.nl>) id 1RB3Nr-0004Z6-Mz
	for bug-commoncpp@gnu.org; Tue, 04 Oct 2011 07:42:04 -0400
Received: from www.hiqinvest.nl ([213.207.93.87]:55738
	helo=hiqinvest.hostingxs.nl) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gharms@hiqinvest.nl>) id 1RB3Nr-0004YF-Fe
	for bug-commoncpp@gnu.org; Tue, 04 Oct 2011 07:42:03 -0400
Received: from [192.168.120.205] (84.207.224.18.not-updated.eunx.net
	[84.207.224.18] (may be forged)) (authenticated bits=0)
	by hiqinvest.hostingxs.nl (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id
	p94Bfakc003438
	for <bug-commoncpp@gnu.org>; Tue, 4 Oct 2011 13:41:36 +0200
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Apple Message framework v1081)
Subject: Re: SockExcpetion getSystemErrorString() method gives unexpected
	result
From: Gunnar Harms <gharms@hiqinvest.nl>
In-Reply-To: <7D5516B8-63CF-4358-8E08-855985AA3DFD@hiqinvest.nl>
Date: Tue, 4 Oct 2011 13:41:35 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <3397C7DF-A770-49C7-8196-12404B6CD235@hiqinvest.nl>
References: <7D5516B8-63CF-4358-8E08-855985AA3DFD@hiqinvest.nl>
To: bug-commoncpp@gnu.org
X-Mailer: Apple Mail (2.1081)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 213.207.93.87
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 04 Oct 2011 11:42:09 -0000

Hello list,

I found the cause of my issue. It's about which variant of strerror_r is =
used.

=46rom strerror_r man pages:

char *strerror_r(int errnum, char *buf, size_t buflen);
                               /* GNU-specific strerror_r() */

#define _XOPEN_SOURCE 600
 #include <string.h>

int strerror_r(int errnum, char *buf, size_t buflen);
                          /* XSI-compliant strerror_r() */



commoncpp library assumes the XSI compliant variant. But during build =
the GNU variant is chosen. The GNU variant takes the first parameter but =
doesn't put text in it.


My question now is, why does configure not sort this out for us? Can I =
build a correct working commoncpp library without changing source code =
(exception.cpp) or build configuration files myself?

Is this mailing list still alive btw?

All the best from Holland,
Gunnar









On Oct 3, 2011, at 11:50 AM, Gunnar Harms wrote:

> Hello list,
>=20
> I am migrating a program from Mac OS-X to Linux and have some issues =
with Socket/SockException classes. On both Mac OS-X as well as Linux the =
commoncpp libs were built with configure script. Before posting the =
actual build configurations I'll just show you the issue, and perhaps =
someone immediately recognizes the cause of my issue.
>=20
>=20
> When the application catches a SockException it logs for example:
>=20
> 	catch (SockException& e) {
> 		log(string("processNextMessage() : caught a =
SockException: ") + e.getString() + ": " + e.getSystemErrorString());
> 	}
>=20
>=20
>=20
> On Mac OS-X this give log lines like:
>=20
> processNextMessage() : caught a SockException during connect(): Could =
not connect to remote host: Connection refused
>=20
>=20
>=20
>=20
> But on Linux I see in log file like:
>=20
> processNextMessage() : caught a SockException: Could not connect to =
remote host: ?u?0
>=20
>=20
>=20
> So, the getSystemErrorString() returned "?u?0" in this case, but this =
varies but is always garbage (eg. "P??0", "?" etc.)
>=20
>=20
>=20
> Version of commoncpp is 2-1.8.0 and uname -msr tells me that the Linux =
version is Linux 2.6.18-128.el5 x86_64.
>=20
> Thank you for your time.
>=20
> Gunnar
>=20



