Opened 13 years ago
Closed 13 years ago
#3095 closed Bugs (fixed)
bug in automatic resizing of the bucket array
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | Boost 1.40.0 | Component: | asio |
Version: | Boost 1.39.0 | Severity: | Regression |
Keywords: | Cc: |
Description
we have many stable server application that runs on Windows and using asio IOCP model (boost 1.38.0)
e.g. One of it always handles 500+ incoming connections and for each connection it will create a new local network connection to a database server. It runs very stable for weeks. the stats shows that the incoming connection number is 500 and the outgoing connections is about 5 (the local network runs much faster).
However, after upgrade to boost 1.39.0, they do not work any more! it always stop working after a few minutes of startup. The stats shows that the incoming connection number is 500 and the outgoing connections keep increasing from 1 to 300+.
We roll back to asio in boost 1.38.0, it works again.
Thus, I apply all the asio patches between 1.38.0 and 1.39.0 one by one and find out that this is caused by the Changeset [52292].
Now I am using the 1.39.0 but add one line to disable the auto resize feature
#define BOOST_ASIO_HASH_MAP_BUCKETS 1021
Now every thing runs very well. So there must be some bug in the bug in automatic resizing function.
Change History (5)
comment:1 by , 13 years ago
comment:3 by , 13 years ago
here is repro code (vs2005sp1 x86): #include "boost/asio/detail/hash_map.hpp" void Test() {
typedef boost::asio::detail::hash_map<int, int> test_type; test_type tester; int badPattern[] = {
0x668d50, 0x66e168, 0x669b80
}; for (int i = 0; i < 3; i++)
tester.insert(test_type::value_type(badPattern[i], i));
for (int i = 0; i < 3; i++) {
test_type::iterator my = tester.find(badPattern[i]); if (my == tester.end()) {
printf("there is my value?"); will be executed for second value
}
} return 0;
}
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [54499]) Merge from trunk. Fixes #3095, #3216, #3098, #3107, #1341, #2754, #3157, #2620, #2618.
........
r54373 | chris_kohlhoff | 2009-06-26 21:03:14 +1000 (Fri, 26 Jun 2009) | 2 lines
Fix doc generation for array reference parameters.
........
r54376 | chris_kohlhoff | 2009-06-26 23:35:04 +1000 (Fri, 26 Jun 2009) | 2 lines
Fix bug in hash resize. Ref #3095.
........
r54377 | chris_kohlhoff | 2009-06-26 23:55:24 +1000 (Fri, 26 Jun 2009) | 3 lines
Remove a local variable that was hiding the ec parameter and preventing error codes from being correctly propagated. Ref #3216.
........
r54390 | chris_kohlhoff | 2009-06-27 12:17:49 +1000 (Sat, 27 Jun 2009) | 2 lines
Fix failures reported when the tests are built with _GLIBCXX_DEBUG. Ref #3098.
........
r54392 | chris_kohlhoff | 2009-06-27 15:24:16 +1000 (Sat, 27 Jun 2009) | 2 lines
Fix custom memory allocation for timers. Ref #3107.
........
r54393 | chris_kohlhoff | 2009-06-27 17:07:40 +1000 (Sat, 27 Jun 2009) | 2 lines
Fix various g++ warnings. Ref #1341.
........
r54400 | chris_kohlhoff | 2009-06-27 17:52:11 +1000 (Sat, 27 Jun 2009) | 4 lines
Use boost::throw_exception() rather than throw keyword to allow asio to be used when exception support is disabled. Note that the SSL wrappers still require exception support. Refs #2754.
........
r54407 | chris_kohlhoff | 2009-06-27 19:13:24 +1000 (Sat, 27 Jun 2009) | 2 lines
Make links to function overloads more obvious.
........
r54466 | chris_kohlhoff | 2009-06-28 23:07:43 +1000 (Sun, 28 Jun 2009) | 2 lines
Add header file information to reference docs. Refs #3157.
........
r54467 | chris_kohlhoff | 2009-06-28 23:20:17 +1000 (Sun, 28 Jun 2009) | 4 lines
Treat 0-byte reads and writes as no-ops to comply with the documented type requirements for SyncReadStream, AsyncReadStream, SyncWriteStream and AsyncWriteStream.
........
r54498 | chris_kohlhoff | 2009-06-29 19:32:41 +1000 (Mon, 29 Jun 2009) | 2 lines
Add enum values to doc index. Refs #2620.
........
I have the same problem too.