zeroc-ice 3.8.2 → 3.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/dist/IceRuby/Communicator.cpp +26 -9
  3. data/dist/IceRuby/Config.h +0 -12
  4. data/dist/IceRuby/Connection.cpp +18 -9
  5. data/dist/IceRuby/DefaultSliceLoader.h +1 -1
  6. data/dist/IceRuby/Endpoint.cpp +21 -8
  7. data/dist/IceRuby/Operation.cpp +7 -5
  8. data/dist/IceRuby/Properties.cpp +3 -4
  9. data/dist/IceRuby/Proxy.cpp +11 -19
  10. data/dist/IceRuby/RubySliceLoader.cpp +1 -1
  11. data/dist/IceRuby/RubySliceLoader.h +6 -0
  12. data/dist/IceRuby/Types.cpp +162 -138
  13. data/dist/IceRuby/Types.h +68 -28
  14. data/dist/IceRuby/Util.cpp +14 -78
  15. data/dist/IceRuby/Util.h +7 -17
  16. data/dist/ice/cpp/include/Ice/Communicator.h +31 -8
  17. data/dist/ice/cpp/include/Ice/Config.h +2 -2
  18. data/dist/ice/cpp/include/Ice/Connection.h +24 -8
  19. data/dist/ice/cpp/include/Ice/CtrlCHandler.h +1 -1
  20. data/dist/ice/cpp/include/Ice/Demangle.h +1 -1
  21. data/dist/ice/cpp/include/Ice/Endpoint.h +4 -4
  22. data/dist/ice/cpp/include/Ice/Initialize.h +4 -4
  23. data/dist/ice/cpp/include/Ice/InputStream.h +5 -5
  24. data/dist/ice/cpp/include/Ice/Instrumentation.h +13 -7
  25. data/dist/ice/cpp/include/Ice/LocalExceptions.h +5 -5
  26. data/dist/ice/cpp/include/Ice/Logger.h +7 -0
  27. data/dist/ice/cpp/include/Ice/LoggerUtil.h +1 -1
  28. data/dist/ice/cpp/include/Ice/Object.h +10 -8
  29. data/dist/ice/cpp/include/Ice/ObjectAdapter.h +1 -1
  30. data/dist/ice/cpp/include/Ice/OutgoingAsync.h +5 -2
  31. data/dist/ice/cpp/include/Ice/OutgoingResponse.h +2 -1
  32. data/dist/ice/cpp/include/Ice/OutputStream.h +7 -6
  33. data/dist/ice/cpp/include/Ice/PluginFactory.h +1 -1
  34. data/dist/ice/cpp/include/Ice/Properties.h +3 -3
  35. data/dist/ice/cpp/include/Ice/Proxy.h +192 -50
  36. data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +3 -3
  37. data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +1 -1
  38. data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +5 -5
  39. data/dist/ice/cpp/include/Ice/ServantLocator.h +1 -1
  40. data/dist/ice/cpp/include/Ice/Service.h +2 -5
  41. data/dist/ice/cpp/include/Ice/SliceLoader.h +1 -1
  42. data/dist/ice/cpp/include/Ice/SlicedData.h +5 -3
  43. data/dist/ice/cpp/include/Ice/StreamHelpers.h +1 -1
  44. data/dist/ice/cpp/include/Ice/StreamableTraits.h +2 -2
  45. data/dist/ice/cpp/include/Ice/StringConverter.h +2 -3
  46. data/dist/ice/cpp/include/Ice/StringUtil.h +2 -7
  47. data/dist/ice/cpp/include/Ice/UUID.h +1 -0
  48. data/dist/ice/cpp/include/Ice/Value.h +2 -2
  49. data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
  50. data/dist/ice/cpp/include/generated/Ice/Context.h +2 -2
  51. data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
  52. data/dist/ice/cpp/include/generated/Ice/Identity.h +2 -2
  53. data/dist/ice/cpp/include/generated/Ice/Locator.h +50 -14
  54. data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +38 -11
  55. data/dist/ice/cpp/include/generated/Ice/Metrics.h +94 -39
  56. data/dist/ice/cpp/include/generated/Ice/OperationMode.h +2 -2
  57. data/dist/ice/cpp/include/generated/Ice/Process.h +34 -8
  58. data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +42 -11
  59. data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +2 -2
  60. data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +93 -40
  61. data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +2 -2
  62. data/dist/ice/cpp/include/generated/Ice/Router.h +50 -14
  63. data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
  64. data/dist/ice/cpp/include/generated/Ice/Version.h +2 -2
  65. data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +66 -14
  66. data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +34 -8
  67. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +1 -1
  68. data/dist/ice/cpp/src/Ice/Base64.cpp +47 -137
  69. data/dist/ice/cpp/src/Ice/Base64.h +2 -2
  70. data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +28 -13
  71. data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +5 -1
  72. data/dist/ice/cpp/src/Ice/Buffer.cpp +1 -1
  73. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +1 -1
  74. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +1 -1
  75. data/dist/ice/cpp/src/Ice/Communicator.cpp +4 -3
  76. data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +8 -0
  77. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +5 -15
  78. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +1 -1
  79. data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +6 -8
  80. data/dist/ice/cpp/src/Ice/ConnectionFactory.h +0 -3
  81. data/dist/ice/cpp/src/Ice/ConnectionI.cpp +94 -99
  82. data/dist/ice/cpp/src/Ice/ConnectionI.h +11 -8
  83. data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +1 -1
  84. data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +10 -14
  85. data/dist/ice/cpp/src/Ice/EndpointI.h +1 -1
  86. data/dist/ice/cpp/src/Ice/FileUtil.cpp +12 -12
  87. data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +1 -1
  88. data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +1 -1
  89. data/dist/ice/cpp/src/Ice/HttpParser.h +0 -2
  90. data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +6 -3
  91. data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +1 -3
  92. data/dist/ice/cpp/src/Ice/InputStream.cpp +23 -19
  93. data/dist/ice/cpp/src/Ice/Instance.cpp +73 -50
  94. data/dist/ice/cpp/src/Ice/Instance.h +1 -6
  95. data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +1 -1
  96. data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +2 -2
  97. data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +13 -18
  98. data/dist/ice/cpp/src/Ice/LoggerI.cpp +1 -1
  99. data/dist/ice/cpp/src/Ice/LoggerI.h +2 -2
  100. data/dist/ice/cpp/src/Ice/MetricsAdminI.h +6 -1
  101. data/dist/ice/cpp/src/Ice/MetricsObserverI.h +22 -18
  102. data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +5 -2
  103. data/dist/ice/cpp/src/Ice/Network.cpp +168 -103
  104. data/dist/ice/cpp/src/Ice/Network.h +12 -7
  105. data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +17 -6
  106. data/dist/ice/cpp/src/Ice/NetworkProxy.h +2 -1
  107. data/dist/ice/cpp/src/Ice/Object.cpp +1 -1
  108. data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +56 -19
  109. data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +10 -10
  110. data/dist/ice/cpp/src/Ice/Options.cpp +7 -2
  111. data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +1 -1
  112. data/dist/ice/cpp/src/Ice/OutputStream.cpp +4 -4
  113. data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +7 -1
  114. data/dist/ice/cpp/src/Ice/Properties.cpp +26 -16
  115. data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +1 -1
  116. data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -11
  117. data/dist/ice/cpp/src/Ice/ProtocolInstance.h +1 -2
  118. data/dist/ice/cpp/src/Ice/Proxy.cpp +9 -1
  119. data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +110 -13
  120. data/dist/ice/cpp/src/Ice/Random.cpp +68 -7
  121. data/dist/ice/cpp/src/Ice/Random.h +6 -2
  122. data/dist/ice/cpp/src/Ice/Reference.cpp +22 -11
  123. data/dist/ice/cpp/src/Ice/Reference.h +3 -0
  124. data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +10 -0
  125. data/dist/ice/cpp/src/Ice/RequestHandler.h +3 -1
  126. data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +1 -1
  127. data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +1 -1
  128. data/dist/ice/cpp/src/Ice/ResourceConfig.h +3 -3
  129. data/dist/ice/cpp/src/Ice/RetryQueue.cpp +8 -12
  130. data/dist/ice/cpp/src/Ice/SHA1.cpp +11 -11
  131. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +0 -6
  132. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +0 -6
  133. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +15 -1
  134. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +77 -27
  135. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +2 -1
  136. data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +2 -2
  137. data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +39 -34
  138. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +130 -52
  139. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +64 -33
  140. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +0 -1
  141. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +3 -3
  142. data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +9 -3
  143. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +73 -51
  144. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +0 -8
  145. data/dist/ice/cpp/src/Ice/Selector.cpp +13 -11
  146. data/dist/ice/cpp/src/Ice/ServantManager.cpp +3 -3
  147. data/dist/ice/cpp/src/Ice/Service.cpp +33 -115
  148. data/dist/ice/cpp/src/Ice/StreamSocket.cpp +33 -40
  149. data/dist/ice/cpp/src/Ice/StreamSocket.h +4 -4
  150. data/dist/ice/cpp/src/Ice/StringConverter.cpp +1 -1
  151. data/dist/ice/cpp/src/Ice/StringUtil.cpp +12 -21
  152. data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +136 -100
  153. data/dist/ice/cpp/src/Ice/SysLoggerI.h +7 -3
  154. data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +1 -1
  155. data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +7 -7
  156. data/dist/ice/cpp/src/Ice/TcpAcceptor.h +2 -1
  157. data/dist/ice/cpp/src/Ice/TcpBufSize.h +40 -0
  158. data/dist/ice/cpp/src/Ice/TcpConnector.cpp +5 -2
  159. data/dist/ice/cpp/src/Ice/TcpConnector.h +2 -0
  160. data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +6 -2
  161. data/dist/ice/cpp/src/Ice/ThreadPool.cpp +2 -8
  162. data/dist/ice/cpp/src/Ice/ThreadPool.h +0 -2
  163. data/dist/ice/cpp/src/Ice/Timer.cpp +7 -3
  164. data/dist/ice/cpp/src/Ice/UUID.cpp +1 -2
  165. data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +4 -1
  166. data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +136 -123
  167. data/dist/ice/cpp/src/Ice/UdpTransceiver.h +3 -4
  168. data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +96 -27
  169. data/dist/ice/cpp/src/Ice/WSTransceiver.h +1 -1
  170. data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
  171. data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
  172. data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
  173. data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
  174. data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
  175. data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
  176. data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
  177. data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
  178. data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
  179. data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
  180. data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
  181. data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
  182. data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +2 -2
  183. data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
  184. data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
  185. data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
  186. data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +47 -9
  187. data/dist/ice/cpp/src/IceDiscovery/LookupI.h +8 -3
  188. data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
  189. data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +43 -14
  190. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
  191. data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +26 -20
  192. data/dist/ice/cpp/src/Slice/DocCommentParser.h +2 -2
  193. data/dist/ice/cpp/src/Slice/FileTracker.cpp +3 -11
  194. data/dist/ice/cpp/src/Slice/FileTracker.h +0 -2
  195. data/dist/ice/cpp/src/Slice/Grammar.cpp +211 -210
  196. data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +10 -9
  197. data/dist/ice/cpp/src/Slice/Parser.cpp +28 -20
  198. data/dist/ice/cpp/src/Slice/Parser.h +3 -4
  199. data/dist/ice/cpp/src/Slice/Preprocessor.cpp +3 -11
  200. data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -2
  201. data/dist/ice/cpp/src/Slice/Scanner.cpp +3 -3
  202. data/dist/ice/cpp/src/Slice/SliceUtil.cpp +197 -114
  203. data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -2
  204. data/dist/ice/cpp/src/Slice/Util.h +21 -9
  205. data/dist/ice/cpp/src/slice2rb/Ruby.cpp +7 -3
  206. data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +16 -12
  207. data/dist/ice/cpp/src/slice2rb/RubyUtil.h +3 -3
  208. data/dist/ice/slice/Glacier2/Router.ice +3 -3
  209. data/dist/ice/slice/Ice/Metrics.ice +6 -5
  210. data/dist/ice/slice/Ice/RemoteLogger.ice +5 -5
  211. data/dist/ice/slice/IceGrid/Admin.ice +9 -9
  212. data/dist/ice/slice/IceGrid/Descriptor.ice +5 -5
  213. data/dist/ice/slice/IceStorm/Metrics.ice +1 -1
  214. data/dist/lib/Glacier2/Metrics.rb +1 -1
  215. data/dist/lib/Glacier2/PermissionsVerifier.rb +1 -1
  216. data/dist/lib/Glacier2/Router.rb +2 -2
  217. data/dist/lib/Glacier2/SSLInfo.rb +1 -1
  218. data/dist/lib/Glacier2/Session.rb +1 -1
  219. data/dist/lib/Ice/BuiltinSequences.rb +1 -1
  220. data/dist/lib/Ice/CompressBatch.rb +1 -2
  221. data/dist/lib/Ice/Context.rb +1 -1
  222. data/dist/lib/Ice/EndpointSelectionType.rb +1 -2
  223. data/dist/lib/Ice/EndpointTypes.rb +1 -1
  224. data/dist/lib/Ice/Identity.rb +1 -1
  225. data/dist/lib/Ice/IdentitySpaceship.rb +1 -0
  226. data/dist/lib/Ice/Locator.rb +1 -1
  227. data/dist/lib/Ice/LocatorRegistry.rb +1 -1
  228. data/dist/lib/Ice/Metrics.rb +1 -1
  229. data/dist/lib/Ice/OperationMode.rb +2 -3
  230. data/dist/lib/Ice/Process.rb +1 -1
  231. data/dist/lib/Ice/PropertiesAdmin.rb +1 -1
  232. data/dist/lib/Ice/PropertyDict.rb +1 -1
  233. data/dist/lib/Ice/RemoteLogger.rb +2 -3
  234. data/dist/lib/Ice/ReplyStatus.rb +2 -3
  235. data/dist/lib/Ice/Router.rb +1 -1
  236. data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
  237. data/dist/lib/Ice/SliceUtil.rb +2 -2
  238. data/dist/lib/Ice/Struct.rb +1 -0
  239. data/dist/lib/Ice/ToStringMode.rb +1 -2
  240. data/dist/lib/Ice/Value.rb +2 -2
  241. data/dist/lib/Ice/Version.rb +1 -1
  242. data/dist/lib/IceBox/ServiceManager.rb +1 -1
  243. data/dist/lib/IceGrid/Admin.rb +3 -4
  244. data/dist/lib/IceGrid/Descriptor.rb +1 -1
  245. data/dist/lib/IceGrid/Exception.rb +1 -1
  246. data/dist/lib/IceGrid/FileParser.rb +1 -1
  247. data/dist/lib/IceGrid/Registry.rb +2 -3
  248. data/dist/lib/IceGrid/Session.rb +2 -2
  249. data/dist/lib/IceGrid/UserAccountMapper.rb +1 -1
  250. data/dist/lib/IceStorm/IceStorm.rb +1 -1
  251. data/dist/lib/IceStorm/Metrics.rb +1 -1
  252. data/extconf.rb +1 -1
  253. data/ice.gemspec +3 -3
  254. metadata +4 -5
  255. data/dist/ice/cpp/src/Ice/DLLMain.cpp +0 -40
  256. data/dist/ice/cpp/src/Ice/UndefSysMacros.h +0 -37
