gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4906-gae0de313


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4906-gae0de313
Date: Fri, 16 Sep 2022 05:26:13 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-5.2-stable has been updated
       via  ae0de313fc51ab3862811a8152a92f68ece3bfb0 (commit)
      from  2848045aed5ccfd7b582808288f7fcc18d319952 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ae0de313fc51ab3862811a8152a92f68ece3bfb0

commit ae0de313fc51ab3862811a8152a92f68ece3bfb0
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Sep 16 12:25:52 2022 +0300

    Fix a bug with eval in the debugger.

diff --git a/ChangeLog b/ChangeLog
index 5c27caff..35941d0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-16         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * debug.c (do_eval): If a fatal error occurs, don't attempt to
+       recover, just restart. Thanks to Pascal Maugis
+       <pascal.maugis@lsce.ipsl.fr> for the report.
+
 2022-09-14         Arnold D. Robbins     <arnold@skeeve.com>
 
        * interpret.h (r_interpret): For the `push' opcodes, don't upref
diff --git a/debug.c b/debug.c
index efc5a9a1..b85939f3 100644
--- a/debug.c
+++ b/debug.c
@@ -5582,8 +5582,22 @@ execute_code(volatile INSTRUCTION *code)
        if (setjmp(fatal_tag) == 0) {
                (void) interpret((INSTRUCTION *) code);
                r = POP_SCALAR();
-       } else  /* fatal error */
-               (void) unwind_stack(save_stack_size);
+       } else {        /* fatal error */
+               /*
+                * 9/2022:
+                * Initially, the code did this:
+                *
+                * (void) unwind_stack(save_stack_size);
+                *
+                * to attempt to recover and keep going. But a fatal error
+                * can corrupt memory. Instead of trying to recover, just
+                * start over.
+                */
+               // Let the user know, but DON'T use the fatal() function!
+               fprintf(stderr, _("fatal error during eval, need to 
restart.\n"));
+               // Go back to debugger
+               restart(false);         // does not return
+       }
 
        POP_BINDING(fatal_tag_stack, fatal_tag, fatal_tag_valid);
        do_flags = save_flags;
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 67ee4d2d..863102fe 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2022-09-16         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.tst: Regenerated.
+
 2022-09-14         Arnold D. Robbins     <arnold@skeeve.com>
 
        * Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 9e40cd2a..8992ae1b 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -189,7 +189,8 @@ GAWK_EXT_TESTS = \
        arraysort2 arraytype asortbool backw badargs beginfile1 beginfile2 \
        binmode1 charasbytes clos1way clos1way2 clos1way3 clos1way4 \
        clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
-       dbugeval3 dbugtypedre1 dbugtypedre2 delsub devfd devfd1 devfd2 \
+       dbugeval3 dbugeval4 dbugtypedre1 dbugtypedre2 delsub \
+       devfd devfd1 devfd2 \
        dfacheck1 dumpvars elemnew1 elemnew2 elemnew3 \
        errno exit fieldwdth forcenum fpat1 fpat2 \
        fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
@@ -244,7 +245,7 @@ SHLIB_TESTS = \
 
 
 # List of the tests which should be run with --debug option:
-NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3
+NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4
 
 # List of the tests which should be run with --lint option:
 NEED_LINT = \
@@ -2716,6 +2717,11 @@ dbugeval3:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+dbugeval4:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 dbugtypedre1:
        @echo $@
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index 434cbd9c..6ec48cfd 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-16         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.am (EXTRA_DIST): New test: dbugeval4.
+       (NEED_DEBUG): Add dbugeval4.
+       * dbugeval4.awk, dbugeval4.in, dbugeval4.ok: New files.
+
 2022-09-14         Arnold D. Robbins     <arnold@skeeve.com>
 
        * Makefile.am (EXTRA_DIST): New tests: elemnew1, elemnew2, elemnew3.
diff --git a/test/Makefile.am b/test/Makefile.am
index 8b0a24e8..e0a1a5d3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -234,6 +234,9 @@ EXTRA_DIST = \
        dbugeval3.awk \
        dbugeval3.in \
        dbugeval3.ok \
+       dbugeval4.awk \
+       dbugeval4.in \
+       dbugeval4.ok \
        dbugtypedre1.awk \
        dbugtypedre1.in \
        dbugtypedre1.ok \
@@ -1485,7 +1488,8 @@ GAWK_EXT_TESTS = \
        arraysort2 arraytype asortbool backw badargs beginfile1 beginfile2 \
        binmode1 charasbytes clos1way clos1way2 clos1way3 clos1way4 \
        clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
-       dbugeval3 dbugtypedre1 dbugtypedre2 delsub devfd devfd1 devfd2 \
+       dbugeval3 dbugeval4 dbugtypedre1 dbugtypedre2 delsub \
+       devfd devfd1 devfd2 \
        dfacheck1 dumpvars elemnew1 elemnew2 elemnew3 \
        errno exit fieldwdth forcenum fpat1 fpat2 \
        fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
@@ -1543,7 +1547,7 @@ SHLIB_TESTS = \
        testext time
 
 # List of the tests which should be run with --debug option:
-NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3
+NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4
 
 # List of the tests which should be run with --lint option:
 NEED_LINT = \
diff --git a/test/Makefile.in b/test/Makefile.in
index 9240a42e..f4e865d9 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -502,6 +502,9 @@ EXTRA_DIST = \
        dbugeval3.awk \
        dbugeval3.in \
        dbugeval3.ok \
+       dbugeval4.awk \
+       dbugeval4.in \
+       dbugeval4.ok \
        dbugtypedre1.awk \
        dbugtypedre1.in \
        dbugtypedre1.ok \
@@ -1753,7 +1756,8 @@ GAWK_EXT_TESTS = \
        arraysort2 arraytype asortbool backw badargs beginfile1 beginfile2 \
        binmode1 charasbytes clos1way clos1way2 clos1way3 clos1way4 \
        clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
-       dbugeval3 dbugtypedre1 dbugtypedre2 delsub devfd devfd1 devfd2 \
+       dbugeval3 dbugeval4 dbugtypedre1 dbugtypedre2 delsub \
+       devfd devfd1 devfd2 \
        dfacheck1 dumpvars elemnew1 elemnew2 elemnew3 \
        errno exit fieldwdth forcenum fpat1 fpat2 \
        fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
@@ -1808,7 +1812,7 @@ SHLIB_TESTS = \
 
 
 # List of the tests which should be run with --debug option:
-NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3
+NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4
 
 # List of the tests which should be run with --lint option:
 NEED_LINT = \
@@ -4463,6 +4467,11 @@ dbugeval3:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+dbugeval4:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 dbugtypedre1:
        @echo $@
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index f7e749c0..d30c468e 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1412,6 +1412,11 @@ dbugeval3:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+dbugeval4:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 dbugtypedre1:
        @echo $@
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/dbugeval4.awk b/test/dbugeval4.awk
new file mode 100644
index 00000000..e69de29b
diff --git a/test/dbugeval4.in b/test/dbugeval4.in
new file mode 100644
index 00000000..cf7b513f
--- /dev/null
+++ b/test/dbugeval4.in
@@ -0,0 +1,2 @@
+eval "a()"
+eval "print 1"
diff --git a/test/dbugeval4.ok b/test/dbugeval4.ok
new file mode 100644
index 00000000..a40d0891
--- /dev/null
+++ b/test/dbugeval4.ok
@@ -0,0 +1,5 @@
+gawk: cmd. line:1: fatal: function `a' not defined
+fatal error during eval, need to restart.
+Restarting ...
+1
+EXIT CODE: 2

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                            |  6 ++++++
 debug.c                              | 18 ++++++++++++++++--
 pc/ChangeLog                         |  4 ++++
 pc/Makefile.tst                      | 10 ++++++++--
 test/ChangeLog                       |  6 ++++++
 test/Makefile.am                     |  8 ++++++--
 test/Makefile.in                     | 13 +++++++++++--
 test/Maketests                       |  5 +++++
 test/{arrayprm2.ok => dbugeval4.awk} |  0
 test/dbugeval4.in                    |  2 ++
 test/dbugeval4.ok                    |  5 +++++
 11 files changed, 69 insertions(+), 8 deletions(-)
 copy test/{arrayprm2.ok => dbugeval4.awk} (100%)
 create mode 100644 test/dbugeval4.in
 create mode 100644 test/dbugeval4.ok


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]