Incorrect value passed for maxevents in call to epoll_wait() in ply-event-loop.c

Bug #518926 reported by Dave Martin
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
plymouth (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: plymouth

Ubuntu lucid
plymouth 0.8.0~-9

In ply_event_loop_process_pending_events(), sizeof (events) is passed for the maxevents parameter to epoll_wait().

events is a pointer, to sizeof (events) is 4 or 8 on most architectures.

This seems unlikely to have been what was intended.

Is PLY_EVENT_LOOP_NUM_EVENT_HANDLERS supposed to be passed for maxevents instead? (This is the number if event structures allocated to events.) If so, the attached patch ought to fix it.

This bug was found while investigating the following issue, but is probably not directly related:
 * https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/518937 (ply_event_loop_process_pending_events can block, causing mountall to deadlock)

Tags: patch

Related branches

Revision history for this message
Dave Martin (dave-martin-arm) wrote :
tags: added: patch
description: updated
description: updated
Changed in plymouth (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

The patch looks correct - could you send that upstream yourself (if not, I'll do it)

There would only be a danger from this on platforms with larger than 64-byte pointers - but it's silly to not use the entire events array

Changed in plymouth (Ubuntu):
importance: Medium → Low
Revision history for this message
Benjamin Drung (bdrung) wrote :

no debdiff for ubuntu-sponsors, subscribing ubuntu-reviewers for the patch instead

Colin Watson (cjwatson)
Changed in plymouth (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package plymouth - 0.8.2-2ubuntu20

---------------
plymouth (0.8.2-2ubuntu20) natty; urgency=low

  * Backport from upstream:
    - [event-loop] Add reference count to event sources (with any luck, this
      will fix LP: #553745).
    - [event-loop] Handle more than 8 events at once (LP: #518926).
    - [terminal] Force enter to output newline.
    - [terminal] Add OPOST to tty attributes (LP: #546251).
    - [terminal] Don't set ISTRIP in terminal attributes.
 -- Colin Watson <email address hidden> Thu, 24 Mar 2011 14:17:20 +0000

Changed in plymouth (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.