From: Ethan A M. <merritt@u.washington.edu> - 2014-02-12 19:45:04
|
On Wednesday, 12 February, 2014 13:24:38 Yuriy Kaminskiy wrote: > > 423 while (qt->socket.bytesAvailable() >= (int)sizeof(gp_event_t)) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Not sure, but this looks very wrong. If this condition ever triggers (there are > less than sizeof(...) bytes in socket), it will result in infinite busy-loop (if > there are *any* bytes in socket, waitForReadyRead will instantly return, > receivedFontProps is not changed, bytesAvailable check will fail again, etc). > > I think same apply to similar code in qt_waitforinput(). > > (However, it is unlikely to be related to discussed bug (I expect it can only > trigger on gnuplot and gnuplot_qt version/ABI/architecture mismatch). Still, it > feels a way too fragile; You are correct. I'll work up a fix. > IMO, there should be at very least mutual validation of > sizeof(gp_event_t) at startup). Maybe, but there are other things that are more likely to go wrong if there is a version mismatch. Ethan |