Waldek Hebisch a écrit:
gpc-20030830 have a memory management bug which is probably responsible for crashes reported by Adriaan van Os and Maurice Lombardi. Mainly builds with gcc-3.3.x are affected (I do not know if it is possible to trigger the bug with earlier gcc version). The patch below fixes the problem:
diff -ru gpc-20030830.orig/p/gpc.h gpc-20030830/p/gpc.h --- gpc-20030830.orig/p/gpc.h Wed Aug 13 06:30:35 2003 +++ gpc-20030830/p/gpc.h Sun Sep 7 03:28:26 2003 @@ -276,12 +276,13 @@ };
union lang_tree_node
- GTY((desc ("((TREE_CODE (&%h.generic) == IDENTIFIER_NODE) || (TREE_CODE (&%h.generic) == INTERFACE_NAME_NODE)) ? TREE_CODE (&%h.generic) : 0"),
- GTY((desc ("((TREE_CODE (&%h.generic) == IDENTIFIER_NODE) || (TREE_CODE (&%h.generic) == INTERFACE_NAME_NODE) || (TREE_CODE (&%h.generic) == IMPORT_NODE)) ? TREE_CODE (&%h.generic) : 0"), chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
{ union tree_node GTY ((tag ("0"), desc ("tree_node_structure (&%h)"))) generic; struct lang_identifier GTY ((tag ("IDENTIFIER_NODE"))) identifier; struct tree_inn GTY ((tag ("INTERFACE_NAME_NODE"))) interface;
- struct tree_import GTY ((tag ("IMPORT_NODE"))) import;
};
#define AS_LANG_IDENTIFIER_NODE(ID) ((struct lang_identifier *) IDENTIFIER_NODE_CHECK (ID)) diff -ru gpc-20030830.orig/p/p-tree.def gpc-20030830/p/p-tree.def --- gpc-20030830.orig/p/p-tree.def Fri Jun 6 00:14:08 2003 +++ gpc-20030830/p/p-tree.def Sun Sep 7 03:40:08 2003 @@ -27,14 +27,14 @@ /* The field `gpi_int checksum' might be larger than a pointer, so reserve two pointer sizes for it. */ DEFTREECODE (INTERFACE_NAME_NODE, "interface_name_node", 'x', 3) -DEFTREECODE (IMPORT_NODE, "import_node", 'x', 3) +DEFTREECODE (IMPORT_NODE, "import_node", 'x', 4) DEFTREECODE (POWER_EXPR, "power_expr", '2', 2) DEFTREECODE (POW_EXPR, "pow_expr", '2', 2) DEFTREECODE (SYMDIFF_EXPR, "symdiff_expr", '2', 2) #else DEFTREECODE (OPERATOR_DECL, "operator_decl", "d", 0) DEFTREECODE (INTERFACE_NAME_NODE, "interface_name_node", "x", 3) -DEFTREECODE (IMPORT_NODE, "import_node", "x", 3) +DEFTREECODE (IMPORT_NODE, "import_node", "x", 4) DEFTREECODE (POWER_EXPR, "power_expr", "2", 2) DEFTREECODE (POW_EXPR, "pow_expr", "2", 2) DEFTREECODE (SYMDIFF_EXPR, "symdiff_expr", "2", 2)
With this patch it compiles under DJGPP. Running the test suite results in the following test_summary
---------------------------------------------------------------------------------
TEST agettext2test.pas: c:/djgpp/lib/libintl.a(dcigettext.o)(.text+0x968): In function `__nl_find_msg': dcigettext.c:872: undefined reference to `_libiconv' c:/djgpp/lib/libintl.a(loadmsgcat.o)(.text+0x1b2): In function `__nl_init_domain_conv': loadmsgcat.c:301: undefined reference to `_libiconv_open' c:/djgpp/lib/libintl.a(loadmsgcat.o)(.text+0x1fb): In function `__nl_free_domain_conv': loadmsgcat.c:331: undefined reference to `_libiconv_close' collect2: ld returned 1 exit status failed TEST aturbo3test.pas: c:/djgpp/bin/ld.exe: cannot find -lncurses collect2: ld returned 1 exit status failed TEST crttest.pas: c:/djgpp/bin/ld.exe: cannot find -lncurses collect2: ld returned 1 exit status failed TEST dialec3.pas: c:/djgpp/bin/ld.exe: cannot find -lncurses collect2: ld returned 1 exit status failed TEST dialec5.pas: c:/djgpp/bin/ld.exe: cannot find -lncurses collect2: ld returned 1 exit status failed TEST dialec6.pas: c:/djgpp/bin/ld.exe: cannot find -lncurses collect2: ld returned 1 exit status failed TEST dialec7.pas: c:/djgpp/bin/ld.exe: cannot find -lncurses collect2: ld returned 1 exit status failed TEST dosunixtest.pas: Error in Assign #1 TEST fjf165a.pas: SKIPPED: German locale not installed TEST gettexttest.pas: c:/djgpp/lib/libintl.a(dcigettext.o)(.text+0x968): In function `__nl_find_msg': dcigettext.c:872: undefined reference to `_libiconv' c:/djgpp/lib/libintl.a(loadmsgcat.o)(.text+0x1b2): In function `__nl_init_domain_conv': loadmsgcat.c:301: undefined reference to `_libiconv_open' c:/djgpp/lib/libintl.a(loadmsgcat.o)(.text+0x1fb): In function `__nl_free_domain_conv': loadmsgcat.c:331: undefined reference to `_libiconv_close' collect2: ld returned 1 exit status failed TEST longr2.pas: SKIPPED: no LongReal math routines available TEST mir029el.pas: failed TEST pipetes2.pas: c:/djgpp/b/gnu/build.gcc/gcc/p/test/a.out: error when reading from file `f' bound to file handle #0 (Bad file descriptor (EBADF)) (error #464 at 291e) TEST pipetest.pas: qwec:/djgpp/b/gnu/build.gcc/gcc/p/test/a.out: assertion failed (error #306 at 2120)
# of GPC tests 3794 # of GPC tests passed 3780 # of GPC tests skipped 2 # of GPC tests failed 12
---------------------------------------------------------------------------------
In fact all errors but the mir029el.pas come from the compiler no more defining by default
-DMSDOS -DDJGPP=2 -DGO32 (and underscored versions)
All errors (except mir029el) disappear if I use EXTRA_TEST_PFLAGS="-gstabs -DMSDOS -DDJGPP=2 -DGO32"
When looking into the the specs files I find that in gcc-3.2.2 these where defined in the sections *cpp: (without underscore) *predefines: (with underscores)
and they have disappeared in gcc-3.3.1
I understand nothing to specs syntax but probably I have to ask on the djgpp list the reason for that. Has any other system the same problem ?
Maurice