segmentation fault with c4gl
Posted in 2008
A user running I4GL 7.32 with IDS 10 on SuSE Linux x86_64 reported that a cron-scheduled 4GL program, which compiled fine and had worked for a long time, began dying with a Segmentation fault at runtime; recompiling the identical source under a different filename made it work again. Replies suggested the usual cause is an array out-of-bounds or mismatched argument/return counts between functions, recommended compiling with c4gl -a for array bound checking, and advised rebuilding with INFORMIXC="gcc -g" to get a core dump and gdb stack backtrace. No resolution is recorded in the thread.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Performance & Tuning, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues, Versions, Editions & End-of-Life
Hi, I am facing a strange problem (perhaps strange for me only). I am running IDS 10.UC4 on Suse Linux 9.0 (x86_64). My 4gl version is 7.32.UC3. All my 4gl problems are successfully getting compiled and executed. The problem is that at times, the same 4gl program stops executing stating an error message "Segmentation fault". I have no clues since the same code is getting executed till that date. The problem is with running the program and not compiling since it is getting compiled successfully. I tried to copy the 4gl file to another file name and compile and execute it. It worked!!!!! So, there is a problem in OS level which is not allowing my 4gl to get executed. Can any one of you experts, please let me know what tuning has to be done to get my 4gl getting executed without any interruption as it is scheduled with cron job. If any more inputs are required from my end, please let me know. Thanks in advance. Kiran. _________________________________________________________________ Searching for the best deals on travel? Visit MSN Travel. http://msn.coxandkings.co.in/cnk/cnk.do
That usually means you hit an array out of bounds error. Is the renamed code looking at the same data set? There's an option for c4gl to have it check array bounds, but I don't recall what it is off the top of my head. -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Kiran Kumar Sent: Sunday, August 03, 2008 3:30 AM To: ids@iiug.org Subject: segmentation fault with c4gl [12979] Hi, I am facing a strange problem (perhaps strange for me only). I am running IDS 10.UC4 on Suse Linux 9.0 (x86_64). My 4gl version is 7.32.UC3. All my 4gl problems are successfully getting compiled and executed. The problem is that at times, the same 4gl program stops executing stating an error message "Segmentation fault". I have no clues since the same code is getting executed till that date. The problem is with running the program and not compiling since it is getting compiled successfully. I tried to copy the 4gl file to another file name and compile and execute it. It worked!!!!! So, there is a problem in OS level which is not allowing my 4gl to get executed. Can any one of you experts, please let me know what tuning has to be done to get my 4gl getting executed without any interruption as it is scheduled with cron job. If any more inputs are required from my end, please let me know. Thanks in advance. Kiran. _________________________________________________________________ Searching for the best deals on travel? Visit MSN Travel. http://msn.coxandkings.co.in/cnk/cnk.do ************************************************************************ ******* Forum Note: Use "Reply" to post a response in the discussion forum.
Hi, is this occuring at the very first time or just later using a lot of times this program? henrique_lima_2000@yahoo.com.br --- Em dom, 3/8/08, Kiran Kumar <kirang001@hotmail.com> escreveu: > De: Kiran Kumar <kirang001@hotmail.com> > Assunto: segmentation fault with c4gl [12979] > Para: ids@iiug.org > Data: Domingo, 3 de Agosto de 2008, 7:30 > Hi, > > I am facing a strange problem (perhaps strange for me > only). > I am running IDS 10.UC4 on Suse Linux 9.0 (x86_64). > My 4gl version is 7.32.UC3. All my 4gl problems are > successfully getting compiled and executed. The problem is > that at > times, the same 4gl program stops executing stating an > error message > "Segmentation fault". I have no clues since the > same code is getting > executed till that date. The problem is with running the > program and > not compiling since it is getting compiled successfully. I > tried to > copy the 4gl file to another file name and compile and > execute it. It > worked!!!!! So, there is a problem in OS level which is not > allowing my > 4gl to get executed. Can any one of you experts, please let > me know > what tuning has to be done to get my 4gl getting executed > without any > interruption as it is scheduled with cron job. If any more > inputs are > required from my end, please let me know. > > Thanks in advance. > Kiran. > _________________________________________________________________ > > Searching for the best deals on travel? Visit MSN Travel. > http://msn.coxandkings.co.in/cnk/cnk.do > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in > the discussion forum. Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com. http://br.new.mail.yahoo.com/addresses
The renamed code is exactly the same replica of the existing code. It looks into the same data set. At first, I too expected the same problem of array bounds and increased the array size to a good extent. But still, the problem persists. And if you are able to recall the option for c4gl relating to array bounds, it would be more helpful to me. Thanks for your response. Regards Kiran.
Hi Henrique Lima, This code has been scheduled to run every day once through the crontab utility. Initially it was working. So, this implies that the problem is occurring after running the program several times. Thanks for your response. Regards Kiran.
Hi, Some years ago I had the same problem and I noted inside my program functions like popint, retint things like that and executing my program several times ... error! I noted I was putting some parts into the line, but I was extracting a different number of parts ... henrique_lima_2000@yahoo.com.br --- Em ter, 5/8/08, KIRAN KUMAR <kirang001@hotmail.com> escreveu: > De: KIRAN KUMAR <kirang001@hotmail.com> > Assunto: Re: segmentation fault with c4gl [12986] > Para: ids@iiug.org > Data: Terça-feira, 5 de Agosto de 2008, 2:38 > Hi Henrique Lima, > > This code has been scheduled to run every day once through > the crontab > utility. Initially it was working. So, this implies that > the problem is > occurring after running the program several times. > > Thanks for your response. > > Regards > Kiran. > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in > the discussion forum. Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com. http://br.new.mail.yahoo.com/addresses
On Mon, Aug 4, 2008 at 10:35 PM, KIRAN KUMAR <kirang001@hotmail.com> wrote: > The renamed code is exactly the same replica of the existing code. It looks > into the same data set. At first, I too expected the same problem of array > bounds and increased the array size to a good extent. But still, the problem > persists. And if you are able to recall the option for c4gl relating to array > bounds, it would be more helpful to me. c4gl -a includes array bound checking. Was the old (working) code also compiled on the same platform? Was it compiled with the same C compiler? If not, which version were you using previously? Which version are you using now? Was it compiled with the same version of I4GL? If not, which version were you using previously? Do you compile so that you get debug information in the executables - so you can see what the stack back-trace is? If so, please show the stack backtrace - gdb program.4ge core followed by 'where'. If not, please recompile with 'INFORMIXC="gcc -g" in the environment, and then rerun the program to get the core dump and stack back-trace. The back-trace should list function names, ideally. There could be a variety of reasons for the problem if it doesn't - the most likely is some major trampling over the bounds of the stack. With luck, the -a option would point that out. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/ "Blessed are we who can laugh at ourselves, for we shall never cease to be amused." NB: Please do not use this email for correspondence. I don't necessarily read it every week, even.