Bug 26162 - crash while running pretty-printer
Summary: crash while running pretty-printer
Status: RESOLVED FIXED
Alias: None
Product: poke
Classification: Unclassified
Component: default (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-23 19:56 UTC by Jose E. Marchesi
Modified: 2022-07-11 18:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
gmo.pk (1.66 KB, application/x-tex-pk)
2020-06-23 19:56 UTC, Jose E. Marchesi
Details
file to poke (481 bytes, application/x-gettext-translation)
2020-06-23 19:56 UTC, Jose E. Marchesi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jose E. Marchesi 2020-06-23 19:56:16 UTC
Created attachment 12654 [details]
gmo.pk

Report from Bruno Haible:

Hi,

poke crashes after executing a pretty-printing method that I defined.

Test case is attached.

How to reproduce:
* Either configure normally, and run
  ./libtool --mode=execute ./run gdb poke/poke
* Or configure with   CFLAGS="-O0 -ggdb" CXXFLAGS="-O0 -ggdb" --disable-shared
  and run
  gdb poke/poke
Then
  (gdb) run
...
Type ".exit" to leave the program.
(poke) .load gmo.pk
(poke) .file de.mo
(poke) the_gmo
gmo {magic=0x950412deU,le_variant=gmo_le_body {header=gmo_le_header
{revision=0x0U,nstrings=0x3U,orig_tab_offset=0x1cU,trans_tab_offset=0x34U,hash_tab_size=0x5U,hash_tab_offset=0x4cU},orig_tab=[gmo_le_string
{length=0x0U,offset=0x60U},gmo_le_string
{length=0xdU,offset=0x61U},gmo_le_string
{length=0x2dU,offset=0x6fU}],trans_tab=[gmo_le_string
{length=0x1d4U,offset=0x9dU},gmo_le_string
{length=0xbU,offset=0x272U},gmo_le_string
{length=0x31U,offset=0x27eU}],hash_tab=[gmo_le_uint32
{0x1U},gmo_le_uint32 {0x0U},gmo_le_uint32 {0x3U},gmo_le_uint32
{0x0U},gmo_le_uint32 {0x2U}]}}
(poke) .set pretty-print yes
(poke) the_gmo
{
  "" -> "Project-Id-Version: hello-c 0.19.4.73\nReport-Msgid-Bugs-To:
bug-gettext@gnu.org\nPO-Revision-Date: 2015-06-26
13:05+0200\nLast-Translator: Philipp Thomas
<pth@suse.de>\nLanguage-Team: German
<translation-team-de@lists.sourceforge.net>\nLanguage:
de\nMIME-Version: 1.0\nContent-Type: text/plain;
charset=UTF-8\nContent-Transfer-Encoding: 8bit\nX-Bugs: Report
translation errors to the Language-Team address.\nPlural-Forms:
nplurals=2; plural=(n != 1);\nX-Generator: Poedit 1.5.4\n",
  "Hello, world!" -> "Hallo Welt!",
  "This program is running as process number %d." -> "Dieses Programm
läuft mit der Prozess-Nummer %d."
}

Thread 1 "poke" received signal SIGSEGV, Segmentation fault.
0x000000f5be600000 in ?? ()
(gdb) where
#0  0x000000f5be600000 in ?? ()
#1  0x00000001f7da57e0 in ?? ()
#2  0x00000000006f9310 in ?? ()
#3  0x0000000000a30e10 in ?? ()
#4  0x0000000000000001 in ?? ()
#5  0x0000000000f55000 in ?? ()
#6  0x0000000000000004 in ?? ()
#7  0x00007f0000000100 in ?? ()
#8  0x0000000001000020 in ?? ()
#9  0x0000000000000001 in ?? ()
#10 0x00007fff00000000 in ?? ()
#11 0x00007fffffff8be0 in ?? ()
#12 0x3ce8c119a439f600 in ?? ()
#13 0x0000000000000004 in ?? ()
#14 0x00007ffff7b7f9a9 in GC_clear_stack () from /usr/lib/x86_64-linux-gnu/libgc.so.1
#15 0x00007ffff7b7c039 in GC_generic_malloc_many () from /usr/lib/x86_64-linux-gnu/libgc.so.1
#16 0x00007ffff7b845db in GC_malloc () from /usr/lib/x86_64-linux-gnu/libgc.so.1
#17 0x00000020f7b845db in ?? ()
#18 0x0000000000000006 in ?? ()
#19 0x00007fffffff8cf0 in ?? ()
#20 0x0000000000404020 in ?? ()
#21 0x00007fffffffd810 in ?? ()
#22 0x0000000000000000 in ?? ()

Can you reproduce it?
Comment 1 Jose E. Marchesi 2020-06-23 19:56:43 UTC
Created attachment 12655 [details]
file to poke
Comment 2 Jose E. Marchesi 2020-06-23 19:58:15 UTC
More info from Bruno:


gdb couldn't tell me where the program is crashing. But valgrind can.

$ valgrind --tool=memcheck --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes poke/poke 2>&1 | tee valgrindlog
...
Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B1E6: GC_promote_black_lists (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4A037: GC_try_to_collect_inner (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4AA1B: GC_collect_or_expand (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4AC41: GC_allocobj (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E5002E: GC_generic_malloc_inner (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E51297: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46EC8C: pvm_make_long_ulong (pvm-val.c:54)
   by 0x46ED0D: pvm_make_ulong (pvm-val.c:70)
   by 0x4834D4: pvm_execute_or_initialize (pvm.jitter:1680)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x4159F2: pk_print_val (libpoke.c:789)
   by 0x406C93: pk_cmd_exec (pk-cmd.c:626)
   by 0x40591C: pk_repl (pk-repl.c:339)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B20B: GC_promote_black_lists (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4A037: GC_try_to_collect_inner (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4AA1B: GC_collect_or_expand (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4AC41: GC_allocobj (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E5002E: GC_generic_malloc_inner (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E51297: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46EC8C: pvm_make_long_ulong (pvm-val.c:54)
   by 0x46ED0D: pvm_make_ulong (pvm-val.c:70)
   by 0x4834D4: pvm_execute_or_initialize (pvm.jitter:1680)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x4159F2: pk_print_val (libpoke.c:789)
   by 0x406C93: pk_cmd_exec (pk-cmd.c:626)
   by 0x40591C: pk_repl (pk-repl.c:339)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B251: GC_promote_black_lists (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4A037: GC_try_to_collect_inner (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4AA1B: GC_collect_or_expand (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4AC41: GC_allocobj (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E5002E: GC_generic_malloc_inner (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E51297: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46EC8C: pvm_make_long_ulong (pvm-val.c:54)
   by 0x46ED0D: pvm_make_ulong (pvm-val.c:70)
   by 0x4834D4: pvm_execute_or_initialize (pvm.jitter:1680)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x4159F2: pk_print_val (libpoke.c:789)
   by 0x406C93: pk_cmd_exec (pk-cmd.c:626)
   by 0x40591C: pk_repl (pk-repl.c:339)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B072: GC_is_black_listed (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48C2A: GC_allochblk_nth (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48E90: GC_allochblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E511CA: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46ED26: pvm_make_box (pvm-val.c:76)
   by 0x46F6C6: pvm_make_type (pvm-val.c:243)
   by 0x46F727: pvm_make_integral_type (pvm-val.c:256)
   by 0x48E29D: pvm_execute_or_initialize (pvm.jitter:4203)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x4159F2: pk_print_val (libpoke.c:789)
   by 0x406C93: pk_cmd_exec (pk-cmd.c:626)
   by 0x40591C: pk_repl (pk-repl.c:339)
   by 0x404D06: main (poke.c:681)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B07B: GC_is_black_listed (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48C2A: GC_allochblk_nth (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48E90: GC_allochblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E511CA: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46ED26: pvm_make_box (pvm-val.c:76)
   by 0x46F6C6: pvm_make_type (pvm-val.c:243)
   by 0x46F727: pvm_make_integral_type (pvm-val.c:256)
   by 0x48E29D: pvm_execute_or_initialize (pvm.jitter:4203)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x4159F2: pk_print_val (libpoke.c:789)
   by 0x406C93: pk_cmd_exec (pk-cmd.c:626)
   by 0x40591C: pk_repl (pk-repl.c:339)
   by 0x404D06: main (poke.c:681)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B03F: GC_is_black_listed (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48C2A: GC_allochblk_nth (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48F75: GC_allochblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E56B77: GC_new_hblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4AC01: GC_allocobj (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E5002E: GC_generic_malloc_inner (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E51297: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46ED26: pvm_make_box (pvm-val.c:76)
   by 0x46ED50: pvm_make_string (pvm-val.c:85)
   by 0x472716: pvm_make_exception (pvm-val.c:1206)
   by 0x46B7B5: pkl_asm_new (pkl-asm.c:1115)
   by 0x47262A: pvm_call_pretty_printer (pvm-val.c:1179)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x49C59E: pvm_execute_or_initialize (pvm.jitter:1216)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B09F: GC_is_black_listed (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48C2A: GC_allochblk_nth (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48F75: GC_allochblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E56B77: GC_new_hblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E4AC01: GC_allocobj (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E5002E: GC_generic_malloc_inner (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E51297: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46ED26: pvm_make_box (pvm-val.c:76)
   by 0x46ED50: pvm_make_string (pvm-val.c:85)
   by 0x472716: pvm_make_exception (pvm-val.c:1206)
   by 0x46B7B5: pkl_asm_new (pkl-asm.c:1115)
   by 0x47262A: pvm_call_pretty_printer (pvm-val.c:1179)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x49C59E: pvm_execute_or_initialize (pvm.jitter:1216)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B03F: GC_is_black_listed (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48C2A: GC_allochblk_nth (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48E90: GC_allochblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E511CA: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46ED26: pvm_make_box (pvm-val.c:76)
   by 0x46ED50: pvm_make_string (pvm-val.c:85)
   by 0x472724: pvm_make_exception (pvm-val.c:1207)
   by 0x46B7B5: pkl_asm_new (pkl-asm.c:1115)
   by 0x47262A: pvm_call_pretty_printer (pvm-val.c:1179)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x49C59E: pvm_execute_or_initialize (pvm.jitter:1216)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E48CBB: GC_allochblk_nth (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48E90: GC_allochblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E511CA: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46ED26: pvm_make_box (pvm-val.c:76)
   by 0x46ED50: pvm_make_string (pvm-val.c:85)
   by 0x472724: pvm_make_exception (pvm-val.c:1207)
   by 0x46B7B5: pkl_asm_new (pkl-asm.c:1115)
   by 0x47262A: pvm_call_pretty_printer (pvm-val.c:1179)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x49C59E: pvm_execute_or_initialize (pvm.jitter:1216)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x4159F2: pk_print_val (libpoke.c:789)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B03F: GC_is_black_listed (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48C2A: GC_allochblk_nth (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48F75: GC_allochblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E511CA: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46ED26: pvm_make_box (pvm-val.c:76)
   by 0x46ED50: pvm_make_string (pvm-val.c:85)
   by 0x472724: pvm_make_exception (pvm-val.c:1207)
   by 0x46B7B5: pkl_asm_new (pkl-asm.c:1115)
   by 0x47262A: pvm_call_pretty_printer (pvm-val.c:1179)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x49C59E: pvm_execute_or_initialize (pvm.jitter:1216)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)

Conditional jump or move depends on uninitialised value(s)
   at 0x4E4B09F: GC_is_black_listed (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48C2A: GC_allochblk_nth (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E48F75: GC_allochblk (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E511CA: GC_generic_malloc_many (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x4E59654: GC_malloc (in /usr/lib/x86_64-linux-gnu/libgc.so.1.0.3)
   by 0x472B40: pvm_alloc (pvm-alloc.c:28)
   by 0x46ED26: pvm_make_box (pvm-val.c:76)
   by 0x46ED50: pvm_make_string (pvm-val.c:85)
   by 0x472724: pvm_make_exception (pvm-val.c:1207)
   by 0x46B7B5: pkl_asm_new (pkl-asm.c:1115)
   by 0x47262A: pvm_call_pretty_printer (pvm-val.c:1179)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x49C59E: pvm_execute_or_initialize (pvm.jitter:1216)
   by 0x482E08: pvm_execute_executable_routine (pvm.jitter:527)
   by 0x47C155: pvm_execute_routine (pvm.jitter:711)
   by 0x46E946: pvm_run (pvm.c:125)
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)

Jump to the invalid address stated on the next line
   at 0x434BD200000: ???
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x4159F2: pk_print_val (libpoke.c:789)
   by 0x406C93: pk_cmd_exec (pk-cmd.c:626)
   by 0x40591C: pk_repl (pk-repl.c:339)
   by 0x404D06: main (poke.c:681)
 Address 0x434bd200000 is not stack'd, malloc'd or (recently) free'd


Process terminating with default action of signal 11 (SIGSEGV)
 Bad permissions for mapped region at address 0x434BD200000
   at 0x434BD200000: ???
   by 0x4726B1: pvm_call_pretty_printer (pvm-val.c:1192)
   by 0x471244: pvm_print_val_1 (pvm-val.c:856)
   by 0x471E25: pvm_print_val (pvm-val.c:1038)
   by 0x4159F2: pk_print_val (libpoke.c:789)
   by 0x406C93: pk_cmd_exec (pk-cmd.c:626)
   by 0x40591C: pk_repl (pk-repl.c:339)
   by 0x404D06: main (poke.c:681)
Comment 3 Jose E. Marchesi 2020-06-25 13:43:59 UTC
I would actually change the function names a bit.   Currently we have:

While statements:

pkl_asm_while ()
...
pkl_asm_loop ()
...
pkl_asm_endloop ()

For statements:

pkl_asm_for ()
...
pkl_asm_for_where ()
...
pkl_asm_for_loop ()
...
pkl_asm_for_endloop ()


So my suggestion is:

- To rename the current pkl_asm_loop/pkl_asm_endloop to pkl_asm_while_loop/pkl_asm_while_endloop.

- To introduce new pkl_asm_loop/pkl_asm_endloop to implement the simple "loop always" case.
Comment 4 Jose E. Marchesi 2020-11-29 17:26:55 UTC
This is now fixed in master.
Salud!