Re: bin/160689: FreeBSD should have .cshrc updated for modern hardware and useful aliases installed by default

2011-09-19 Thread jh
Synopsis: FreeBSD should have .cshrc updated for modern hardware and useful 
aliases installed by default

Class-Changed-From-To: sw-bug->change-request
Class-Changed-By: jh
Class-Changed-When: Mon Sep 19 14:43:19 UTC 2011
Class-Changed-Why: 
Change request rather than a bug. Also, please note that poweroff(8)
already exists in 9.0.

http://www.freebsd.org/cgi/query-pr.cgi?pr=160689
___
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


bin/160834: grep: fixes for POSIX conformance

2011-09-19 Thread Toby Peterson

>Number: 160834
>Category:   bin
>Synopsis:   grep: fixes for POSIX conformance
>Confidential:   no
>Severity:   non-critical
>Priority:   low
>Responsible:freebsd-bugs
>State:  open
>Quarter:
>Keywords:   
>Date-Required:
>Class:  sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 19 20:40:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Toby Peterson
>Release:n/a
>Organization:
Apple Inc.
>Environment:
n/a
>Description:
Standard is at 
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html

Fairly straightforward changes, description as follows:

fastgrep.c:
Handle ^$ pattern correctly. Simple test is `echo | grep "^$"` - it should 
match the single line.

grep.c:
As described in the standard, "The pattern_list's value shall consist of one or 
more patterns separated by  characters"

util.c:
For the purposes of the standard, inaccessible = nonexistent.

Also don't match the empty end of the line. Simple test for that: `echo abc#def 
| grep "^[A-Za-z0-9]*$"` should not match anything.

>How-To-Repeat:
See description for test cases.
>Fix:
Patch attached.

Patch attached with submission follows:

Index: fastgrep.c
===
--- fastgrep.c  (revision 225675)
+++ fastgrep.c  (working copy)
@@ -104,6 +104,10 @@
pat++;
}
 
+   if (fg->len == 0) {
+   return (-1);
+   }
+
if (fg->len >= 14 &&
memcmp(pat, "[[:<:]]", 7) == 0 &&
memcmp(pat + fg->len - 7, "[[:>:]]", 7) == 0) {
Index: grep.c
===
--- grep.c  (revision 225675)
+++ grep.c  (working copy)
@@ -280,6 +280,21 @@
 }
 
 /*
+ * Adds search patterns from arguments.
+ */
+static void
+add_arg_patterns(const char *arg)
+{
+   char *argcopy, *pattern;
+
+   argcopy = grep_strdup(arg);
+   while ((pattern = strsep(&argcopy, "\n")) != NULL) {
+   add_pattern(pattern, strlen(pattern));
+   }
+   free(argcopy);
+}
+
+/*
  * Reads searching patterns from a file and adds them with add_pattern().
  */
 static void
@@ -461,7 +476,7 @@
grepbehave = GREP_EXTENDED;
break;
case 'e':
-   add_pattern(optarg, strlen(optarg));
+   add_arg_patterns(optarg);
needpattern = 0;
break;
case 'F':
@@ -636,7 +651,7 @@
 
/* Process patterns from command line */
if (aargc != 0 && needpattern) {
-   add_pattern(*aargv, strlen(*aargv));
+   add_arg_patterns(*aargv);
--aargc;
++aargv;
}
Index: util.c
===
--- util.c  (revision 225675)
+++ util.c  (working copy)
@@ -194,7 +194,7 @@
if (f == NULL) {
if (!sflag)
warn("%s", fn);
-   if (errno == ENOENT)
+   if (errno == ENOENT || errno == EACCES)
notfound = true;
return (0);
}
@@ -282,7 +282,7 @@
 
if (!matchall) {
/* Loop to process the whole line */
-   while (st <= l->len) {
+   do {
pmatch.rm_so = st;
pmatch.rm_eo = l->len;
 
@@ -350,7 +350,7 @@
 
if (st == (size_t)pmatch.rm_so)
break;  /* No matches */
-   }
+   } while (st < l->len);
} else
c = !vflag;
 


>Release-Note:
>Audit-Trail:
>Unformatted:
___
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


kern/160838: ACPI Battery Monitor Non-Functional

2011-09-19 Thread Eric McCorkle

>Number: 160838
>Category:   kern
>Synopsis:   ACPI Battery Monitor Non-Functional
>Confidential:   no
>Severity:   non-critical
>Priority:   medium
>Responsible:freebsd-bugs
>State:  open
>Quarter:
>Keywords:   
>Date-Required:
>Class:  sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 20 04:10:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Eric McCorkle
>Release:9.0-CURRENT
>Organization:
>Environment:
FreeBSD atom-edge 9.0-BETA2 FreeBSD 9.0-BETA2 #41: Mon Sep 19 19:02:17 EDT 2011 
root@atom-edge:/usr/obj/usr/src/sys/CUSTOM  amd64
>Description:
Recently updated sources, which caused acpiconf -i0 to stop reporting 
information about the battery properly.  Instead, it reports "not present", and 
0 for all values, except charge (which reports as -1).

I have already identified the root cause for the problem.
>How-To-Repeat:
The problem should occur on any system with a battery using the cmbat 
interface, which dispatches a large number of calls via AcpiOsExecute during 
initialization.  This fills up the task queue, which results in the call to 
acpi_cmbat_init_battery getting dropped due to the queue being full, which 
results in the bif information not being properly initialized.  Because the 
cmbat driver only reads this information at initalization, the driver will 
incorrectly report the battery as not being present.

Similar issues with other ACPI features may have a similar root cause.
>Fix:
Setting debug.acpi.max_tasks to a high value (I used 128) is a stable 
workaround, and will restore functionality.

>Release-Note:
>Audit-Trail:
>Unformatted:
___
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"