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: NoneSeverity: 3 - Normal
Item Group: Software errorStatus: None
Privacy: PublicAssigned to: JbCh <jb_ch>
Open/Closed: OpenRelease: GIT-master
Reproducibility: Every TimeFixed 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 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 File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 01 Apr 2016 04:23:42 PM UTCjb_chAttached 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.1-cleanup1