Project

General

Profile

Feature #8595

Bug #8581: Simplify generation of new threads at registrations for instances

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

Added by Ilja Zakharov 17 days ago. Updated 1 day ago.

Status:
Open
Priority:
Urgent
Assignee:
Category:
Environment model
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.

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

History

#1 Updated by Evgeny Novikov 13 days 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

#2 Updated by Evgeny Novikov 13 days ago

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

#3 Updated by Evgeny Novikov 7 days ago

The mentioned issue was fixed in commit: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.

#4 Updated by Evgeny Novikov 7 days ago

Evgeny Novikov wrote:

The mentioned issue was fixed in commit: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.

#5 Updated by Evgeny Novikov 7 days ago

Evgeny Novikov wrote:

The mentioned issue was fixed in commit: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.

#6 Updated by Evgeny Novikov 6 days ago

One more fix in commit: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.

#7 Updated by Evgeny Novikov 6 days ago

  • Status changed from Open to Resolved

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

#8 Updated by Evgeny Novikov 1 day 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'

Also available in: Atom PDF