T.R | Title | User | Personal Name | Date | Lines |
---|
2084.1 | Still a problem... | DECC::SULLIVAN | Jeff Sullivan | Wed Feb 05 1997 10:00 | 9 |
| 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.2 | The problem is the length of the struct name | DECC::SULLIVAN | Jeff Sullivan | Wed Feb 05 1997 10:42 | 59 |
| 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) x##x##x##x##x##x##x##x##x##x##x##x##x##x##x##x
main () {
#ifdef CRASH1
struct a(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX);
#elif CRASH2
struct
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;
#elif NOCRASH
int
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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.3 | Reported as cxxc_bugs 4115. Another workaround... | DECC::SULLIVAN | Jeff Sullivan | Wed Feb 05 1997 14:27 | 36 |
| 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.4 | Thanks! | HPCGRP::DEGREGORY | Karen 223-5801 | Thu Feb 06 1997 10:40 | 3 |
| Thanks for the quick response.
Karen
|
2084.5 | DEC C V5.2-036 (and later) fixes this | DECC::SULLIVAN | Jeff Sullivan | Mon Feb 10 1997 12:49 | 11 |
| 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
|