473,806 Members | 2,582 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9214
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
16314
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 signals correctly, in particular the SIGINT, preventing the application from stopping ungracefully. Indeed, I'd like to catch the signal, close everything in a consistent way and stop the application.
0
3544
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 database was upgraded to Oracle9i (9.2.0). The source code, including the project libraries, was re-compiled with 64-bit HP-UX C/C++ compiler options, the Pro*C code was pre-compiled with Oracle9i precompiler, and linked with 64-bit Oracle9i...
1
1659
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
2980
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
1946
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 these DLL interoperate with managed code. Among others things, the managed code need to be able to register for notification with the boost signals. I've tried different approaches (trying to register a pinned delegate with the boost::signal, etc...),
10
7525
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 __gnu_cxx::__exchange_and_add ()
1
3230
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 crash occured while calling the destructor of a std::string which is declared as "const std::string foo "+-" ; in one of my header file. Here is the stack trace when the crash occurs: detected a multithreaded program t@1 (l@1) terminated by...
1
2005
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 signal...\n"); } } int main( int argc, char ** argv ) { signal(SIGSEGV, sigHandler);
11
1843
by: vippstar | last post by:
What is the purpose of signals and why do they exist in C? thanks in advance
0
9597
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10620
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10372
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.