x11vnc: Fix shm close on early shutdown. [chromiumos/overlays/portage-stable : factory-2985.B]

2 views
Skip to first unread message

Shawn Nematbakhsh (Code Review)

unread,
Nov 13, 2012, 9:24:38 PM11/13/12
to
Shawn Nematbakhsh has uploaded a new change for review.

Change subject: x11vnc: Fix shm close on early shutdown.
......................................................................

x11vnc: Fix shm close on early shutdown.

Global structures {scanline,fullscreen,scanrect}_shm are initialized to
zero, including the .shmid field. This creates problems when shutdown /
clean_shm is called before these structures are properly initialized in
initialize_polling_images. shm_delete will be called on the structure,
and since the shmid isn't -1, shmctl(id, IPC_RMID...) will be called for
id=0. id=0 is in fact a valid shmid, and it might belong to some other
shared memory for some other processes, creating many potential problems.

Fix is to initialize shmid to -1 to indicate that it is in fact
uninitialized.

BUG=chrome-os-partner:16097
TEST=build factory image, confirm that "aplay" works without error.

Change-Id: I18f3ac50c52818e7c201fc85e8f4df24554237cc
---
A x11-misc/x11vnc/files/x11vnc-0.9.13-shm-cleanup.patch
M x11-misc/x11vnc/x11vnc-0.9.9.ebuild
2 files changed, 19 insertions(+), 1 deletion(-)


git pull ssh://gerrit.chromium.org:29418/chromiumos/overlays/portage-stable refs/changes/71/37971/1
--
To view, visit https://gerrit.chromium.org/gerrit/37971
To unsubscribe, visit https://gerrit.chromium.org/gerrit/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18f3ac50c52818e7c201fc85e8f4df24554237cc
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/overlays/portage-stable
Gerrit-Branch: factory-2985.B
Gerrit-Owner: Shawn Nematbakhsh <sha...@google.com>

Ricky Liang (Code Review)

unread,
Nov 13, 2012, 9:41:33 PM11/13/12
to Shawn Nematbakhsh, Gerrit, Dylan Reid
Ricky Liang has posted comments on this change.

Change subject: x11vnc: Fix shm close on early shutdown.
......................................................................


Patch Set 2: Looks good to me, but someone else must approve

Woot! Many thanks for this fix!
Gerrit-MessageType: comment
Gerrit-Change-Id: I18f3ac50c52818e7c201fc85e8f4df24554237cc
Gerrit-PatchSet: 2
Gerrit-Project: chromiumos/overlays/portage-stable
Gerrit-Branch: factory-2985.B
Gerrit-Owner: Shawn Nematbakhsh <sha...@google.com>
Gerrit-Reviewer: Dylan Reid <dgr...@chromium.org>
Gerrit-Reviewer: Gerrit <chrom...@google.com>
Gerrit-Reviewer: Ricky Liang <jcl...@chromium.org>
Gerrit-Reviewer: Shawn Nematbakhsh <sha...@google.com>

Dylan Reid (Code Review)

unread,
Nov 13, 2012, 9:47:19 PM11/13/12
to Shawn Nematbakhsh, Gerrit, Ricky Liang
Dylan Reid has posted comments on this change.

Change subject: x11vnc: Fix shm close on early shutdown.
......................................................................


Patch Set 2: Looks good to me, approved
Gerrit-MessageType: comment
Gerrit-Change-Id: I18f3ac50c52818e7c201fc85e8f4df24554237cc
Gerrit-PatchSet: 2
Gerrit-Project: chromiumos/overlays/portage-stable
Gerrit-Branch: factory-2985.B
Gerrit-Owner: Shawn Nematbakhsh <sha...@google.com>

Shawn Nematbakhsh (Code Review)

unread,
Nov 14, 2012, 10:22:22 PM11/14/12
to Gerrit, Dylan Reid, Ricky Liang
Shawn Nematbakhsh has posted comments on this change.

Change subject: x11vnc: Fix shm close on early shutdown.
......................................................................


Patch Set 2: Verified
Gerrit-MessageType: comment
Gerrit-Change-Id: I18f3ac50c52818e7c201fc85e8f4df24554237cc
Gerrit-PatchSet: 2
Gerrit-Project: chromiumos/overlays/portage-stable
Gerrit-Branch: factory-2985.B
Gerrit-Owner: Shawn Nematbakhsh <sha...@google.com>

Shawn Nematbakhsh (Code Review)

unread,
Nov 14, 2012, 10:22:22 PM11/14/12
to Gerrit, Dylan Reid, Ricky Liang
Shawn Nematbakhsh has submitted this change and it was merged.

Change subject: x11vnc: Fix shm close on early shutdown.
......................................................................


x11vnc: Fix shm close on early shutdown.

Global structures {scanline,fullscreen,scanrect}_shm are initialized to
zero, including the .shmid field. This creates problems when shutdown /
clean_shm is called before these structures are properly initialized in
initialize_polling_images. shm_delete will be called on the structure,
and since the shmid isn't -1, shmctl(id, IPC_RMID...) will be called for
id=0. id=0 is in fact a valid shmid, and it might belong to some other
shared memory for some other processes, creating many potential problems.

Fix is to initialize shmid to -1 to indicate that it is in fact
uninitialized.

BUG=chrome-os-partner:16097
TEST=build factory image, confirm that "aplay" works without error.

Change-Id: I18f3ac50c52818e7c201fc85e8f4df24554237cc
---
A x11-misc/x11vnc/files/x11vnc-0.9.13-shm-cleanup.patch
M x11-misc/x11vnc/x11vnc-0.9.9.ebuild
2 files changed, 19 insertions(+), 1 deletion(-)

Approvals:
Shawn Nematbakhsh: Verified
Dylan Reid: Looks good to me, approved
Ricky Liang: Looks good to me, but someone else must approve
Gerrit-MessageType: merged
Gerrit-Change-Id: I18f3ac50c52818e7c201fc85e8f4df24554237cc
Gerrit-PatchSet: 2
Gerrit-Project: chromiumos/overlays/portage-stable
Gerrit-Branch: factory-2985.B
Gerrit-Owner: Shawn Nematbakhsh <sha...@google.com>

Mike Frysinger (Code Review)

unread,
Nov 15, 2012, 4:01:00 PM11/15/12
to Shawn Nematbakhsh, Gerrit, Dylan Reid, Ricky Liang, Mike Frysinger
Mike Frysinger has posted comments on this change.

Change subject: x11vnc: Fix shm close on early shutdown.
......................................................................


Patch Set 3:

btw, you normally should revbump things so the binary packages don't get confused. incremental builders wouldn't notice the change for example.
Gerrit-MessageType: comment
Gerrit-Change-Id: I18f3ac50c52818e7c201fc85e8f4df24554237cc
Gerrit-PatchSet: 3
Gerrit-Project: chromiumos/overlays/portage-stable
Gerrit-Branch: factory-2985.B
Gerrit-Owner: Shawn Nematbakhsh <sha...@google.com>
Reply all
Reply to author
Forward
0 new messages