question

Mark Bryant avatar image
Mark Bryant asked

BUG: QoS timeout structure is uninitialised causing a potential "hang"

Using the XPlatCpp SDK, attempts to QoS probe never complete if a packet is dropped.

The code here:

https://github.com/PlayFab/XPlatCppSdk/blob/master/code/source/playfab/QoS/XPlatSocket.cpp#L85

// Input timeout is in milliseconds
// tv_usec takes microseconds, hence convert the input milliseconds to microseconds
timeOutVal.tv_usec = timeoutMs * 1000;

Initialises the tv_usec field but never the tv_sec field.

Because the new() operator doesn't zero initialise memory, it is possible for the tv_sec field to contain an unspecified value which causes the select() call here:

https://github.com/PlayFab/XPlatCppSdk/blob/master/code/source/playfab/QoS/XPlatSocket.cpp#L170


to hang for an extremely long time.

sdks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

Thank you for the feedback. I have reproduced this issue successfully and will submit a report to the team. We will keep you updated when there is feedback from the team.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

franklinchen avatar image franklinchen commented ·

The fix has been deployed around 20 days ago, thanks.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.