Bug #1159
closed
Aspectator fails with incorrect expression code
Added by Pavel Shved over 13 years ago.
Updated over 5 years ago.
Description
Steps to reproduce:
LDV_DEBUG=30 ldv-manager rule_models=32_1a "envs=linux-2.6.31.6.tar.bz2" drivers=drivers/media/dvb/ttpci/dvb-ttpci.ko kernel_driver=1
see report for ldv_main4_sequence_infinite_withcheck_stateful
:
work/current--X--drivers/media/dvb/ttpci/dvb-ttpci.ko--X--ri04linux-2.6.31.6--X--32_1a/linux-2.6.31.6/csd_deg_dscv/17/dscv_tempdir/dscv/ri/32_1a/drivers/media/dvb/ttpci/av7110_hw.c.p: In function 'av7110_fw_cmd':
work/current--X--drivers/media/dvb/ttpci/dvb-ttpci.ko--X--ri04linux-2.6.31.6--X--32_1a/linux-2.6.31.6/csd_deg_dscv/17/dscv_tempdir/dscv/ri/32_1a/drivers/media/dvb/ttpci/av7110_hw.c.p:517:1: fatal error: incorrect expression code
compilation terminated.
Aspectator fails on the 3d stage
There are 91 drivers affected by this issue.
Two "unsafe" (maybe false, though) dvb drivers became unknown because of that.
Since this issue might actually be split among the lesser ones (I guess, there are several unimplemented expression codes of sorts), I'll leave the Normal priority, and postpone its adjustment to the further investigation.
- Status changed from New to Open
Yes, there may be several problems here. They arose due to more correct traversing through gcc trees made be the new aspectator. In fact it may be very simply to fix this bug.
- Priority changed from Normal to High
It seems me a rather simple bug that will give us a big benefit.
First of all I'm going to do some improvement to print more informative messages. In particular, this will help to investigate the given set of problems and similar ones. In fact this is the part of #970 issue.
After all I found that there are about two expressions aren't supported by aspectator
- va_arg_expr (drivers-media-dvb-ttpci-av7110_hw.c)
- truth_xor_expr (drivers-ide-ide-taskfile.c) (almost all!)
From the moment they are treated as warnings like in C-backend and detailed information is printed:
drivers/video/console/fonts.c.common.c: In function 'get_default_font':
drivers/video/console/fonts.c.common.c:146:1: warning: LDV: ../../../src/branches/aspectator-core/gcc/ldv-pointcut-matcher.c: 257: tree node 'truth_xor_expr' isn't supported [enabled by default]
I'm going to add their support to both aspectator and C-backend and then test problem transitions.
Commit 55e6e94 of model-43_1a branch is most likely to fix the issue. But just testing on all Linux kernel drivers will show is this true.
I found 2 more unsupported tree nodes that can be referred to as 'incorrect expression code'. They are
- truth_and_expr (4 drivers)
- truth_or_expr (1 driver)
- non_lvalue_expr (1 driver)
I should fix them...
More unsupported tree nodes of this class:
- truth_orif_expr
- bind_expr
So, from 166 pairs module-main there are
- 111 truth_xor_expr and va_arg_expr that were fixed in 55e6e94 of model-43_1a branch.
- 32 truth_and_expr
- 14 truth_or_expr
- 7 non_lvalue_expr
- 1 truth_orif_expr
- 1 bind_expr
- Priority changed from High to Normal
I believe that this issue isn't so important any more.
There are still several truth_and_expr, truth_orif_expr and truth_or_expr bugs.
May be they are not so often, but I would prefer to fix them in the nearest future.
Alexey Khoroshilov wrote:
There are still several truth_and_expr, truth_orif_expr and truth_or_expr bugs.
May be they are not so often, but I would prefer to fix them in the nearest future.
Here I have highlighted that just truth_xor_expr and va_arg_expr were fixed while the rest 5 kinds of expressions sometimes or always fails. But we should fix them of course :)
- Priority changed from Normal to High
We need to fix it since there is a lot of drivers that cannot be verified because of the given issue.
- Priority changed from High to Low
Commit 70075ca of the master branch has fixed processing of all expressions except one truth_orif_expr. This expression is encountered in driver drivers/media/video/saa7115.ko in function saa711x_has_reg, that has rather complex condition. It looks like there is some dependency on the number of operands in GCC. When I cut several operands from the expression it is processed well.
- Project changed from Linux Driver Verification to C Instrumentation Framework
- Category deleted (
15)
- Subject changed from GCC-aspectator fails with incorrect expression code to Aspectator fails with incorrect expression code
- Priority changed from Low to High
At the moment truth_orif_expr is also encountered in fs/xfs/xfs.ko, for which 31 main is generated. Also that module "uses" truth_andif_expr. So I raise the issue priority.
- Priority changed from High to Normal
- Priority changed from Normal to High
- Category set to C back-end
- Status changed from Open to Closed
I fixed most or all of mentioned issues. Please, open more specific ones if so.
Also available in: Atom
PDF