On Thu, 5 Apr 2007, Jon Steel wrote: > Hi > > Ive found a way to freeze a program when using rThreads and using a > function pointer back to one of the threads from within a shared > library. The higher the level of interrupts on the system, the more > frequently the problem occurs. The problem can be duplicated as follows: > > 1. Create a child rThread > 2. Pass a function pointer to a shared library > 3. Get the shared library to call the function pointer > > The program will now lockup, and you must kill -9 it. I originally found > this in pcap, inside pcap_loop when it tries to call the callback > function. I have attached a very small project and shared library that > will reproduce the problem. > > Just run > > ./configure > ./make > > Then generate a lot of interrupts somehow. I do this by running > > iperf -us // on the test machine > iperf -uc xxx.xxx.xxx.xxx -b 500000000 -t 9999 // on some other machine > > Then if you run "./callback 1" and try and kill it with Ctrl-C, it > should freeze. It may take a few tries though. It usually happens for me > within 3 or 4 tries if I run iperf really fast. If you run "./callback" > then it wont lockup. The only difference is that when you pass in the 1, > it creates the child thread. > > Id like to try this on current but I cant get rThreads compiled for it. > > Does anybody have any insight, or could they test it out on current?
See http://marc.info/?l=openbsd-misc&m=113991745810561&w=2 Behind the scene some works is going on to solve this. -Otto