Powered by Linux
Re: Regression in Smatch — Semantic Matching Tool

Re: Regression in Smatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been looking at this.  I'm testing the per function time limit
fix.  I think the problem is that Smatch is using more than 3G of RAM.

The problem is that memcpy() really has a lot of implications and Smatch
is trying to keep track of it.  Consider the following one line program:

/* test.c */

#include "check_debug.h"

void memcpy(void *dest, void *src, int size);

struct foo {
        int x, y, z;
};

struct foo *p, *q;

static void function(void)
{
        memcpy(p, q, sizeof(p));
        __smatch_cur_slist();
}

/* end of file */

If we run Smatch on it then it gives the following output.

$ ./smatch test.c
dumping slist at 14
[internal] 'unnull_path' = true (true)
[check_memory] '-p' = assigned (assigned)
[check_memory] '-q' = assigned (assigned)
[check_missing_break] '__smatch_cur_slist' = used (used)
[check_missing_break] 'memcpy' = used (used)
[check_missing_break] 'p' = used (used)
[check_missing_break] 'q' = used (used)
[check_assigned_expr] 'p->x' = q->x (q->x)
[check_assigned_expr] 'p->y' = q->y (q->y)
[check_assigned_expr] 'p->z' = q->z (q->z)
[register_comparison_links] 'p->x' = p->x vs q->x (p->x vs q->x)
[register_comparison_links] 'p->y' = p->y vs q->y (p->y vs q->y)
[register_comparison_links] 'p->z' = p->z vs q->z (p->z vs q->z)
[register_comparison_links] 'q->x' = p->x vs q->x (p->x vs q->x)
[register_comparison_links] 'q->y' = p->y vs q->y (p->y vs q->y)
[register_comparison_links] 'q->z' = p->z vs q->z (p->z vs q->z)
[register_comparison] 'p->x vs q->x' = == (==)
[register_comparison] 'p->y vs q->y' = == (==)
[register_comparison] 'p->z vs q->z' = == (==)
[register_param_set] 'p->x' = s32min-s32max (s32min-s32max)
[register_param_set] 'p->y' = s32min-s32max (s32min-s32max)
[register_param_set] 'p->z' = s32min-s32max (s32min-s32max)
[register_smatch_extra] 'p->x' = s32min-s32max (s32min-s32max)
[register_smatch_extra] 'p->y' = s32min-s32max (s32min-s32max)
[register_smatch_extra] 'p->z' = s32min-s32max (s32min-s32max)
[register_smatch_extra] 'q->x' = s32min-s32max (s32min-s32max)
[register_smatch_extra] 'q->y' = s32min-s32max (s32min-s32max)
[register_smatch_extra] 'q->z' = s32min-s32max (s32min-s32max)
---

It used to be that we didn't track that stuff but it's all useful
information.  I don't know which bits I could get rid of.

Perhaps there is a way to handle large switch statements better.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux