ngs-lang / ngs

Next Generation Shell (NGS)
https://ngs-lang.org/
GNU General Public License v3.0
1.46k stars 41 forks source link

[bad error handling] x="abcdefghij"*100000; ``echo $x`` #484

Open ilyash-b opened 3 years ago

ilyash-b commented 3 years ago

Instead of nice error message printed once there is this:

Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
Assertion failed: (ngs_malloc_next_free - ngs_malloc_base + sizeof(size_t) + size < ngs_malloc_allocated), function ngs_malloc, file /Users/ilya/src/ngs/malloc.c, line 37.
[ERROR 2021-09-16 17:46:47 IDT] +------------------------------------------+
[ERROR 2021-09-16 17:46:47 IDT] | Executing external process 'echo' failed |
[ERROR 2021-09-16 17:46:47 IDT] | Executable was found at /bin/echo        |
[ERROR 2021-09-16 17:46:47 IDT] | Command: (unavailable)                   |
[ERROR 2021-09-16 17:46:47 IDT] | Command exited with signal: 6            |
[ERROR 2021-09-16 17:46:47 IDT] +------------------------------------------+
[ERROR 2021-09-16 17:46:47 IDT] Exception of type ProcessFail occurred
[ERROR 2021-09-16 17:46:47 IDT] +------------------------------------------+
[ERROR 2021-09-16 17:46:47 IDT] | Executing external process 'echo' failed |
[ERROR 2021-09-16 17:46:47 IDT] | Executable was found at /bin/echo        |
[ERROR 2021-09-16 17:46:47 IDT] | Command: (unavailable)                   |
[ERROR 2021-09-16 17:46:47 IDT] | Command exited with signal: 6            |
[ERROR 2021-09-16 17:46:47 IDT] +------------------------------------------+
[ERROR 2021-09-16 17:46:47 IDT] Exception of type ProcessFail occurred
[ERROR 2021-09-16 17:46:47 IDT] Info: process:
[ERROR 2021-09-16 17:46:47 IDT]   Process
[ERROR 2021-09-16 17:46:47 IDT]     command = <Command options={} redirects=[] argv=[echo,abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghi...
[ERROR 2021-09-16 17:46:47 IDT]     executable = <Path path=/bin/echo>
[ERROR 2021-09-16 17:46:47 IDT]     pid = 64846
[ERROR 2021-09-16 17:46:47 IDT]     exit_code = null
[ERROR 2021-09-16 17:46:47 IDT]     exit_signal = 6
[ERROR 2021-09-16 17:46:47 IDT]     redirects[0]: <ProcessRedir fd=1 marker=null datum=<CollectingPipeFromChildToParentProcess read_fd=3 write_fd=4>>
[ERROR 2021-09-16 17:46:47 IDT]     output on fd 1, stdout (0 lines):
[ERROR 2021-09-16 17:46:47 IDT]     output on fd 2, stderr (0 lines):
[ERROR 2021-09-16 17:46:47 IDT] Frame 0: <builtin-stdlib>:7917:2 - 7917:35
[ERROR 2021-09-16 17:46:47 IDT] Frame 1: <builtin-stdlib>:7891:21 - 7891:30 [in bootstrap_exception_catch_wrapper]
[ERROR 2021-09-16 17:46:47 IDT] Frame 2: <builtin-stdlib>:7823:12 - 7823:24 [in bootstrap]
[ERROR 2021-09-16 17:46:47 IDT] Frame 3: <command line -pi switch>:2:26 - 2:26
[ERROR 2021-09-16 17:46:47 IDT] Frame 4: <builtin-stdlib>:6165:14 - 6165:21 [in ````]
[ERROR 2021-09-16 17:46:47 IDT] Frame 5: <builtin-stdlib>:6096:6 - 6096:10 [in $()]
[ERROR 2021-09-16 17:46:47 IDT] Frame 6: <builtin-stdlib>:5708:15 - 5708:19 [in wait]
[ERROR 2021-09-16 17:46:47 IDT] Frame 7: <builtin-stdlib>:2350:11 - 2350:13 [in each]
[ERROR 2021-09-16 17:46:47 IDT] Frame 8: <builtin-stdlib>:5702:28 - 5702:35 [in wait]
+------------------------------------------+
| Executing external process 'echo' failed |
| Executable was found at /bin/echo        |
| Command: (unavailable)                   |
| Command exited with signal: 6            |
+------------------------------------------+
[ERROR 2021-09-16 17:46:47 IDT] Info: process:
[ERROR 2021-09-16 17:46:47 IDT]   Process
[ERROR 2021-09-16 17:46:47 IDT]     command = <Command options={} redirects=[] argv=[echo,abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghi...
[ERROR 2021-09-16 17:46:47 IDT]     executable = <Path path=/bin/echo>
[ERROR 2021-09-16 17:46:47 IDT]     pid = 64846
[ERROR 2021-09-16 17:46:47 IDT]     exit_code = null
[ERROR 2021-09-16 17:46:47 IDT]     exit_signal = 6
[ERROR 2021-09-16 17:46:47 IDT]     redirects[0]: <ProcessRedir fd=1 marker=null datum=<CollectingPipeFromChildToParentProcess read_fd=3 write_fd=4>>
[ERROR 2021-09-16 17:46:47 IDT]     output on fd 1, stdout (0 lines):
[ERROR 2021-09-16 17:46:47 IDT]     output on fd 2, stderr (0 lines):
[ERROR 2021-09-16 17:46:47 IDT] Frame 0: <builtin-stdlib>:7917:2 - 7917:35
[ERROR 2021-09-16 17:46:47 IDT] Frame 1: <builtin-stdlib>:7891:21 - 7891:30 [in bootstrap_exception_catch_wrapper]
[ERROR 2021-09-16 17:46:47 IDT] Frame 2: <builtin-stdlib>:7823:12 - 7823:24 [in bootstrap]
[ERROR 2021-09-16 17:46:47 IDT] Frame 3: <command line -pi switch>:2:26 - 2:26
[ERROR 2021-09-16 17:46:47 IDT] Frame 4: <builtin-stdlib>:6165:14 - 6165:21 [in ````]
[ERROR 2021-09-16 17:46:47 IDT] Frame 5: <builtin-stdlib>:6096:6 - 6096:10 [in $()]
[ERROR 2021-09-16 17:46:47 IDT] Frame 6: <builtin-stdlib>:5708:15 - 5708:19 [in wait]
[ERROR 2021-09-16 17:46:47 IDT] Frame 7: <builtin-stdlib>:2350:11 - 2350:13 [in each]
[ERROR 2021-09-16 17:46:47 IDT] Frame 8: <builtin-stdlib>:5702:28 - 5702:35 [in wait]
+------------------------------------------+
| Executing external process 'echo' failed |
| Executable was found at /bin/echo        |
| Command: (unavailable)                   |
| Command exited with signal: 6            |
+------------------------------------------+