Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000714Taste[All Projects] Ocarina - C code generationpublic2017-11-14 13:412018-04-15 20:46
Assigned Tohugues 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version

Make the task start before calling their init function


At the moment the task's initialization function (as defined in the AADL model) is called before the task start.

This prevents calling a RI from within the startup code.

It would make sense to create the tasks first (allocate input/output buffers) and then call the init code when they are running.
(Perhaps with a synchronisation point after the init to wait for other tasks to finish initialisation))

Something like:

     if (!init) {
        call_user_init();   // can call RIs, i.e. place messages in output buffer
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
hugues (administrator)
2017-11-14 13:54

Activate_Entrypoint is the "init" function called by the thread once after it has been created
Initialize_Entrypoint is the "init" function called by the main function before the thread has been created

Both are supported.

maxime (administrator)
2018-04-14 19:33

Hi Jerome,

I have replaced "Initialize_Entrypoint_Source_Text" with "Activate_Entrypoint_Source_Text" in the AADL file.

This works with POHI-Ada but not with POHI-C :

Thread 2 "x86_partition" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7ff3a40 (LWP 17982)]
0x00005555555767be in __po_hi_gqueue_store_in (id=x86_partition_function2_k, 
    port=function1_local_outport_init_yourself, request=0x555555781bb0 <__po_hi_function1_recent>)
    at /home/taste/work/activate_entrypoint/binary.c/GlueAndBuild/deploymentview_final/x86_partition/../polyorb-hi-c/src/./po_hi_gqueue.c:284
284        if (__po_hi_gqueues_sizes[id][port] == __PO_HI_GQUEUE_FIFO_INDATA)
hugues (administrator)
2018-04-15 11:04

Addressed here: [^]

the activate was called before the initialisation of the queue, my bad

maxime (administrator)
2018-04-15 13:17

Ok, thanks for the fix

maxime (administrator)
2018-04-15 20:46

It seems to still crash both in C and in Ada.

In C:

Thread 11 "groundstation" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7f25a40 (LWP 10093)]
0x00005555555b3566 in __po_hi_gqueue_store_in (id=groundstation_vt_coronagraphcontroller_set_drone_id_k, port=gui_local_outport_start_demo,
request=0x5555557d5d70 <__po_hi_vt_coordinator_start_demo_recent+240>)
at /home/taste/work/DroneTracker/TasteDemo2/binary.c/GlueAndBuild/deploymentview_final/groundstation/../polyorb-hi-c/src/./po_hi_gqueue.c:284
284 if (__po_hi_gqueues_sizes[id][port] == __PO_HI_GQUEUE_FIFO_INDATA)

And in Ada, it is a bit different, but "The_Periodic_Task" crashes apparently if one of the startup() function takes some time to complete.

- Issue History
Date Modified Username Field Change
2017-11-14 13:41 maxime New Issue
2017-11-14 13:41 maxime Status

new => assigned

2017-11-14 13:41 maxime Assigned To

=> hugues

2017-11-14 13:54 hugues Note Added: 0003112
2018-04-14 19:33 maxime Note Added: 0003280
2018-04-15 11:04 hugues Note Added: 0003281
2018-04-15 13:17 maxime Note Added: 0003282
2018-04-15 13:17 maxime Status

assigned => resolved

2018-04-15 13:17 maxime Resolution

open => fixed

2018-04-15 20:46 maxime Note Added: 0003283
2018-04-15 20:46 maxime Status

resolved => new

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker