瀏覽代碼

HPCC-9483 Valgrind complains about remotefile's hashtable of endpoints

Because of uninitialized dead space in the SocketEndpoint structure, must
suply hash functions whenever used as the key to a hash table rather than
relying on the default implementation.

Not sure what effect this would have had - probably means that the critsec
designed to prevent multiple simultaneous transactions on the same remote
socket might sometimes have failed to fully protect.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 年之前
父節點
當前提交
d454b257ba
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      common/remote/sockfile.cpp

+ 11 - 0
common/remote/sockfile.cpp

@@ -1547,6 +1547,17 @@ public:
         }
         return clientCrit.getClear();
     }
+    unsigned getHashFromElement(const void *e) const
+    {
+        const CEndpointCS &elem=*(const CEndpointCS *)e;
+        return getHashFromFindParam(elem.queryFindParam());
+    }
+
+    unsigned getHashFromFindParam(const void *fp) const
+    {
+        return ((const SocketEndpoint *)fp)->hash(0);
+    }
+
     void removeExact(CEndpointCS *clientCrit)
     {
         CriticalBlock b(crit);