@@ -243,7 +243,8 @@ Ice::InputStream::startEncapsulation()
243
243
  {
244
244
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
245
245
  }
246
- if (i - sizeof(std::int32_t) + sz > b.end())
246
+ // sz includes the 4 bytes of the size itself, which we've already read.
247
+ if (sz - 4 > b.end() - i)
247
248
  {
248
249
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
249
250
  }
@@ -305,7 +306,8 @@ Ice::InputStream::skipEmptyEncapsulation()
305
306
  {
306
307
  throw MarshalException{__FILE__, __LINE__, to_string(sz) + " is not a valid encapsulation size"};
307
308
  }
308
- if (i - sizeof(std::int32_t) + sz > b.end())
309
+ // sz includes the 4 bytes of the size itself, which we've already read.
310
+ if (sz - 4 > b.end() - i)
309
311
  {
310
312
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
311
313
  }
@@ -342,7 +344,8 @@ Ice::InputStream::readEncapsulation(const std::byte*& v, std::int32_t& sz)
342
344
  {
343
345
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
344
346
  }
345
- if (i - sizeof(std::int32_t) + sz > b.end())
347
+ // sz includes the 4 bytes of the size itself, which we've already read.
348
+ if (sz - 4 > b.end() - i)
346
349
  {
347
350
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
348
351
  }
