I realized that the system that caused the crash has 601 sensors; really.
Patch attached.

The sensors are still showing N/A, though.  --debug output for one of
them also attached.  The normal output for it is:

ID   | Name          | Type        | Reading    | Units | Event
4233 | Ambient Temp. | Temperature | N/A        | C     | N/A

and ipmitool shows this:

    ADDR   | ID               | OwnerID  | Value      | Unit       | Status| 
LNR       | LC        | LNC       | UNC       | UC        | UNR   
           |                  |          |            |            | /Mask | 
Thres.    | Thres.    | Thres.    | Thres.    | Thres.    | Thres.
0x008000be | Ambient Temp.    | 0x80     | 20.0       | degrees C  | ok    | na 
       | 10.0      | na        | 39.0      | 44.0      | na        

(I'm not sure whether they're the same sensor, i.e. how ID and ADDR are
related, but the other three Ambients are the same.)

2013-12-19  Dave Love  <f...@gnu.org>

	* ipmi-sensors/ipmi-sensors.c (_calculate_record_ids): Check
	record numbr against array length.

	* common/toolcommon/tool-sensor-common.h (MAX_SENSOR_RECORD_IDS):
	Increase to 1024.

--- freeipmi-1.3.4/common/toolcommon/tool-sensor-common.h.orig	2013-04-26 18:01:55.000000000 +0100
+++ freeipmi-1.3.4/common/toolcommon/tool-sensor-common.h	2013-12-19 11:38:38.061632119 +0000
@@ -55,7 +55,7 @@
 #define MAX_SENSOR_TYPES                    256
 #else  /* !0 */
 /* achu: pick more reasonable limits than the theoretical maxes */
-#define MAX_SENSOR_RECORD_IDS               512
+#define MAX_SENSOR_RECORD_IDS               1024
 #define MAX_SENSOR_TYPES                    64
 #endif	/* !0 */
 #endif /* !__CYGWIN__ */
--- freeipmi-1.3.4/ipmi-sensors/ipmi-sensors.c.orig	2013-05-08 18:09:34.000000000 +0100
+++ freeipmi-1.3.4/ipmi-sensors/ipmi-sensors.c	2013-12-19 11:38:54.132859006 +0000
@@ -514,6 +514,13 @@
             }
           
           output_record_ids[(*output_record_ids_length)] = record_id;
+	  if (output_record_ids_length >= MAX_SENSOR_RECORD_IDS)
+	    {
+	      fprintf (stderr,
+		       "Too many sensors; limit is %d\n",
+		       MAX_SENSOR_RECORD_IDS - 1);
+	      return (-1);
+	    }
           (*output_record_ids_length)++;
         }
     }

Attachment: ipmi-sensors.debug.gz
Description: debug output

_______________________________________________
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/freeipmi-devel

Reply via email to