I have a problem when catching a plenty of exceptions simultaneously in different threads: the Load Average indicator exceeds 100.0 and the process seems to "hang up".
I managed to simulate this situation having created a test program with a number of threads about 200 each containing a FINITE loop with throwing and catching an exception. The exceptions don't leave thread function. The test starts to work and at some moment blocks. Under some other conditions the test may finish (when number of threads is lower or when intervals between throwing exceptions are bigger). It can pass even with the same conditions, so it's behavior is unpredictable.
I use boost::thread over libpthread and g++ 4.2.1 on 2-core amd64 with FreeBSD7.0. It's interesting that under Linux this test runs smoothly.
when the test application hangs, I kill it with -11 signal and that is what I see in gdb:
(gdb) where
#0 0x0000000801554 636 in __fixunssfti () from /lib/libgcc_s.so.1
]#1 0x00000008005c6 343 in dl_iterate_phdr () from /libexec/ld-elf.so.1
#2 0x0000000801554 bdf in _Unwind_Find_FD E () from /lib/libgcc_s.so.1
#3 0x0000000801551 525 in _Unwind_GetIPIn fo () from /lib/libgcc_s.so.1
#4 0x0000000801552 96e in _Unwind_RaiseEx ception () from /lib/libgcc_s.so.1
#5 0x00000008012a2 abd in __cxa_throw () from /usr/lib/libstdc++.so.6
.....
The same is in my real application when it hangs on exceptions.
I managed to simulate this situation having created a test program with a number of threads about 200 each containing a FINITE loop with throwing and catching an exception. The exceptions don't leave thread function. The test starts to work and at some moment blocks. Under some other conditions the test may finish (when number of threads is lower or when intervals between throwing exceptions are bigger). It can pass even with the same conditions, so it's behavior is unpredictable.
I use boost::thread over libpthread and g++ 4.2.1 on 2-core amd64 with FreeBSD7.0. It's interesting that under Linux this test runs smoothly.
when the test application hangs, I kill it with -11 signal and that is what I see in gdb:
(gdb) where
#0 0x0000000801554 636 in __fixunssfti () from /lib/libgcc_s.so.1
]#1 0x00000008005c6 343 in dl_iterate_phdr () from /libexec/ld-elf.so.1
#2 0x0000000801554 bdf in _Unwind_Find_FD E () from /lib/libgcc_s.so.1
#3 0x0000000801551 525 in _Unwind_GetIPIn fo () from /lib/libgcc_s.so.1
#4 0x0000000801552 96e in _Unwind_RaiseEx ception () from /lib/libgcc_s.so.1
#5 0x00000008012a2 abd in __cxa_throw () from /usr/lib/libstdc++.so.6
.....
The same is in my real application when it hangs on exceptions.
Comment