From 4b58831a0a1fd5b1bd51bf6ec8d76b3fd02bcc5f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 28 Dec 2009 01:38:22 +0000 Subject: [PATCH] 2009-12-28 02:36 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/common/hbtrace.c ! Readded hack to disable reentrancy for win specific trace logic until we clear up the issue with some Harbour API calls used from win specific trace code are calling back to the trace engine. --- harbour/ChangeLog | 6 ++++++ harbour/src/common/hbtrace.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fdd4c3b1b5..5d99b8ddf7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,12 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-28 02:36 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/common/hbtrace.c + ! Readded hack to disable reentrancy for win specific trace logic + until we clear up the issue with some Harbour API calls used from + win specific trace code are calling back to the trace engine. + 2009-12-28 01:56 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/common/hbtrace.c ! Fixed to not call hb_xgrab() via HB_TRACE_CONVTO() causing diff --git a/harbour/src/common/hbtrace.c b/harbour/src/common/hbtrace.c index f784afeef4..533fb5de0c 100644 --- a/harbour/src/common/hbtrace.c +++ b/harbour/src/common/hbtrace.c @@ -230,6 +230,11 @@ static void hb_tracelog_( int level, const char * file, int line, const char * p char buffer1[ 1024 ]; char buffer2[ 1024 ]; + /* NOTE: Hack to avoid reentrancy when hb_[v]snprintf() happens to + make a call to hb_xgrab() (or other Harbour APIs) which in + turn call trace engine again. */ + s_winout = 0; + hb_vsnprintf( buffer1, sizeof( buffer1 ), fmt, ap ); /* We add \r\n at the end of the buffer to make WinDbg display look readable. */ @@ -249,6 +254,8 @@ static void hb_tracelog_( int level, const char * file, int line, const char * p #else OutputDebugString( buffer2 ); #endif + + s_winout = 1; } #endif