Solved

Bus error in shared memory

Posted on 2008-06-13
4
869 Views
Last Modified: 2013-12-21
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
Comment
Question by:parmarparveen
  • 2
  • 2
4 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 21779935
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
 

Author Comment

by:parmarparveen
ID: 21781104
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
 
LVL 43

Accepted Solution

by:
ravenpl earned 500 total points
ID: 21781374
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
 

Author Comment

by:parmarparveen
ID: 21785262
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

As you can read I recycle all my old hardware and the time has come that my power supply of 200 Watt cannot provide enough power for my backup server. I have lots of Compaq power supply's laying around, so I figured to use one of these PSU's. I t…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now