@@ -368,7 +371,8 @@ Ice::InputStream::skipEncapsulation()
368
371
  {
369
372
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
370
373
  }
371
- if (i - sizeof(int32_t) + sz > b.end())
374
+ // sz includes the 4 bytes of the size itself, which we've already read.
375
+ if (sz - 4 > b.end() - i)
372
376
  {
373
377
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
374
378
  }
@@ -446,7 +450,7 @@ Ice::InputStream::readAndCheckSeqSize(int minSize)
446
450
  //
447
451
  // If there isn't enough data to read on the stream for the sequence (and
448
452
  // possibly enclosed sequences), something is wrong with the marshaled
449
- // data: it's claiming having more data that what is possible to read.
453
+ // data: it's claiming to have more data than what is possible to read.
450
454
  //
451
455
  if (_startSeq + minSeqSize > static_cast<int64_t>(b.size()))
452
456
  {
@@ -598,7 +602,7 @@ Ice::InputStream::read(vector<int16_t>& v)
598
602
  if constexpr (endian::native == endian::big)
599
603
  {
600
604
  const byte* src = &(*begin);
601
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int16_t) - 1;
605
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(int16_t) - 1;
602
606
  for (int j = 0; j < sz; ++j)
603
607
  {
604
608
  *dest-- = *src++;
@@ -608,7 +612,7 @@ Ice::InputStream::read(vector<int16_t>& v)
608
612
  }
609
613
  else
610
614
  {
611
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
615
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
612
616
  }
613
617
  }
