lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
980 stars 388 forks source link

mpudpm: fix lock sequence while parsing packets #354

Closed velentr closed 3 years ago

velentr commented 3 years ago

When parsing UDP packets that are not valid LCM messages, the mpudpm module's error handling would get the internal locks into an invalid state. When attempting to read the next UDP packet, it would abort() with the following message on some platforms:

Attempt to unlock mutex that was not locked

Fix this by re-acquiring the receive lock during error handling so the next unlock at the top of the recv loop will not crash.

Signed-off-by: Brian Kubisiak brian@kubisiak.com