- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to generate a SIGSEGV in a program.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2003 09:36 PM
тАО10-27-2003 09:36 PM
We are trying to debug an application in which SIGSEGV is generated.
We are trying to write a small test program to simulate the problem.
Hence, although it may sound funny :) I want my program to generate SIGSEGV.
I do not want ot use the raise(SIGSEGV) or kill -11
I have tried the following way:
char* abc = NULL
strcpy(abc,"TEST");
but instead of generating SIGSEGV(signal 11), it is generating SIGBUS(signal 10).
I am using aCC compiler on HP-UX11i OS.
Can anyone help me writing a piece of code that would generate a SIGSEGV?
Regards,
Shashibhushan Gokhale
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2003 10:19 PM
тАО10-27-2003 10:19 PM
Re: How to generate a SIGSEGV in a program.
main(){
short b;
b+=1234;
printf("%sd",b);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2003 10:28 PM
тАО10-27-2003 10:28 PM
Re: How to generate a SIGSEGV in a program.
As you guessed, it is not working in my case.
Anyway, thanks for the help.
Regards,
Shashibhushan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2003 10:40 PM
тАО10-27-2003 10:40 PM
Re: How to generate a SIGSEGV in a program.
b+=12345
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2003 10:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2003 10:58 PM
тАО10-27-2003 10:58 PM
Re: How to generate a SIGSEGV in a program.
How about this
main()
{
int val[10];
val[9999999999]=100;
}
HTH,
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 07:07 PM
тАО10-28-2003 07:07 PM
Re: How to generate a SIGSEGV in a program.
The approach suggested by Umapathy didn't compile and it gave a nasty compile time error.
Anyway thanks to all of you for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 08:33 PM
тАО10-28-2003 08:33 PM
Re: How to generate a SIGSEGV in a program.
Very sorry. Didnt test it. Wrote it from top of my head. If you have decreased a couple of zeros then it would have done fine except that warning.
cheers
Umapathy