Project

General

Profile

Actions

Feature #8595

closed

Add a guard to restrict calling isntances related to different containers at registration

Added by Ilja Zakharov over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
Environment models
Target version:
Start date:
11/24/2017
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

There is a nondeterministic registration of all available instances at registration function models. For the first step it is necessary to add an additional guard to prevent registrations of such unrelavant callbacks.


Files

job.json (969 Bytes) job.json Evgeny Novikov, 11/28/2017 06:37 PM
job.json (19 KB) job.json Evgeny Novikov, 12/10/2017 03:51 PM
cyclades.json (30.5 KB) cyclades.json Evgeny Novikov, 12/10/2017 03:51 PM

Related issues 1 (1 open0 closed)

Related to Klever - Bug #8581: Simplify generation of new threads at registrations for instancesNewIlja Zakharov11/24/2017

Actions
Actions #1

Updated by Evgeny Novikov over 6 years ago

Initial implementation was done in branch 8595-add-guards. But it turned out that it doesn't operate well with containers defined in various files. I attached an example of a job where I got the following error in Weaver caused by the incorrect environment model:

../vtg/drivers/tty/cyclades.ko4ba1bb20240b/linux:empty/weaver/.tmp_pty.c.aux: In function 'ldv_dispatch_insmod_deregister_32_2':
../vtg/drivers/tty/cyclades.ko4ba1bb20240b/linux:empty/weaver/.tmp_pty.c.aux:197:38: warning: unused variable 'cf_arg_17' [-Wunused-variable]
../vtg/drivers/tty/cyclades.ko4ba1bb20240b/linux:empty/weaver/.tmp_pty.c.aux: In function 'ldv_dispatch_register_20_1':
../vtg/drivers/tty/cyclades.ko4ba1bb20240b/linux:empty/weaver/.tmp_pty.c.aux:220:31: error: 'console_fops' undeclared (first use in this function)
Raise exception:
Traceback (most recent call last):
  File "/home/debian/klever/core/core/components.py", line 413, in run
    self.main()
  File "/home/debian/klever/core/core/components.py", line 320, in callbacks_caller
    ret = attr(*args, **kwargs)
  File "/home/debian/klever/core/core/vtg/weaver/__init__.py", line 116, in weave
    filter_func=core.vtg.utils.CIFErrorFilter())
  File "/home/debian/klever/core/core/utils.py", line 169, in execute
    raise CommandError('"{0}" failed'.format(cmd))
core.utils.CommandError: "cif" failed

Actions #2

Updated by Evgeny Novikov over 6 years ago

BTW, all branches with EMG improvements and fixes are incorporated within branch emg-improvements.

Actions #3

Updated by Evgeny Novikov over 6 years ago

The mentioned issue was fixed in 6600e2f. But there is another one. Namely, EMG generates incorrect guards at least for interrupt handlers. Instead of comparing argument values passed when registering corresponding interrupt handlers with those handlers, it compares them with EMG wrappers.

Actions #4

Updated by Evgeny Novikov over 6 years ago

Evgeny Novikov wrote:

The mentioned issue was fixed in 6600e2f. But there is another one. Namely, EMG generates incorrect guards at least for interrupt handlers. Instead of comparing argument values passed when registering corresponding interrupt handlers with those handlers, it compares them with EMG wrappers.

I am wondering why existing tests don't reveal this since it seems that such the guards prevent invocation of interrupt handlers at all.

Actions #5

Updated by Evgeny Novikov over 6 years ago

Evgeny Novikov wrote:

The mentioned issue was fixed in 6600e2f. But there is another one. Namely, EMG generates incorrect guards at least for interrupt handlers. Instead of comparing argument values passed when registering corresponding interrupt handlers with those handlers, it compares them with EMG wrappers.

You can find an example by checking drivers/tty/cyclades.ko of Linux 3.14.

Actions #6

Updated by Evgeny Novikov over 6 years ago

One more fix in 9e43980 perhaps could help to invoke interrupt handlers. But unfortunately it sometimes even prevents invocation of pci_driver callbacks and perhaps callbacks of some other categories. For instance, this is the case for already mentioned module drivers/tty/cyclades.ko of Linux 3.14.

It seems that now EMG generates too many redundant aliases even for particular known callbacks defined and referred just in corresponding C files.

Actions #7

Updated by Evgeny Novikov over 6 years ago

  • Status changed from Open to Resolved

Looks like all issues, some of which were caused by imprecise analysis by CPAchecker, were fixed in 98ae53a.

Updated by Evgeny Novikov over 6 years ago

It seems that the suggested implementation does not support forbidding invoking callbacks. For instance, for the attached files I got the following error:

Raise exception:
Traceback (most recent call last):
  File "/home/debian/klever/core/core/components.py", line 413, in run
    self.main()
  File "/home/debian/klever/core/core/components.py", line 320, in callbacks_caller
    ret = attr(*args, **kwargs)
  File "/home/debian/klever/core/core/vtg/emg/__init__.py", line 113, in generate_environment
    generated_code)
  File "/home/debian/klever/core/core/vtg/emg/translator/__init__.py", line 38, in translate_intermediate_model
    instance_maps, generated_code)
  File "/home/debian/klever/core/core/vtg/emg/translator/instances.py", line 71, in yield_instances
    processes = _fulfill_label_maps(logger, conf, analysis, [process], process, instance_maps, instances_left)
  File "/home/debian/klever/core/core/vtg/emg/translator/instances.py", line 185, in _fulfill_label_maps
    cached_map)
  File "/home/debian/klever/core/core/vtg/emg/translator/instances.py", line 440, in _split_into_instances
    instance_map[expression][interface] = value_to_implementation[smap[expression][interface]]
KeyError: 'ldv_emg_alias_tty_ldiscs_seq_ops_2'

Actions #9

Updated by Evgeny Novikov over 6 years ago

  • Status changed from Open to Resolved

Eventually fixed in branch emg-improvements.

Actions #10

Updated by Evgeny Novikov over 6 years ago

  • Parent task deleted (#8581)
Actions #11

Updated by Evgeny Novikov over 6 years ago

  • Related to Bug #8581: Simplify generation of new threads at registrations for instances added
Actions #12

Updated by Ilja Zakharov about 6 years ago

Moved to 8066-abstract-translator.

Actions #13

Updated by Evgeny Novikov over 5 years ago

  • Status changed from Resolved to Closed

Branch klever-2.0 passed all tests and I merged it to master in 72be796e3 marked as v2.0rc1.

Actions

Also available in: Atom PDF