open-hpi / openhpi

Other
7 stars 10 forks source link

OpenHPI client (hpitree) segfaults on solaris 5.10 #1427

Open mohandev2 opened 15 years ago

mohandev2 commented 15 years ago

Loaded the Solaris 5.10 on a dl360g5 proliant server. Downloaded and compiled the OpenHPI 2.13.3 on that machine. HP C-class chassis was configured. The daemon started properly. When I tried to get the hardware information using hpitree it segfaulted half way through.

Reported by: *anonymous

Original Ticket: "openhpi/bugs/1427":https://sourceforge.net/p/openhpi/bugs/1427

mohandev2 commented 15 years ago

The daemon itself continues to run.

Original comment by: mohandev2

mohandev2 commented 15 years ago

Original comment by: sutula

mohandev2 commented 15 years ago

If hpitree is generating a segmentation fault on Solaris and not on Linux, the problem may be caused by a call to snprintf(), printf(), or fprintf() with a NULL argument. The following code will generate a segmentation fault on Solaris and print "(null)\n" on Linux:

printf("%s\n", NULL);

The list_* functions in hpitree.c directly and indirectly call the oh_lookup_* functions declared in sahpi_enum_utils.h. The oh_lookup_* functions return a pointer to a string if the lookup is successful and a NULL if the lookup fails. Some of the callers of the oh_lookup_* functions don't check for the NULL return value before calling snprintf(), printf(), or fprintf().

If output from hpitree on Linux contains a "(null)", the segmentation fault on Solaris may be due to one of the oh_lookup_* functions returning NULL.

Original comment by: crinaldo

mohandev2 commented 15 years ago

Original comment by: ricwhite

mohandev2 commented 15 years ago

Original comment by: ricwhite

mohandev2 commented 13 years ago

Original comment by: avpak

mohandev2 commented 13 years ago

Original comment by: avpak

mohandev2 commented 12 years ago

Original comment by: avpak

mohandev2 commented 12 years ago

Original comment by: mohandev2

mohandev2 commented 9 years ago

Original comment by: mohandev2

mohandev2 commented 9 years ago

This was filed on 2009-03-09 with a milestone in the 3.1.x release. We do not know if this problem exists in later releases of Solaris (11.2 and 12.* etc). But moving the milestone to a future release for now as it will not be fixed in 3.1.x release

Original comment by: mohandev2