Xlib: unexpected async reply with Matplotlib


I wrote an application with matplotlib, which often (3 times a second or
more) updates the graphics window. When I switch off the update, the
aplication is quite stable, but with updates Xlib prints the following
lines and the application freezes.

Xlib: unexpected async reply (sequence 0x1318f)!
Xlib: sequence lost (0x20000 > 0x1318f) in reply type 0x0!

I do not know how to debug/backtrace this message. Does anyone have a clue?

The application is using matplotlib with pygtk and numarray, running
under Debian testing.

python-matplotlib-data 0.86.2-4
python-matplotlib-doc 0.86.2-4
python2.4-matplotlib 0.86.2-4
python2.4-gtk2 2.8.2-3
libcairo2 1.0.4-1+b1
libcairo2-dev 1.0.4-1+b1
python2.4-cairo 1.0.2-1

It is not clear to me, if this error is caused by matplotlib, but it
seems to be "correlated" to its use.

Any help is welcome.

Thanks, achim