The errors I encountered when Smatch builds the latest mainline

27 views
Skip to first unread message

Dongliang Mu

unread,
Jun 20, 2023, 10:18:42 AM6/20/23
to Dan Carpenter, sma...@vger.kernel.org, HUST OS Kernel Contribution
Hi Dan,

When I built Smatch in my local desktop, I encountered some errors
which do not appear in the normal building.

When I use the following script[1] to check linux mainline with
Smatch, I encountered the following errors:

--------------------------------------------------------------------------------------------------
make[1]: Target './' not remade because of errors.
make: *** [Makefile:2026: .] Error 2
make: Target 'bzImage' not remade because of errors.
make: Target 'modules' not remade because of errors.
Done. Build with status 2. The warnings are saved to smatch_warns.txt
smatch_warns.txt built.
--------------------------------------------------------------------------------------------------

And smatch_warns.txt is full with logs with sql operations.
When scrolling up, I found some error logs:

--------------------------------------------------------------------------------------------------
drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp1_execution.c:492:29:
warning: function 'mod_hdcp_hdcp1_dp_execution' with external linkage
has definit
ion
CHECK drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp_psp.c
drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp_psp.c: note:
in included file (through
drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_virt.h, drivers/gpu
/drm/amd/amdgpu/../amdgpu/amdgpu.h):
drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:257:49: error:
static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"
drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgv_sriovmsg.h:261:49: error:
static assertion failed: "amd_sriov_msg_pf2vf_info must be 1 KB"
--------------------------------------------------------------------------------------------------

However, when I tried to make allyesconfig and make -j32, it builds
successfully. This is really weird. Any ideas?

[1] https://gitee.com/dzm91_hust/hust-os-kernel-contribution/blob/master/mainline/deploy_smatch_on_mainline.sh

--
My best regards to you.

No System Is Safe!
Dongliang Mu

Dan Carpenter

unread,
Jun 20, 2023, 10:44:26 AM6/20/23
to Dongliang Mu, Dan Carpenter, sma...@vger.kernel.org, HUST OS Kernel Contribution
Sorry!
This is not related. That's old stuff.

https://lore.kernel.org/all/20230620045919...@nfschina.com/

We need to try rebuild again. Don't do a make clean. It will fail
fast now.

make -j`nproc` -k \
CHECK="/PATH/TO/smatch --succeed -p=kernel --file-output" \
C=1 bzImage modules 2>&1 | tee smatch_compile.warns

grep Error smatch_compile.warns


>
> However, when I tried to make allyesconfig and make -j32, it builds
> successfully. This is really weird. Any ideas?
>

Whenever this happens it means I have left out part of a commit. :(

But if you can give me the failing file it's easy for me to run:
~/progs/smatch/devel/smatch_scripts/kchecker --valgrind path/to/file.c
to reproduce the bug.

regards,
dan carpenter

Dongliang Mu

unread,
Jun 20, 2023, 9:33:13 PM6/20/23
to Dan Carpenter, Dan Carpenter, sma...@vger.kernel.org, HUST OS Kernel Contribution
I tried this command in my local environment, it builds the kernel
successfully. :/

To confirm this, I tried with two different kernel repos.

Dan Carpenter

unread,
Jun 23, 2023, 5:40:16 AM6/23/23
to Dongliang Mu, Dan Carpenter, sma...@vger.kernel.org, HUST OS Kernel Contribution
I encountered a crash recently on my own system. I think the difference
was that time I was building without a cross function database. I've
pushed a fix for it now so maybe it will help you as well.

regards,
dan carpenter

慕冬亮

unread,
Jun 24, 2023, 5:50:26 AM6/24/23
to dan carpenter, dongliang mu, dan carpenter, sma...@vger.kernel.org, hust os kernel contribution


> -----原始邮件-----
> 发件人: "Dan Carpenter" <dan.ca...@linaro.org>
> 发送时间: 2023-06-23 17:40:08 (星期五)
> 收件人: "Dongliang Mu" <mudongl...@gmail.com>
> 抄送: "Dan Carpenter" <err...@gmail.com>, sma...@vger.kernel.org, "HUST OS Kernel Contribution" <hust-os-ker...@googlegroups.com>
> 主题: Re: The errors I encountered when Smatch builds the latest mainline


>
> I encountered a crash recently on my own system. I think the difference
> was that time I was building without a cross function database. I've
> pushed a fix for it now so maybe it will help you as well.

It works great. Thanks very much.

>
> regards,
> dan carpenter
>
> --
> You received this message because you are subscribed to the Google Groups "HUST OS Kernel Contribution" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hust-os-kernel-pa...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hust-os-kernel-patches/88c3fa12-0dce-4c92-a8c3-6635fd8466f6%40kadam.mountain.


--
Best regards,
Dongliang Mu

Reply all
Reply to author
Forward
0 new messages