The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Why not a segmentation fault?? lagigliaivan High Level Programming 22 05-21-2008 08:07 AM
Segmentation Fault compbug UNIX for Dummies Questions & Answers 3 04-21-2006 07:43 AM
segmentation fault wojtyla High Level Programming 3 02-19-2005 11:53 AM
Segmentation fault jshaulis AIX 1 06-01-2004 01:16 PM
segmentation fault omran High Level Programming 2 08-01-2003 05:19 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-28-2008
Registered User
 

Join Date: Mar 2008
Posts: 14
Segmentation Fault

Hi,

While comparing primary key data of two tables thr bteq script I am getting this Error. This script is a shell script.

*** Error: The following error was encountered on the output file.
Script.sh[485]: 3043492 Segmentation fault(coredump)


Please let me know how to get through it.


Monika
Reply With Quote
Forum Sponsor
  #2  
Old 05-28-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 1,031
The [485] is the line number of the shell script, where the problem is occuring. I guess it's calling some binary program that might have an error trying to allocate or write into memory, but that is a different thing.

Last edited by zaxxon; 05-28-2008 at 11:29 PM.
Reply With Quote
  #3  
Old 05-28-2008
Registered User
 

Join Date: Mar 2008
Posts: 14
Quote:
Originally Posted by zaxxon View Post
The [485] is the line number of the shell script, where the problem is occuring. It's calling some program that tries to allocate memory or write into memory and there seems something is getting wrong.


Actually at line 485 its simply reading the name of table entered by user and nothing else.
This error occurs whenever I include the code to match Primary key data.
If I remove this code it works fine.

Please let me know how to get thr this
Reply With Quote
  #4  
Old 05-29-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 1,031
You wrote your own answer -> check you matching code for those keys. Maybe put a "set -x" in front of the the line where the error occurs and check what it does. Or echo your variable names to see what's stored in them.
I can't try to fix it, because I have no access to your code since you did not post it, nor am I sure if I could So the next logical thing would be to fix that code or ask someone who can fix it.

GL
Reply With Quote
  #5  
Old 05-29-2008
Registered User
 

Join Date: Mar 2008
Posts: 14
Quote:
Originally Posted by zaxxon View Post
You wrote your own answer -> check you matching code for those keys. Maybe put a "set -x" in front of the the line where the error occurs and check what it does. Or echo your variable names to see what's stored in them.
I can't try to fix it, because I have no access to your code since you did not post it, nor am I sure if I could So the next logical thing would be to fix that code or ask someone who can fix it.

GL

Hi,

Thanks for the Reply.
I am getting the same Error.Table name is correct.

Code on line no. 485 is:

table1_entry()
{
new_table=''
while [ -z "$new_table" ]
do
echo " "
echo "Enter name of table 1:"
read new_table
echo "t2::$new_table"
done

}


If I remove this functionality then I am getting correct ans without any Errors.But if I am comparing data for Primary key then I am getting that Error. there is additional code in this function to match other columns which r not primary key.It works fine for them.
key_query()
{

bteq<<-EOD
.logon $PASSWORD;

.set width 64000
.export report file=$path/match1.msq
.titledashes off

((select $pk_key
from $new_database.$new_table
minus
select $pk_key
from $base_database.$base_table) UNION
(select $pk_key
from $base_database.$base_table
minus
select $pk_key
from $new_database.$new_table));

.export reset

}
Reply With Quote
  #6  
Old 05-30-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 1,031
In the function "table1_entry()":
Quote:
new_table=''
Looks like it is missing another " or some other value inside "". But I guess that's not the reason for a segmentation fault - the script should just hang and wait for a complete value.
Interessting might be the calling of that function "table1_entry()" too. If the function is causing of this little typo up there unusable data, the binary that is processing it, might produce the segm. fault.

Fix that new_table=" and let's see if it works.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0