summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>1999-07-13 03:07:38 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>1999-07-13 03:07:38 +0000
commitdf6f997948f0909dec5125dd1969d41e5487629c (patch)
tree53618b62b94225bc1e1bf8b19a1ae4914dafbdd8 /TAO/tao
parent906e7606408fa2d622a448ecd8ec203f70f229a4 (diff)
downloadATCD-df6f997948f0909dec5125dd1969d41e5487629c.tar.gz
Debugging output was attempting to print the name of the object
found in the object key, which isn't null terminated. However, due to performance considerations, that string is not copied. Only pointer to the object_key is used during the IOR lookup. Hence, the string *cannot* be null terminated since doing so would modify the contents of the object key. For the moment, the only solution is to remove the debugging output entirely. [Bug 56]
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/GIOP.cpp15
-rw-r--r--TAO/tao/IOR_LookupTable.cpp14
-rw-r--r--TAO/tao/ORB.cpp31
3 files changed, 44 insertions, 16 deletions
diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp
index 6711c61156d..490cafc4964 100644
--- a/TAO/tao/GIOP.cpp
+++ b/TAO/tao/GIOP.cpp
@@ -983,10 +983,17 @@ TAO_GIOP::process_server_request (TAO_Transport *transport,
0,
0);
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- "Simple Object key %s. Doing the Table Lookup ...\n",
- object_id.c_str ()));
+ // @@ This debugging output should *NOT* be used since the
+ // object key string is not null terminated, nor can it
+ // be null terminated without copying. No copying should
+ // be done since performance is somewhat important here.
+ // So, just remove the debugging output entirely.
+ //
+ // if (TAO_debug_level > 0)
+ // ACE_DEBUG ((LM_DEBUG,
+ // "Simple Object key %s. "
+ // "Doing the Table Lookup ...\n",
+ // object_id.c_str ()));
CORBA::Object_ptr object_reference =
CORBA::Object::_nil ();
diff --git a/TAO/tao/IOR_LookupTable.cpp b/TAO/tao/IOR_LookupTable.cpp
index c3fe0ab115f..1fb3bbe9296 100644
--- a/TAO/tao/IOR_LookupTable.cpp
+++ b/TAO/tao/IOR_LookupTable.cpp
@@ -59,10 +59,16 @@ TAO_IOR_LookupTable::find_ior (const ACE_CString &object_name,
// returns 0 on success.
// -1 on failure.
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- "TAO (%P|%t) IOR Table find <%s>\n",
- object_name.c_str ()));
+ // @@ This debugging output should *NOT* be used since the
+ // object key string is not null terminated, nor can it
+ // be null terminated without copying. No copying should
+ // be done since performance is somewhat important here.
+ // So, just remove the debugging output entirely.
+ //
+ // if (TAO_debug_level > 0)
+ // ACE_DEBUG ((LM_DEBUG,
+ // "TAO (%P|%t) IOR Table find <%s>\n",
+ // object_name.c_str ()));
return this->hash_map_.find (object_name, ior);
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp
index b6ac04115d9..62c8322c377 100644
--- a/TAO/tao/ORB.cpp
+++ b/TAO/tao/ORB.cpp
@@ -1781,7 +1781,7 @@ CORBA_ORB::_tao_add_to_IOR_table (const ACE_CString &object_id,
CORBA::String_var string =
this->object_to_string (obj);
- if (string.in () == 0 || string.in ()[0] == '\0')
+ if (string.in () == 0 || string[0] == '\0')
return -1;
ACE_CString ior (string.in ());
@@ -1800,17 +1800,32 @@ int
CORBA_ORB::_tao_find_in_IOR_table (const ACE_CString &object_id,
CORBA::Object_ptr &obj)
{
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t): lookup service ID <%s>\n",
- object_id.c_str ()));
+ // @@ This debugging output should *NOT* be used since the
+ // object key string is not null terminated, nor can it
+ // be null terminated without copying. No copying should
+ // be done since performance is somewhat important here.
+ // So, just remove the debugging output entirely.
+ //
+ // if (TAO_debug_level > 0)
+ // ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t): lookup service ID <%s>\n",
+ // object_id.c_str ()));
ACE_CString ior;
if (this->lookup_table_.find_ior (object_id, ior) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO (%P|%t) cannot find IOR for <%s>\n",
- object_id.c_str ()),
- -1);
+ {
+ // @@ This debugging output should *NOT* be used since the
+ // object key string is not null terminated, nor can it
+ // be null terminated without copying. No copying should
+ // be done since performance is somewhat important here.
+ // So, just remove the debugging output entirely.
+ //
+ // ACE_ERROR_RETURN ((LM_ERROR,
+ // "TAO (%P|%t) cannot find IOR for <%s>\n",
+ // object_id.c_str ()),
+ // -1);
+ return -1;
+ }
obj = this->string_to_object (ior.c_str ());