From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 19 12:19:45 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA703609; Wed, 19 Dec 2012 12:19:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9EAE18FC13; Wed, 19 Dec 2012 12:19:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBJCJjkk091452; Wed, 19 Dec 2012 12:19:45 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBJCJjgc091451; Wed, 19 Dec 2012 12:19:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201212191219.qBJCJjgc091451@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Dec 2012 12:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r244430 - stable/9/sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2012 12:19:45 -0000 Author: dim Date: Wed Dec 19 12:19:45 2012 New Revision: 244430 URL: http://svnweb.freebsd.org/changeset/base/244430 Log: MFC r243907: Fix an old bug in devd, where it uses std::sort() to sort the various lists it reads from its configuration files on the priority field. Because some items in the lists have the same priority, and std::sort() is not stable, the exact order in which the items are enumerated does not have to correspond to the order they appear in the configuration files. Apparently this was never noticed with libstdc++, but with libc++ it could cause the "uhid" entry from /etc/devd/usb.conf to be used instead of the "ums" entry (which is earlier in the file). This caused the problem described in the PR: the USB mouse module was never loaded, and the other actions (such as starting moused) were not executed. To fix the problem, make devd use std:stable_sort() instead. Reported by: Jan Beich PR: bin/172958 Modified: stable/9/sbin/devd/devd.cc Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.cc ============================================================================== --- stable/9/sbin/devd/devd.cc Wed Dec 19 12:14:08 2012 (r244429) +++ stable/9/sbin/devd/devd.cc Wed Dec 19 12:19:45 2012 (r244430) @@ -436,7 +436,7 @@ public: void config::sort_vector(vector &v) { - sort(v.begin(), v.end(), epv_greater()); + stable_sort(v.begin(), v.end(), epv_greater()); } void