Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

segmentation fault

Status
Not open for further replies.

ttkong

Programmer
Jun 5, 2002
22
MY
Hi all,

I encounter "segmentation fault" while running a 4GL program. I have no idea what is wrong after adding some codes to existing program and rerun.

Billion thanks.

Rgrds,
TTKong
 
Hi:

This sort of problem is very had to debug. The one time I saw it, a programmer had executed a go to from an INPUT statment control block (which isn't a good idea). I'd start looking at INPUT and INPUT ARRAY statments.

You don't say, but I'll bet you're using the 4GL compiled and not the rapid development system, RDS. Place debugging statments in the code trying to narrow down where the code fails.

Regards,


Ed
 
You could also be suffering from an array bounds error, try compiling with the -a flag.

This will mean that array bounds errors are checked at runtime, and if it is you will get a standard 4GL error with the line number in question.

If its not this, sometimes clues can be found by looking at the C code in the area in which the program fails.

Regards

Stuart
 
It has been a long time, but the two possibilities I can think of are;

1. An array that is too small (typically, they start with 0 rather than 1 and so it is often best to initialise the array to one more than the maximum.)

2. There is a funny updating the current record in a cursor. Although 4GL SHOULD keep track of the ID, it doesn't always do so and you may need to use a function with a name like GET_CURSOR_ID in the update statement.

I'm sorry that my answer is so woolly... I haven't had this problem for a long time and cannot remember exactly what caused it when I did, so those are just vague figments of my memory... Hopefully they will at least point you in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top