The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Segmentation (CoreDump) error !! varungupta UNIX for Advanced & Expert Users 16 04-21-2008 06:16 PM
bus error (coredump) charu UNIX for Dummies Questions & Answers 4 12-12-2007 06:05 AM
SSL key give coredump error!! e_jeffhang HP-UX 0 02-24-2006 06:43 AM
Bus Error(coredump) Jayesh UNIX for Advanced & Expert Users 2 10-04-2005 04:35 PM
Bus error(coredump Student37 UNIX for Dummies Questions & Answers 3 07-01-2005 04:53 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-17-2009
Vision© Vision© is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 3
Need help on Bus error(coredump)

Hi all,

I am quite weak in C but I need to get some work done. Hope someone can help me out. I keep getting this error when i try to run my C application in my HP-UX 10.20 machine.

Some code snippet:

Code:
Month(DBTime) =====This is a function which will return variable "CutOffTime" to be use below
strcpy(DBSecTime, CutOffTime)
sprintf(str, "DBSecTime is : %s\n", DBSecTime);
InputLog(Log, str);

exec sql begin works;
sprintf(str, "DBSecTime is : %s\n", DBSecTime);
InputLog(Log, str);

exec sql select * from tableA where time < :DBSecTime

exec sql commit work;
I am able to print out values of DBSecTime on every sprintf until I reach the sql statement, following which, a Bus error(coredump) will appear.

Hope someone is able to give me some advices. Thanks in advance.
  #2 (permalink)  
Old 02-17-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
You should include more code, such as the declaration of DBSecTime. And what is this ?
Code:
exec sql select * from tableA where time < :DBSecTime
That's not C code.
  #3 (permalink)  
Old 02-17-2009
Vision© Vision© is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 3
Quote:
Originally Posted by otheus View Post
You should include more code, such as the declaration of DBSecTime. And what is this ?
Code:
exec sql select * from tableA where time < :DBSecTime
That's not C code.

Hi otheus, sorry about that, I have included more codes.

Code:
exec sql begin declare section;
char DBSecTime[15];
exec sql end declare section;

Month(DBTime) ===== This is a function which will return variable "CutOfftime" to be use below:
strcpy(DBSecTime, CutOffTime)
sprintf(str, "DBSecTime is : %s\n", DBSecTime);
InputLog(Log, str);

exec sql begin works;
sprintf(str, "DBSecTime is : %s\n", DBSecTime);
InputLog(Log, str);

exec sql select * from tableA where time < :DBSecTime

exec sql commit work;
exec sql select * from tableA where time < : DBSecTime, this is actually a embedded sql statement in my C code. I just find it strange that the 2 sprintf statement was able to run smoothly but not the DBSecTime that was in the sql statement. I have even try to replace DBSecTime in the sql statement with a value like "200812000000" and it managed to got thru too.

Last edited by Vision©; 02-17-2009 at 09:41 PM.. Reason: Additional Info
  #4 (permalink)  
Old 02-17-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,576
Lets start simple:
What does
Code:
 file core
return?
  #5 (permalink)  
Old 02-17-2009
Vision© Vision© is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 3
Quote:
Originally Posted by vbe View Post
Lets start simple:
What does
Code:
 file core
return?
Hi vbe, file core return
core: core file from 'Test.exe' - received SIGBUS
  #6 (permalink)  
Old 02-18-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
Ah. you haven't nul-terminated DBSecTime!! C won\t do that for unless you tell it to.

char DBSecTime[15] = { 0 };
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0