473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

signals (SIGBUS and SIGSEGV)

what is the difference between signals SIGBUS and SIGSEGV ?
when does an application program receive SIGBUS and in which
cases SIGSEGV ?

thanx in advance for any help ...
Nov 14 '05 #1
4 9182
junky_fellow wrote:
what is the difference between signals SIGBUS and SIGSEGV ?
when does an application program receive SIGBUS and in which
cases SIGSEGV ?


Neither of them are defined by the C language, so in order to get info you
better also say which operating system and then take all that to an OS
specific group.
That said, google didn't take me more than a minute to find something(ok, I
knew what I was looking for, but ...).

Uli

Nov 14 '05 #2
Ulrich Eckhardt <do******@knuut.de> writes:
junky_fellow wrote:
what is the difference between signals SIGBUS and SIGSEGV ?
when does an application program receive SIGBUS and in which
cases SIGSEGV ?


Neither of them are defined by the C language, so in order to get info you
better also say which operating system and then take all that to an OS
specific group.


On the contrary, SIGSEGV is defined by the C standard as "an
invalid access to storage". SIGBUS is, as you say, not defined
as part of C.
--
"C has its problems, but a language designed from scratch would have some too,
and we know C's problems."
--Bjarne Stroustrup
Nov 14 '05 #3
junky_fellow wrote:

what is the difference between signals SIGBUS and SIGSEGV ?
when does an application program receive SIGBUS and in which
cases SIGSEGV ?

thanx in advance for any help ...


OT for comp.lang.c, but...

http://www.brainboost.com/search.asp...and+SIGSEGV%3F

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Nov 14 '05 #4

SEGV - Tends to mean you have attempted to access a segment of
memory that does not exist.

BUS - Tends to mean you have attempted to access a segment of
memory that dies exist but have accessed it in correctly
sometimes certin cpu's require address to be aligned on certin
boundryies eg 8 / 16 / 32 / 64 bit address

Although this is offtopic it can cause havoc when trying
to write C programs on certin types of cpu's because of certin
alignment problems.

PS. i had to rewrite malloc / free / etc.. to get around this
problem on 1 system.

James

On 2 Aug 2004, junky_fellow wrote:
what is the difference between signals SIGBUS and SIGSEGV ?
when does an application program receive SIGBUS and in which
cases SIGSEGV ?

thanx in advance for any help ...


--
--------------------------
Mobile: +44 07779080838
http://www.stev.org
12:30am up 22 days, 16:06, 3 users, load average: 0.39, 0.34, 0.79

Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gabriele Bartolini | last post by:
Hi, I am writing an application in C++ on Linux, using threads (this is my first experience with pthreads). The application itself is fine, it is just that I wanted to handle asynchronous...
0
by: Paffko | last post by:
What are the possibilities of getting SIGBUS and SIGSEGV errors in the following scenario? There is a program (C/C++/Pro*C) that was running fine under HP-UX 11.x and Oracle8i (8.1.6). Oracle...
1
by: Leo Kirch | last post by:
Hello XSLT gurus, i've got a rather difficult problem. Some explanations first. theres a signal oriented xml-file - the graphical represantation looks like: | startsignal (signal00) \...
11
by: Jackie | last post by:
Hi everyone, I'd like to know when and how signals are used (e.g. SIGFPE, SIGABRT, SIGTERM, SIGSEGV, SIGINT)? Thank you so much.
0
by: Arnaud Debaene | last post by:
Hello all. I've got a bunch of existing, non managed, C++ DLLs that export types with, among other things, public events implemented using the boost::signals library. Now, I need to have...
10
by: contactmayankjain | last post by:
Hi, I am getting the following error. Can you tell me any solution to this problem and the reason for this 298 Program received signal SIGBUS, Bus error. 0x000000080137ae02 in...
1
by: alpha77 | last post by:
Hi, I am getting frequent SIGSEV/SIGBUS while my main returns. I am using C++ Forte Compiler : CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-20 2004/03/19 The core stack trace shows that the...
1
by: krazedkid | last post by:
I am trying to get my code to handle SIGSEGV multiple times, it will handle one of them but then nothing else. void sigHandler( int signum ) { if ( signum == SIGSEGV ) { printf("got a...
11
by: vippstar | last post by:
What is the purpose of signals and why do they exist in C? thanks in advance
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.