Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 951
  • Last Modified:

Bus error in shared memory

Hii
I am developing an application that uses posix shared memory to share some data between the different process.
It worked well for quite some days but then when i ran it again after a couple of days , it showed me bus error whenever i tried to fill the shared memory with data.
i wrote a number of different programs earlier for shared memory but i am not able to run a single program now and every program is giving the same bus error.
pls suggest some way to resolve this
0
parmarparveen
Asked:
parmarparveen
  • 2
  • 2
1 Solution
 
ravenplCommented:
bus error usually means broken memory/motherboard or the linux kernel.
bus error(the SIGBUS i assume) is reported when MMU reports some kind of error.
Test Your memory with http://memtest.org/ for the start
0
 
parmarparveenAuthor Commented:
The behaviour is very unpredictable. now one of my program which is allocating shared memory of size 1000 bytes is working fine while another program which is allocating 500000 bytes is giving the bus error . Is there any restriction on the size of shared memory??
0
 
ravenplCommented:
Please test the memory, and replace kernel image first(update).
There are limits put on sizes of shared memory, but You should encounter SEGV not BUS.
Current limits can be found at /proc/sys/kernel/shm*
0
 
parmarparveenAuthor Commented:
The problem which i am facing is actully faced y other ppl too. It is because i am trying to mmap very large size of memory. The mmap is not returning  any error though but still whenevr i try to access the memory(read and write) after a specified no of bytes(4096),its giving bus error.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now