Re: 4GL run-time error (RDS) - termporary string space problem
Posted in 1996
In article <3202528E.66C2@mks.com>, John Postma <john@mks.com> writes >I keep getting the error: > >4GL run-time error number -4518. >The 4GL program cannot allocate any more space for temporary >string storage. > >from a 4GL program, but don't seem to be passing a parameter >> 512k which the manual claims in the source of the error. > >Anyone else run into this one? Solutions? > >Thanks much, >John From the Informix FAQ:- 4.1.1 I KEEP GETTING -4518 ERRORS! HOW CAN I FIX THIS PROBLEM? The -4518 error is usually caused by running out of a resource known as temporary string space. Solutions include: + Upgrade to 4GL-RDS 4.12 or greater. + Compile to a "real" executable with 4GL/C, rather than RDS. (You're less likely to hit it using 4GL/C) + Read Loren West's excellent description of how TSS is used (see Appendix A) + Read Informix TechInfo sheet #3925 (Loren's Article). Other -4518 related entries are 4064, 4517, and 2801. + Try to make do with the following information (most of which only address the symptoms, not the causes): This error can be caused by any of the following coding structures: + LET l_str = "Hello ",myfunc("World")) + CASE statements without an OTHERWISE # Pre-4.1 + CASE statements that look like this: # Pre-4.11 (maybe 4.10) CASE dummy_var WHEN 0 ..... WHEN 1 ..... WHEN 2 ..... END CASE instead of this: CASE WHEN dummy_var = 0 ..... WHEN dummy_var = 1 ..... WHEN dummy_var = 2 ..... END CASE + Reports with excessive string usage (ie. USING, or other literals). One thing you can do to reduce the contents of string storage is to assign redundant strings associated with USING to variables and then refer to the variable: let l_str1 = '$$$$$$$$.$$' PRINT l_number USING l_str1 + RETURNing large strings from functions. + Use of SPACE, SPACES, COLUMN, UPSHIFT, DOWNSHIFT, or WORDWRAP + Assignment of NULL to a string subscript: DEFINE x, y CHAR(10) LET y = NULL LET x[3,5] = y + A return statement in a report function. + Passing an argument to a function which has no parameters defined: CALL something(my_variable) ... FUNCTION something() From: heiker@quietsch.ping.de (Christian Heiker) There is an Informix-Lib *(undocumented function)* called "acdealloc()" which job it is to clear the stack. From a 4gl-program you can call this function with "CALL acdealloc()". With RDS you have to call a c-program which calls this function. Here are the steps do do it with RDS: - edit file "fgiusr.c" (copy $INFORMIXDIR/etc/fgiusr.c) int (hallo); #include <fgifunc.h> : : : cfunc_t usrfuncs[]= { "hallo", hallo, 0, 0,0,0 }; - create a new c-file, for example xy.c hallo() { acdealloc(); return 0; } - create a new runner (fglgo) cfglgo fgiusr.c xy.c -o newrun - Call the c-function in the RDS-program CALL hallo() - Start the program with the new runner You should pay attention that you make the call in an upper hierachy, for example after a FINISH REPORT. There is no guarantee that other important data may be deletet from the stack (because nobody nows what is at which time on the stack). BEWARE: There seems to be a bug in 4GL/ID (4.1 at least) which causes TSS problems to occur after the interrupt key has been pressed, which isn't very helpful if you're trying to find TSS problems in your program!!! -- David Williams