Bug 28691

Summary: Fix segfaults in xfs
Product: xorg Reporter: Olivier Fourdan <fourdan>
Component: App/xfsAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: cloos
Version: git   
Hardware: x86-64 (AMD64)   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Proposed patch
none
Proposed patch none

Description Olivier Fourdan 2010-06-23 06:22:46 UTC
Created attachment 36437 [details] [review]
Proposed patch

The attached patch is to address possible remaining segfaults which can occur randomly in xfs, mostly a follow up on bug 22084

1. Make sure ListenTransCount is reset to 0 when ListenTransConns is freed to avoid a segfault in CloseSockets() when a “drone server” terminates.

2. ffs() is still used in various places on fd_mask whereas the fd_mask can be greater than an int.

3. replace (i << 5) with (i * (sizeof(fd_mask) * 8) to be more 64bit safe
Comment 1 Olivier Fourdan 2010-06-23 06:27:09 UTC
Created attachment 36438 [details] [review]
Proposed patch

Oops, sorry, the fix for point #1 was already applied in git commit a1583d53
Comment 2 James Cloos 2010-06-27 09:04:10 UTC
[Odd.  My attempt to update this via email must’ve fallen off into the æther.]

Fix pushed as commit 31917b20fe3d83ca51c460fdd66a7d61f2670db3.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.