Project

General

Profile

Actions

Bug #3131

closed

Wrong handling of function-like non-argument macros

Added by Denis Efremov almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Urgent
Category:
-
Start date:
06/27/2012
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

Aspectator doesn't support function-like macros without arguments as join points (or [primitive] pointcuts). But sometimes this feature is needed. For example, if we want to create kernel configuration invariant rule, we should create two types of aspects( on function and on macros ) in the following case:

include/linux/cpu.h-165:#ifdef CONFIG_HOTPLUG_CPU
include/linux/cpu.h:168:extern void get_online_cpus(void);
include/linux/cpu.h-169:extern void put_online_cpus(void);
include/linux/cpu.h-188:#else /* CONFIG_HOTPLUG_CPU */
include/linux/cpu.h:190:#define get_online_cpus() do { } while (0)
include/linux/cpu.h-191:#define put_online_cpus() do { } while (0)

Aspect (model0115_1a-blast.aspect):

8:after: call( void get_online_cpus(..) )
503:around: define( get_online_cpus() )

Error:

model0115_1a-blast.aspect:503.33-503.33: aspect file processed has incorrect syntax
cc1: fatal error: terminate work after syntax error happened
compilation terminated.
Aspectator fails on the 1st stage


Related issues 4 (3 open1 closed)

Related to C Instrumentation Framework - Bug #3208: Macros with a variable number of arguments supportClosedEvgeny Novikov07/13/2012

Actions
Blocks Linux Kernel Safety RuleDB - Feature #3223: 117: local_irq_save/local_irq_restore && local_irq_enable/local_irq_disable pairs one another nesting checkNewDenis Efremov07/18/2012

Actions
Blocks Linux Kernel Safety RuleDB - Feature #3032: 115: Do not use might_sleep functions in interrupt contextOpen06/14/2012

Actions
Blocks Linux Kernel Safety RuleDB - Feature #3225: 122: might_sleep functions should not be invoked with disabled interruptsOpen07/18/2012

Actions
Actions #1

Updated by Evgeny Novikov almost 12 years ago

  • Category set to 15
  • Status changed from New to Open
  • Assignee set to Evgeny Novikov
  • Priority changed from Normal to High

I guess that the issue hasn't a workaround, so, I raise its priority. But it isn't very important nevertheless, since such macros aren't used widely.

Several notes:
  • At present http://forge.ispras.ru/projects/cif is a more appropriate place for Aspectator's bugs and feature requests.
  • "Aspectator can't create aspects for function-like macros without arguments" should be formulated like "Aspectator doesn't support function-like macros without arguments as join points (or [primitive] pointcuts)" (of course, this is our lack, since we don't provide any well-written documentation on Aspectator).
  • There is a special pre tags that would be nice to be used while formatting code fragments (http://forge.ispras.ru/help/wiki_syntax_detailed.html).
Actions #2

Updated by Denis Efremov almost 12 years ago

  • Description updated (diff)
Actions #3

Updated by Evgeny Novikov almost 12 years ago

Thank you one more time for careful bug formulating. Just one note (the reason is that there is not documentation...). You don't need to write each time join points (or [primitive] pointcuts). When I have written this I just meant that either some kind of join points or some kind of pointcuts isn't supported. Join points are points in a program source code some of which can be instrumented. Pointcuts join one or more join points. Primitive pointcuts are relevant to specific constructions (like a macro definition or a function call). So, one can say that either some join points, or pointcuts, or primitive pointcuts aren't supported.

Actions #4

Updated by Denis Efremov almost 12 years ago

  • Priority changed from High to Urgent
Actions #5

Updated by Evgeny Novikov almost 12 years ago

Just want to note, that if one changes a priority of bug or feature request, he or she should explain the reason of this change. Often we forget about this. But this time it's worth noticing the change is due to 3 rule models require this feature to be implemented. Also you can find section "Related issues" and fill it (e.g. make this issue blocker of corresponding rule issues).

Actions #6

Updated by Evgeny Novikov almost 12 years ago

  • Status changed from Open to Resolved

Fixed in commit e323e50 of the master branch and tested now. Wait for 20-30 minutes.

Actions #7

Updated by Evgeny Novikov almost 12 years ago

Small tests passed successfully. Denis, please try to use this new pointcut and close the issue if you will find it to work well.

Actions #8

Updated by Evgeny Novikov over 11 years ago

  • Project changed from Linux Driver Verification to C Instrumentation Framework
  • Category deleted (15)
Actions #9

Updated by Evgeny Novikov over 11 years ago

  • Status changed from Resolved to Closed

I hope that it does can be closed.

Actions

Also available in: Atom PDF