[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2084.0. "Fatal error during compilation - DEC C V5.2-033 on Unix 4.0b" by HPCGRP::DEGREGORY (Karen 223-5801) Wed Feb 05 1997 09:19

The following fatal compiler error occurs on Unix 4.0b. Note
that the -g switch is required to make the error happen.

I would appreciate getting an interim compiler with a fix
that I can give to KAI so they can continue their 
development work.

Thanks,
Karen


DEC C V5.2-033 on Digital UNIX V4.0 (Rev. 563)

oursmp> cc -g -migrate test.c
cc: Fatal: A memory access violation (bus error or segmentation fault)
has occurred.  Please submit a problem report.


***************  test.c *************

#define a(x) x##x##x##x##x##x##x##x##x##x##x##x##x##x##x##x
struct a(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX);
T.RTitleUserPersonal
Name
DateLines
2084.1Still a problem...DECC::SULLIVANJeff SullivanWed Feb 05 1997 10:009
I tested this with the development DEC C compilers for Digital UNIX V4.2 and
later (Platinum.minor and Steel). Both compilers, as well as the latest
development compiler demonstrate this crash.

I'll report this problem in  our internal bugtracking system. I guess the
workaround in this case is to not use -g...

-Jeff
 
2084.2The problem is the length of the struct nameDECC::SULLIVANJeff SullivanWed Feb 05 1997 10:4259
Not sure if this will help you find a workaround or not, but it appears that
what's crashing the compiler is the length of the struct name. I found that
somewhere around 271 chars will crash it. Below is a test case, where you can
generate any number of crashes. Note that you can create an int with a long
name, but a struct is a different story.

In the below, CRASH1 is the original case; CRASH2 is what the macro expands too
(no problem with the expansion or macro); NOCRASH verifies that this long name
does not crash as an int variable name; STRLEN creates an executable that will
print of the strlen of the minimum name that I could get to crash it. The
default case is the minimal test case.

I think that the exact number may vary by compiler, as overwrites are sometimes
variable. It looks to me like the generating the symbol table information is
what's causing the problem.

This is definitely a compiler bug.

-Jeff

#define a(x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XXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;
#elif STRLEN
printf("strlen of struct name that crashes is %d\n",
strlen("x232456789_123456789_123456789_123456789_123456789_1232456789_123456789_
123456789_123456789_123456789x123456789_123456789_123456789_123456789_1232456789
_123456789_123456789_123456789_123456789_123456789x1232456789_123456789_12345678
9_123456789_123456789_123456789_1234567"));
#else
struct
x232456789_123456789_123456789_123456789_123456789_1232456789_123456789_12345678
9_123456789_123456789x123456789_123456789_123456789_123456789_1232456789_1234567
89_123456789_123456789_123456789_123456789x1232456789_123456789_123456789_123456
789_123456789_123456789_1234567;
#endif
}

2084.3Reported as cxxc_bugs 4115. Another workaround...DECC::SULLIVANJeff SullivanWed Feb 05 1997 14:2736
This is being tracked internally as cxxc_bugs 4115. I expect that this can be
fixed in the DEC C compilers for Platinum.minor and Steel. See our web page at
http://www.zk3.dec.com/decc/ for the latest kit, when this fix is available.

Another workaround is to use "cc -oldc" to compile the module that causes the
crash with the "ACC" compiler.

You should be able to compile and debug the program below with ACC and with the
future (fixed) DEC C. 

-Jeff


#include <stdio.h>

main () {

struct 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
{
  int a;
  int b;
}
longname;

  longname.a = 99;
  longname.b = 88;
  printf("longname.a=%d, longname.b=%d\n", longname.a, longname.b);

}
2084.4Thanks!HPCGRP::DEGREGORYKaren 223-5801Thu Feb 06 1997 10:403
Thanks for the quick response.

Karen
2084.5DEC C V5.2-036 (and later) fixes thisDECC::SULLIVANJeff SullivanMon Feb 10 1997 12:4911
We plan to submit the fix to the V4.0 support pools. The fix will also appear in
our Platinum.minor and later DEC C compilers.

If you would like to get a copy of the support compiler, you can download it at
http://www.zk3.dec.com/decc/decc-kitinfo.html

...or note 6.last in TURRIS::DECC.

-Jeff