> Hi Dave,
>
> Crash seems to assume that the "task_state_array" is NULL terminated.
> This is
> not the case:
>
> static const char *task_state_array[] = {
> "R (running)", /* 0 */
> "S (sleeping)", /* 1 */
> ...
> "X (dead)" /* 32 */
> };
>
> I have a dump where this leads to a crash crash.
>
> I think, when reading the array, we should use the array size as
> loop exit criteria instead of checking for NULL termination.
Agreed -- I'll just change your patch to just call get_array_length()
one time, and stash the result for use by the loop.
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
08-27-2010, 01:59 PM
Michael Holzheu
Fix reading of "task_state_array"
On Fri, 2010-08-27 at 09:48 -0400, Dave Anderson wrote:
> ----- "Michael Holzheu" <holzheu@linux.vnet.ibm.com> wrote:
> > I think, when reading the array, we should use the array size as
> > loop exit criteria instead of checking for NULL termination.
>
> Agreed -- I'll just change your patch to just call get_array_length()
> one time, and stash the result for use by the loop.
Ok, this makes sense.
Thanks!
Michael
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility