Powered by Linux
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: about using smatch in all debian C code — Semantic Matching Tool

Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: about using smatch in all debian C code

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

 



As I tried :
CHECK="/home/lsc20011130/smatch/smatch --info --file-output",
for each .c file, the above three file are created , and there's a lot of information in these files, like:

nty_schedule.c:98 nty_schedule_sched_sleepdown() info: param_mapper 0 => _nty_coroutine_rbtree_sleep_RB_INSERT 1
nty_schedule.c:113 nty_schedule_desched_sleepdown() info: param_mapper 0 => _nty_coroutine_rbtree_sleep_RB_REMOVE 1
nty_schedule.c:144 nty_schedule_desched_wait() error: we previously assumed 'co' could be null (see line 141)

nty_coroutine.c:58 _save_stack() SQL_caller_info: insert into caller_info values (0x7feb7cc204ad2699, '_save_stack', '__assert_fail', %CALL_ID%, 0, 0, -1, '%call_marker%', 'void(*)(char*, char*, uint, char*)');
nty_coroutine.c:58 _save_stack() SQL_caller_info: insert into caller_info values (0x7feb7cc204ad2699, '_save_stack', '__assert_fail', %CALL_ID%, 0, 1001, 0, '$', '8349466724068225024');
nty_coroutine.c:58 _save_stack() SQL_caller_info: insert into caller_info values (0x7feb7cc204ad2699, '_save_stack', '__assert_fail', %CALL_ID%, 0, 1001, 1, '$', '5566788581620412416');

nty_coroutine.c:55 _save_stack() SQL: insert into function_type values(0x7feb7cc204ad2699, '_save_stack', 1, 0, 'struct _nty_coroutine*');
nty_coroutine.c:55 _save_stack() SQL: insert into parameter_name values(0x7feb7cc204ad2699, '_save_stack', 1, 0, 'co');

regards,
Lishu Chang


"Dan Carpenter" <dan.carpenter@xxxxxxxxxx>写道:
> On Tue, Mar 12, 2024 at 10:22:06PM +0800, 李书畅 wrote:
> > Hello Dan, please ignore my previous two e-mails, which are summarized in this one. The current situation is as follows:
> > I went directly into the NtyCo subdirectory NtyCo/core, changed the gcc to cgcc in the makefile and ran: 
> > 
> >  sudo make 
> > 
> > the output (sparse show me the warnings) :
> > 
> > /home/lsc20011130/smatch/cgcc -c nty_epoll.c -o /nty_epoll.o  
> > /home/lsc20011130/smatch/cgcc -c nty_coroutine.c -o /nty_coroutine.o  
> > nty_coroutine.c:258:6: warning: symbol 'nty_coroutine_renice' was not declared. Should it be static?
> > nty_coroutine.c:279:6: warning: symbol 'nty_coroutine_detach' was not declared. Should it be static?
> > /home/lsc20011130/smatch/cgcc -c nty_socket.c -o /nty_socket.o  
> > nty_socket.c:421:9: error: symbol 'recvfrom' redeclared with different type (originally declared at /usr/include/sys/socket.h:163) - incompatible argument 5 (different base types)
> > nty_socket.c:504:9: error: symbol 'sendto' redeclared with different type (originally declared at /usr/include/sys/socket.h:152) - incompatible argument 5 (different base types)
> > nty_socket.c:529:5: error: symbol 'accept' redeclared with different type (originally declared at /usr/include/sys/socket.h:232) - incompatible argument 2 (different base types)
> > nty_socket.c:579:5: error: symbol 'connect' redeclared with different type (originally declared at /usr/include/sys/socket.h:126) - incompatible argument 2 (different base types)
> > /home/lsc20011130/smatch/cgcc -c nty_schedule.c -o /nty_schedule.o  
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_INSERT_COLOR' was not declared. Should it be static?
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_REMOVE_COLOR' was not declared. Should it be static?
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_REMOVE' was not declared. Should it be static?
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_INSERT' was not declared. Should it be static?
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_FIND' was not declared. Should it be static?
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_NFIND' was not declared. Should it be static?
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_NEXT' was not declared. Should it be static?
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_PREV' was not declared. Should it be static?
> > nty_schedule.c:82:1: warning: symbol '_nty_coroutine_rbtree_sleep_RB_MINMAX' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_INSERT_COLOR' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_REMOVE_COLOR' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_REMOVE' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_INSERT' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_FIND' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_NFIND' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_NEXT' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_PREV' was not declared. Should it be static?
> > nty_schedule.c:83:1: warning: symbol '_nty_coroutine_rbtree_wait_RB_MINMAX' was not declared. Should it be static?
> > nty_schedule.c:122:34: warning: missing braces around initializer
> > nty_schedule.c:121:15: warning: symbol 'nty_schedule_search_wait' was not declared. Should it be static?
> > nty_schedule.c:135:34: warning: missing braces around initializer
> > nty_schedule.c:181:6: warning: symbol 'nty_schedule_cancel_wait' was not declared. Should it be static?
> > nty_schedule.c:185:6: warning: symbol 'nty_schedule_free' was not declared. Should it be static?
> > nty_schedule.c:201:5: warning: symbol 'nty_schedule_create' was not declared. Should it be static?
> > 
> > but if I run :
> >  sudo make CHECK="/home/lsc20011130/smatch/smatch --info", instead of sudo make 
> > the output (all the waring disappear):
> > 
> > /home/lsc20011130/smatch/cgcc -c nty_epoll.c -o /nty_epoll.o  
> > /home/lsc20011130/smatch/cgcc -c nty_coroutine.c -o /nty_coroutine.o  
> > /home/lsc20011130/smatch/cgcc -c nty_socket.c -o /nty_socket.o  
> > /home/lsc20011130/smatch/cgcc -c nty_schedule.c -o /nty_schedule.o  
> > 
> > I would like to know if this is normal? I'm not familiar with static
> > analysis, so forgive me if I ask some simple and silly questions.
> >  
> 
> Feel free to ask questions.  In this case, what you're seeing is not
> normal at all.
> 
> If the cgcc script is able to run sparse then it's able to run smatch.
> The --info option should produce output for every function so it should
> definitely produce output here.
> 
> The only thing I can think of is that maybe it's because smatch outputs
> to stdout and sparse outputs to stderr?  What about if you pass
> --file-output to smatch?
> CHECK="/home/lsc20011130/smatch/smatch --info --file-output"
> That should create a bunch of files that end in foo.c.smatch,
> foo.c.smatch.sql and foo.c.smatch.caller_info
> 
> regards,
> dan carpenter




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

  Powered by Linux