614
618
  else
@@ -656,7 +660,7 @@ Ice::InputStream::read(vector<int32_t>& v)
656
660
  if constexpr (endian::native == endian::big)
657
661
  {
658
662
  const byte* src = &(*begin);
659
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int32_t) - 1;
663
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(int32_t) - 1;
660
664
  for (int j = 0; j < sz; ++j)
661
665
  {
662
666
  *dest-- = *src++;
@@ -668,7 +672,7 @@ Ice::InputStream::read(vector<int32_t>& v)
668
672
  }
669
673
  else
670
674
  {
671
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
675
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
672
676
  }
673
677
  }
674
678
  else
@@ -724,7 +728,7 @@ Ice::InputStream::read(vector<int64_t>& v)
724
728
  if constexpr (endian::native == endian::big)
725
729
  {
726
730
  const byte* src = &(*begin);
727
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int64_t) - 1;
731
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(int64_t) - 1;
728
732
  for (int j = 0; j < sz; ++j)
729
733
  {
730
734
  *dest-- = *src++;
@@ -740,7 +744,7 @@ Ice::InputStream::read(vector<int64_t>& v)
740
744
  }
741
745
  else
742
746
  {
743
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
747
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
744
748
  }
745
749
  }
746
750
  else
@@ -788,7 +792,7 @@ Ice::InputStream::read(vector<float>& v)
788
792
  if constexpr (endian::native == endian::big)
789
793
  {
790
794
  const byte* src = &(*begin);
791
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(float) - 1;
795
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(float) - 1;
792
796
  for (int j = 0; j < sz; ++j)
793
797
  {
794
798
  *dest-- = *src++;
@@ -800,7 +804,7 @@ Ice::InputStream::read(vector<float>& v)
800
804
  }
801
805
  else
802
806
  {
803
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
807
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
804
808
  }
805
809
  }
806
810
  else
@@ -856,7 +860,7 @@ Ice::InputStream::read(vector<double>& v)
856
860
  if constexpr (endian::native == endian::big)
857
861
  {
858
862
  const byte* src = &(*begin);
859
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(double) - 1;
863
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(double) - 1;
860
864
  for (int j = 0; j < sz; ++j)
861
865
  {
862
866
  *dest-- = *src++;
@@ -872,7 +876,7 @@ Ice::InputStream::read(vector<double>& v)
872
876
  }
873
877
  else
874
878
  {
875
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
879
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
876
880
  }
877
881
  }
878
882
  else
@@ -1143,7 +1147,7 @@ Ice::InputStream::readOptImpl(int32_t readTag, OptionalFormat expectedFormat)
1143
1147
  auto tag = static_cast<int32_t>(v >> 3);
1144
1148
  if (tag > 30)
1145
1149
  {
1146
- // We check for '> 30' instead of '> 29' because 30 is special sentinel tag, handled by the next block.
1150
+ // We check for '> 30' instead of '> 29' because 30 is a special sentinel tag, handled by the next block.
1147
1151
  ostringstream os;
1148
1152
  os << "invalid tag '" << tag << "': tags larger than 29 must be encoded as a size";
1149
1153
  throw MarshalException(__FILE__, __LINE__, os.str());
@@ -1460,7 +1464,7 @@ Ice::InputStream::EncapsDecoder10::read(PatchFunc patchFunc, void* patchAddr)
1460
1464
  //
1461
1465
  int32_t index;
1462
1466
  _stream->read(index);
1463
- if (index > 0)
1467
+ if (index > 0 || index == INT32_MIN)
1464
1468
  {
1465
1469
  throw MarshalException(__FILE__, __LINE__, "invalid object id");
1466
1470
  }
@@ -1486,7 +1490,7 @@ Ice::InputStream::EncapsDecoder10::throwException(UserExceptionFactory exception
1486
1490
  assert(_sliceType == NoSlice);
1487
1491
 
1488
1492
  //
1489
- // User exception with the 1.0 encoding start with a boolean flag
1493
+ // User exceptions with the 1.0 encoding start with a boolean flag
1490
1494
  // that indicates whether or not the exception has classes.
1491
1495
  //
1492
1496
  // This allows reading the pending values even if some part of
@@ -2102,7 +2106,7 @@ Ice::InputStream::EncapsDecoder11::readInstance(int32_t index, const PatchFunc&
2102
2106
 
2103
2107
  //
2104
2108
  // Get the object ID before we start reading slices. If some
2105
- // slices are skiped, the indirect object table are still read and
2109
+ // slices are skipped, the indirect object table is still read and
2106
2110
  // might read other instances.
2107
2111
  //
2108
2112
  index = ++_valueIdIndex;
@@ -66,7 +66,6 @@
66
66
  # include <csignal>
67
67
  # include <pwd.h>
68
68
  # include <sys/types.h>
69
- # include <syslog.h>
70
69
  #endif
71
70
 
72
71
  #if defined(__linux__) || defined(__GLIBC__)
@@ -87,7 +86,6 @@ namespace
87
86
  struct sigaction oldAction;
88
87
  #endif
89
88
  bool printProcessIdDone = false;
90
- string identForOpenlog;
91
89
 
92
90
  //
93
91
  // Should be called with staticMutex locked
@@ -617,7 +615,7 @@ IceInternal::Instance::createAdmin(const ObjectAdapterPtr& adminAdapter, const I
617
615
  catch (...)
618
616
  {
619
617
  //
620
- // We clean it up, even through this error is not recoverable
618
+ // We clean it up, even though this error is not recoverable
621
619
  // (can't call again createAdmin after fixing the problem since all the facets
622
620
  // in the adapter are lost)
623
621
  //
@@ -676,7 +674,7 @@ IceInternal::Instance::getAdmin()
676
674
  catch (...)
677
675
  {
678
676
  //
679
- // We clean it up, even through this error is not recoverable
677
+ // We clean it up, even though this error is not recoverable
680
678
  // (can't call again createAdmin after fixing the problem since all the facets
681
679
  // in the adapter are lost)
682
680
  //
@@ -741,7 +739,7 @@ IceInternal::Instance::setServerProcessProxy(const ObjectAdapterPtr& adminAdapte
741
739
  if (_traceLevels->location >= 1)
742
740
  {
743
741
  Trace out(_initData.logger, _traceLevels->locationCat);
744
- out << "couldn't register server '" + serverId + "' with the locator registry:\n";
742
+ out << "could not register server '" + serverId + "' with the locator registry:\n";
745
743
  out << "the server is not known to the locator registry";
746
744
  }
747
745
 
@@ -755,7 +753,7 @@ IceInternal::Instance::setServerProcessProxy(const ObjectAdapterPtr& adminAdapte
755
753
  if (_traceLevels->location >= 1)
756
754
  {
757
755
  Trace out(_initData.logger, _traceLevels->locationCat);
758
- out << "couldn't register server '" + serverId + "' with the locator registry:\n" << ex;
756
+ out << "could not register server '" + serverId + "' with the locator registry:\n" << ex;
759
757
  }
760
758
  throw;
761
759
  }
@@ -919,12 +917,6 @@ IceInternal::Instance::setLogger(const Ice::LoggerPtr& logger)
919
917
  _initData.logger = logger;
920
918
  }
921
919
 
922
- void
923
- IceInternal::Instance::setThreadHook(function<void()> threadStart, function<void()> threadStop)
924
- {
925
- _initData.threadStart = std::move(threadStart);
926
- _initData.threadStop = std::move(threadStop);
927
- }
928
920
  namespace
929
921
  {
930
922
  bool logStdErrConvert = true;
@@ -1026,15 +1018,6 @@ IceInternal::Instance::initialize(const Ice::CommunicatorPtr& communicator)
1026
1018
  sigemptyset(&action.sa_mask);
1027
1019
  action.sa_flags = 0;
1028
1020
  sigaction(SIGPIPE, &action, &oldAction);
1029
- if (_initData.properties->getIcePropertyAsInt("Ice.UseSyslog") > 0)
1030
- {
1031
- identForOpenlog = programName;
1032
- if (identForOpenlog.empty())
1033
- {
1034
- identForOpenlog = "<Unknown Ice Program>";
1035
- }
1036
- openlog(identForOpenlog.c_str(), LOG_PID, LOG_USER);
1037
- }
1038
1021
  #else
1039
1022
  logStdErrConvert = _initData.properties->getIcePropertyAsInt("Ice.LogStdErr.Convert") > 0 &&
1040
1023
  _initData.properties->getIceProperty("Ice.StdErr").empty();
@@ -1050,7 +1033,7 @@ IceInternal::Instance::initialize(const Ice::CommunicatorPtr& communicator)
1050
1033
  {
1051
1034
  if (!logfile.empty())
1052
1035
  {
1053
- throw InitializationException(__FILE__, __LINE__, "Both syslog and file logger cannot be enabled.");
1036
+ throw InitializationException(__FILE__, __LINE__, "cannot enable both syslog and file logger");
1054
1037
  }
1055
1038
 
1056
1039
  _initData.logger =
@@ -1185,6 +1168,10 @@ IceInternal::Instance::initialize(const Ice::CommunicatorPtr& communicator)
1185
1168
 
1186
1169
  const_cast<bool&>(_acceptClassCycles) = _initData.properties->getIcePropertyAsInt("Ice.AcceptClassCycles") > 0;
1187
1170
 
1171
+ // Read here (not in the noexcept destroy) so an invalid value is reported when the communicator is created.
1172
+ const_cast<bool&>(_warnUnusedProperties) =
1173
+ _initData.properties->getIcePropertyAsInt("Ice.Warn.UnusedProperties") > 0;
1174
+
1188
1175
  string implicitContextKind = _initData.properties->getIceProperty("Ice.ImplicitContext");
1189
1176
  if (implicitContextKind == "Shared")
1190
1177
  {
@@ -1218,7 +1205,7 @@ IceInternal::Instance::initialize(const Ice::CommunicatorPtr& communicator)
1218
1205
  const bool ipv6 = isIPv6Supported ? (_initData.properties->getIcePropertyAsInt("Ice.IPv6") > 0) : false;
1219
1206
  if (!ipv4 && !ipv6)
1220
1207
  {
1221
- throw InitializationException(__FILE__, __LINE__, "Both IPV4 and IPv6 support cannot be disabled.");
1208
+ throw InitializationException(__FILE__, __LINE__, "cannot disable both IPv4 and IPv6 support");
1222
1209
  }
1223
1210
  else if (ipv4 && ipv6)
1224
1211
  {
@@ -1258,20 +1245,26 @@ IceInternal::Instance::initialize(const Ice::CommunicatorPtr& communicator)
1258
1245
  istringstream value(retryValue);
1259
1246
 
1260
1247
  int v;
1261
- if (!(value >> v) || !value.eof())
1262
- {
1263
- v = 0;
1264
- }
1248
+ bool parsed = static_cast<bool>(value >> v) && value.eof();
1265
1249
 
1266
1250
  //
1267
1251
  // If -1 is the first value, no retry and wait intervals.
1268
1252
  //
1269
- if (v == -1 && _retryIntervals.empty())
1253
+ if (parsed && v == -1 && _retryIntervals.empty())
1270
1254
  {
1271
1255
  break;
1272
1256
  }
1273
1257
 
1274
- _retryIntervals.push_back(v > 0 ? v : 0);
1258
+ // Any value that is not a non-negative integer (or the leading -1 handled above) is invalid and
1259
+ // treated as 0.
1260
+ if (!parsed || v < 0)
1261
+ {
1262
+ Warning out(_initData.logger);
1263
+ out << "invalid value '" << retryValue << "' in property Ice.RetryIntervals, assuming 0";
1264
+ v = 0;
1265
+ }
1266
+
1267
+ _retryIntervals.push_back(v);
1275
1268
  }
1276
1269
  }
1277
1270
 
@@ -1373,12 +1366,6 @@ IceInternal::Instance::~Instance()
1373
1366
 
1374
1367
  #ifndef _WIN32
1375
1368
  sigaction(SIGPIPE, &oldAction, nullptr);
1376
-
1377
- if (!identForOpenlog.empty())
1378
- {
1379
- closelog();
1380
- identForOpenlog.clear();
1381
- }
1382
1369
  #endif
1383
1370
  }
1384
1371
  }
@@ -1733,7 +1720,7 @@ IceInternal::Instance::destroy() noexcept
1733
1720
  _locatorManager->destroy();
1734
1721
  }
1735
1722
 
1736
- if (_initData.properties->getIcePropertyAsInt("Ice.Warn.UnusedProperties") > 0)
1723
+ if (_warnUnusedProperties)
1737
1724
  {
1738
1725
  set<string> unusedProperties = _initData.properties.get()->getUnusedProperties();
1739
1726
  if (unusedProperties.size() != 0)
@@ -1819,10 +1806,25 @@ IceInternal::Instance::updateConnectionObservers()
1819
1806
  {
1820
1807
  try
1821
1808
  {
1822
- assert(_outgoingConnectionFactory);
1823
- _outgoingConnectionFactory->updateConnectionObservers();
1824
- assert(_objectAdapterFactory);
1825
- _objectAdapterFactory->updateObservers(&ObjectAdapterI::updateConnectionObservers);
1809
+ // This updater can run concurrently with destroy(). Copy the subsystem pointers under the mutex, and bail out
1810
+ // once destruction has started: destroy() tears down these subsystems (while _state is StateDestroyInProgress)
1811
+ // before nulling them (when it sets _state to StateDestroyed).
1812
+ OutgoingConnectionFactoryPtr outgoingConnectionFactory;
1813
+ ObjectAdapterFactoryPtr objectAdapterFactory;
1814
+ {
1815
+ lock_guard lock(_mutex);
1816
+ if (_state >= StateDestroyInProgress)
1817
+ {
1818
+ return;
1819
+ }
1820
+ outgoingConnectionFactory = _outgoingConnectionFactory;
1821
+ objectAdapterFactory = _objectAdapterFactory;
1822
+ }
1823
+
1824
+ assert(outgoingConnectionFactory);
1825
+ outgoingConnectionFactory->updateConnectionObservers();
1826
+ assert(objectAdapterFactory);
1827
+ objectAdapterFactory->updateObservers(&ObjectAdapterI::updateConnectionObservers);
1826
1828
  }
1827
1829
  catch (const Ice::CommunicatorDestroyedException&)
1828
1830
  {
@@ -1834,23 +1836,44 @@ IceInternal::Instance::updateThreadObservers()
1834
1836
  {
1835
1837
  try
1836
1838
  {
1837
- if (_clientThreadPool)
1839
+ // This updater can run concurrently with destroy(). Copy the subsystem pointers under the mutex, and bail out
1840
+ // once destruction has started: destroy() tears down these subsystems (while _state is StateDestroyInProgress)
1841
+ // before nulling them (when it sets _state to StateDestroyed).
1842
+ ThreadPoolPtr clientThreadPool;
1843
+ ThreadPoolPtr serverThreadPool;
1844
+ ObjectAdapterFactoryPtr objectAdapterFactory;
1845
+ EndpointHostResolverPtr endpointHostResolver;
1846
+ ThreadObserverTimerPtr timer;
1847
+ {
1848
+ lock_guard lock(_mutex);
1849
+ if (_state >= StateDestroyInProgress)
1850
+ {
1851
+ return;
1852
+ }
1853
+ clientThreadPool = _clientThreadPool;
1854
+ serverThreadPool = _serverThreadPool;
1855
+ objectAdapterFactory = _objectAdapterFactory;
1856
+ endpointHostResolver = _endpointHostResolver;
1857
+ timer = _timer;
1858
+ }
1859
+
1860
+ if (clientThreadPool)
1838
1861
  {
1839
- _clientThreadPool->updateObservers();
1862
+ clientThreadPool->updateObservers();
1840
1863
  }
1841
- if (_serverThreadPool)
1864
+ if (serverThreadPool)
1842
1865
  {
1843
- _serverThreadPool->updateObservers();
1866
+ serverThreadPool->updateObservers();
1844
1867
  }
1845
- assert(_objectAdapterFactory);
1846
- _objectAdapterFactory->updateObservers(&ObjectAdapterI::updateThreadObservers);
1847
- if (_endpointHostResolver)
1868
+ assert(objectAdapterFactory);
1869
+ objectAdapterFactory->updateObservers(&ObjectAdapterI::updateThreadObservers);
1870
+ if (endpointHostResolver)
1848
1871
  {
1849
- _endpointHostResolver->updateObserver();
1872
+ endpointHostResolver->updateObserver();
1850
1873
  }
1851
- if (_timer)
1874
+ if (timer)
1852
1875
  {
1853
- _timer->updateObserver(_initData.observer);
1876
+ timer->updateObserver(_initData.observer);
1854
1877
  }
1855
1878
  }
1856
1879
  catch (const Ice::CommunicatorDestroyedException&)
@@ -40,9 +40,6 @@ namespace IceInternal
40
40
  class ThreadObserverTimer;
41
41
  using ThreadObserverTimerPtr = std::shared_ptr<ThreadObserverTimer>;
42
42
 
43
- class MetricsAdminI;
44
- using MetricsAdminIPtr = std::shared_ptr<MetricsAdminI>;
45
-
46
43
  /// Structure to track warnings for attempts to set socket buffer sizes.
47
44
  struct BufSizeWarnInfo
48
45
  {
@@ -112,7 +109,6 @@ namespace IceInternal
112
109
  void setDefaultRouter(const std::optional<Ice::RouterPrx>&);
113
110
 
114
111
  void setLogger(const Ice::LoggerPtr&);
115
- void setThreadHook(std::function<void()>, std::function<void()>);
116
112
 
117
113
  [[nodiscard]] const Ice::StringConverterPtr& getStringConverter() const { return _stringConverter; }
118
114
  [[nodiscard]] const Ice::WstringConverterPtr& getWstringConverter() const { return _wstringConverter; }
@@ -158,6 +154,7 @@ namespace IceInternal
158
154
  const std::int32_t _classGraphDepthMax{0}; // Immutable, not reset by destroy().
159
155
  const Ice::ToStringMode _toStringMode{Ice::ToStringMode::Unicode}; // Immutable, not reset by destroy().
160
156
  const bool _acceptClassCycles{false}; // Immutable, not reset by destroy().
157
+ const bool _warnUnusedProperties{false}; // Immutable, not reset by destroy().
161
158
  Ice::ConnectionOptions _clientConnectionOptions;
162
159
  Ice::ConnectionOptions _serverConnectionOptions;
163
160
  RouterManagerPtr _routerManager;
@@ -177,7 +174,6 @@ namespace IceInternal
177
174
  ThreadObserverTimerPtr _timer;
178
175
  EndpointFactoryManagerPtr _endpointFactoryManager;
179
176
  Ice::PluginManagerPtr _pluginManager;
180
- const Ice::ImplicitContextPtr _implicitContext;
181
177
  Ice::StringConverterPtr _stringConverter;
182
178
  Ice::WstringConverterPtr _wstringConverter;
183
179
  bool _adminEnabled{false};
@@ -185,7 +181,6 @@ namespace IceInternal
185
181
  Ice::FacetMap _adminFacets;
186
182
  Ice::Identity _adminIdentity;
187
183
  std::set<std::string, std::less<>> _adminFacetFilter;
188
- IceInternal::MetricsAdminIPtr _metricsAdmin;
189
184
  std::map<std::int16_t, BufSizeWarnInfo> _setBufSizeWarn;
190
185
  std::mutex _setBufSizeWarnMutex;
191
186
  mutable std::recursive_mutex _mutex;
@@ -320,7 +320,7 @@ namespace
320
320
  {
321
321
  if (error == 0)
322
322
  {
323
- return "couldn't open file";
323
+ return "could not open file";
324
324
  }
325
325
  else
326
326
  {
@@ -661,7 +661,7 @@ IceInternal::LocatorInfo::getEndpointsException(const ReferencePtr& ref, std::ex
661
661
  if (ref->getInstance()->traceLevels()->location >= 1)
662
662
  {
663
663
  Trace out(ref->getInstance()->initializationData().logger, ref->getInstance()->traceLevels()->locationCat);
664
- out << "couldn't contact the locator to retrieve endpoints\n";
664
+ out << "could not contact the locator to retrieve endpoints\n";
665
665
  if (ref->getAdapterId().empty())
666
666
  {
667
667
  out << "well-known proxy = " << ref->toString() << "\n";
@@ -810,7 +810,7 @@ IceInternal::LocatorInfo::finishRequest(
810
810
  {
811
811
  //
812
812
  // Remove the cached references of well-known objects for which we tried
813
- // to resolved the endpoints if these endpoints are empty.
813
+ // to resolve the endpoints if these endpoints are empty.
814
814
  //
815
815
  for (const auto& wellKnownRef : wellKnownRefs)
816
816
  {
@@ -77,11 +77,6 @@ namespace
77
77
 
78
78
  using RemoteLoggerMap = map<RemoteLoggerPrx, Filters, ObjectIdentityCompare>;
79
79
 
80
- struct GetRemoteLoggerMapKey
81
- {
82
- RemoteLoggerMap::key_type operator()(const RemoteLoggerMap::value_type& val) { return val.first; }
83
- };
84
-
85
80
  RemoteLoggerMap _remoteLoggerMap;
86
81
  CommunicatorPtr _sendLogCommunicator;
87
82
  bool _destroyed{false};
@@ -515,21 +510,21 @@ namespace
515
510
  }
516
511
  }
517
512
  }
513
+ }
518
514
 
519
- //
520
- // Queue updated, now find which remote loggers want this message
521
- //
522
- for (const auto& q : _remoteLoggerMap)
523
- {
524
- const Filters& filters = q.second;
515
+ //
516
+ // Queue updated, now find which remote loggers want this message
517
+ //
518
+ for (const auto& q : _remoteLoggerMap)
519
+ {
520
+ const Filters& filters = q.second;
525
521
 
526
- if (filters.messageTypes.empty() || filters.messageTypes.count(logMessage.type) != 0)
522
+ if (filters.messageTypes.empty() || filters.messageTypes.count(logMessage.type) != 0)
523
+ {
524
+ if (logMessage.type != LogMessageType::TraceMessage || filters.traceCategories.empty() ||
525
+ filters.traceCategories.count(logMessage.traceCategory) != 0)
527
526
  {
528
- if (logMessage.type != LogMessageType::TraceMessage || filters.traceCategories.empty() ||
529
- filters.traceCategories.count(logMessage.traceCategory) != 0)
530
- {
531
- remoteLoggers.push_back(q.first);
532
- }
527
+ remoteLoggers.push_back(q.first);
533
528
  }
534
529
  }
535
530
  }
@@ -671,10 +666,10 @@ namespace
671
666
  {
672
667
  lock_guard lock(_mutex);
673
668
 
669
+ _detached.store(true);
674
670
  if (_sendLogThread.joinable())
675
671
  {
676
672
  sendLogThread = std::move(_sendLogThread);
677
- _detached.store(true);
678
673
  _conditionVariable.notify_all();
679
674
  }
680
675
  }
@@ -179,7 +179,7 @@ Ice::LoggerI::write(const string& message, bool indent)
179
179
  _nextRetry = chrono::steady_clock::now() + retryTimeout;
180
180
 
181
181
  //
182
- // We temporarily set the maximum size to 0 to ensure there isn't more rename attempts
182
+ // We temporarily set the maximum size to 0 to ensure there aren't more rename attempts
183
183
  // in the nested error call.
184
184
  //
185
185
  size_t sizeMax = _sizeMax;
@@ -36,8 +36,8 @@ namespace Ice
36
36
  std::size_t _sizeMax;
37
37
 
38
38
  //
39
- // In case of a log file rename failure is set to the time in milliseconds
40
- // after which rename could be attempted again. Otherwise is set to zero.
39
+ // In case of a log file rename failure, set to the time point after which
40
+ // the rename can be attempted again. Otherwise, set to the epoch (zero).
41
41
  //
42
42
  std::chrono::steady_clock::time_point _nextRetry;
43
43
  };
@@ -443,7 +443,12 @@ namespace IceInternal
443
443
  // If there's still no room, remove the oldest entry (at the front).
444
444
  if (static_cast<int>(_detachedQueue.size()) == _retain)
445
445
  {
446
- _objects.erase(_detachedQueue.front()->_object->id);
446
+ EntryTPtr front = _detachedQueue.front();
447
+ // Reset the evicted entry's position so a surviving EntryTPtr doesn't keep an iterator into the erased
448
+ // list node.
449
+ front->_detachedPos = _detachedQueue.end();
450
+
451
+ _objects.erase(front->_object->id);
447
452
  _detachedQueue.pop_front();
448
453
  }
449
454
 
@@ -493,30 +493,34 @@ namespace IceMX
493
493
  return getObserver(helper);
494
494
  }
495
495
 
496
- std::lock_guard lock(_mutex);
497
- if (!_metrics)
498
496
  {
499
- return nullptr;
500
- }
497
+ std::lock_guard lock(_mutex);
498
+ if (!_metrics)
499
+ {
500
+ return nullptr;
501
+ }
501
502
 
502
- typename ObserverImplType::EntrySeqType metricsObjects;
503
- for (const auto& map : _maps)
504
- {
505
- typename ObserverImplType::EntryPtrType entry = map->getMatching(helper, old->getEntry(map.get()));
506
- if (entry)
503
+ typename ObserverImplType::EntrySeqType metricsObjects;
504
+ for (const auto& map : _maps)
507
505
  {
508
- metricsObjects.push_back(entry);
506
+ typename ObserverImplType::EntryPtrType entry = map->getMatching(helper, old->getEntry(map.get()));
507
+ if (entry)
508
+ {
509
+ metricsObjects.push_back(entry);
510
+ }
511
+ }
512
+ if (!metricsObjects.empty())
513
+ {
514
+ ObserverImplPtrType obsv = std::make_shared<ObserverImplType>();
515
+ obsv->init(helper, metricsObjects, old.get());
516
+ return obsv;
509
517
  }
510
- }
511
- if (metricsObjects.empty())
512
- {
513
- old->detach();
514
- return nullptr;
515
518
  }
516
519
 
517
- ObserverImplPtrType obsv = std::make_shared<ObserverImplType>();
518
- obsv->init(helper, metricsObjects, old.get());
519
- return obsv;
520
+ // No map matched the updated observer: detach the old observer outside the factory mutex, since
521
+ // detach() can call into a user-supplied instrumentation delegate.
522
+ old->detach();
523
+ return nullptr;
520
524
  }
521
525
 
522
526
  template<typename SubMapMetricsType>
@@ -38,7 +38,7 @@ Ice::NativePropertiesAdmin::getPropertiesForPrefix(string prefix, const Current&
38
38
  void
39
39
  Ice::NativePropertiesAdmin::setProperties(PropertyDict props, const Current&)
40
40
  {
41
- lock_guard lock{_mutex};
41
+ unique_lock lock{_mutex};
42
42
 
43
43
  PropertyDict old = _properties->getPropertiesForPrefix("");
44
44
  PropertyDict::const_iterator p;
@@ -157,8 +157,11 @@ Ice::NativePropertiesAdmin::setProperties(PropertyDict props, const Current&)
157
157
  changes.insert(changed.begin(), changed.end());
158
158
  changes.insert(removed.begin(), removed.end());
159
159
 
160
- // Copy callbacks to allow callbacks to update callbacks
160
+ // Copy the callbacks and release the lock before invoking them. This allows the callbacks to update the
161
+ // callbacks, and avoids a lock-order inversion: a callback may acquire an application lock, while another
162
+ // thread may call into the admin (e.g. add/removeUpdateCallback) while holding that same lock.
161
163
  auto callbacks = _updateCallbacks;
164
+ lock.unlock();
162
165
  for (const auto& cb : callbacks)
163
166
  {
164
167
  cb(changes);