https://bugs.linaro.org/show_bug.cgi?id=1873

            Bug ID: 1873
           Summary: odp process-mode is broken
           Product: OpenDataPlane - linux- generic reference
           Version: 1.3
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: critical
          Priority: ---
         Component: General ODP
          Assignee: [email protected]
          Reporter: [email protected]

Overview: Using forked child processes as odp workers is partly broken.

Calling odp_shm_reserve() from a forked _child_ process followed by a
odp_shm_lookup() from another _child_ process causes a segmentation fault when
the child process that did the lookup tries to access the shared memory.
Everything works fine if the shared memory is created by the parent process
before the fork.
The odp flag 'ODP_SHM_PROC' makes no difference.

Steps to Reproduce:

parent process             child process 1         child process 2
----------------------------------------------------------------------------
odp_init_global()
odp_init_local()
odph_linux_process_fork_n(proc, cpu_mask);
odph_linux_process_wait_n()

                          <child1 created>          <child2 created>
                          <enter worker func>       <enter worker func>
                          odp_init_local()          odp_init_local()

                          shm=odp_shm_reserve(name)
                          barrier()                 barrier()
                                                    shm=odp_shm_lookup(name)
                          barrier()                 barrier()
                          data=odp_shm_addr(shm)    data=odp_shm_addr(shm)
                          foo=data->field /*OK*/    foo=data->field /*NOK*/
                          ... continue...           !SEGMENTATION FAULT!
                                                    ... crash ...

...

Actual Results: What happened after performing the above steps:
The child process accessing the looked up shm crashes.

Expected Results: What should have happened, were the bug not present:
All child processes should be able to access the shared memory.

Additional Information:
Could it be that something is missing from odp_shm_lookup()? Adding shm_open()
and mmap() to the lookup might help but then the reserved address
might be different for each child process and pointer sharing is no longer
usable.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to