bugCERTI - Bugs: bug #47598, Segmentation fault when running...

 
 

bug #47598: Segmentation fault when running Posix Ring Buffer on CertiProcessus_A/B

Submitted by:  JbCh <jb_ch>
Submitted on:  Fri 01 Apr 2016 04:23:42 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  Software error Status:  Fixed
Privacy:  Public Assigned to:  JbCh <jb_ch>
Open/Closed:  Open Release:  GIT-master
Reproducibility:  Every Time Fixed Release:  GIT-master

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 03 Jan 2018 02:36:40 PM UTC, comment #2: 

Fixed on br_jbch_4.0.0 (commit #9827427) and tested under Fedora 23 64 bits (gcc  5.3.1).

Works fine.

JbCh <jb_ch>
Project AdministratorIn charge of this item.
Wed 06 Apr 2016 02:46:42 PM UTC, comment #1: 

Ongoing investigation, I am updating the ticket as documentation of current findings.

Problem seems to comes from the access right to the memory segment where you need to update Write/Read pointer values.

To resume a Ring buffer (from sender to receiver) needs two memory areas.
1) One to read and write the explicit datas
2) One to maintain the Ring Buffer status

For 2), the writer AND the reader need RW access to maintain the Ring Buffer status.

Problem have to be fixed in:
1) shm_open(..) usage (line 43 in SHMPosix::Open() function)
2) mmap(..) usage (line 92 SHMPosix::Attach() function)

JbCh <jb_ch>
Project AdministratorIn charge of this item.
Fri 01 Apr 2016 04:23:42 PM UTC, original submission:  

I tried the test case for the SHM Memory communications between complied processus (with CERTI) CertiProcessus_A and CertiProcessus_B.

These are located under /CERTI_INSTALL_PATH/bin
When you try to run the Posix Ring Buffer SHM test case, then it fails.

To reproduce it:
----------------
1) In Main_SocketSHM.cc, due to Ticket #47597, Change line 63  from "Win32" to "Posix" and recompile CERTI

2) Go to the bin folder and open two terminals (don't forget to "source" CERTI env)

3) In one terminal call:

>> ./CertiProcessus_A


4) In the other terminal call:

>> ./CertiProcessus_B


5) Then Follow the instructions and select "RB" option to use Ring Buffer. Then you must send (command "S") from one process (example A) and read from the other (command "R" for example on B).

6) Then the reader will fail reporting
-------------------------------------------------
RingBuffer -->  Try to Receive...
RingBuffer::Receive(...) --> BEGIN Algorithm : Count_CS = 34 | Write_CS = 16| Read_CS = 0
RingBuffer::Receive(...) --> Utilisation memcpy Simple
RingBuffer::Receive(...) --> Adresse Utilisee  _Shm_CS->GetShm() = 0x7efcee8b8000| _Shm_CS->GetShm() + _Tab_CS[2] = 0x7efcee8b8000
RingBuffer::Receive(...) --> END Algorithm : Count_CS = 50 | Write_CS = 16| Read_CS = 16
AVANT  memcpy(_Pw_Pr_CS->GetShm(), _Tab_CS, 3 * sizeof(int) ) ; !!
Segmentation fault (core dumped)
-------------------------------------------------

See attached my Logs from CertiProcessus_A and CertiProcessus_B.
I am taking this over.

JbCh <jb_ch>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jb_ch (Submitted the item)
  •  

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-03 jb_ch StatusNone => Fixed
    2016-04-01 jb_ch Attached File- => Added Log_CertiProcessus_A_2016_04_01.log, #36814
        Attached File- => Added Log_CertiProcessus_B_2016_04_01.log, #36815

    Back to the top


    Powered by Savane 3.5