[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
crash when invoking a method on a struct returned from a function
From: |
Bruno Haible |
Subject: |
crash when invoking a method on a struct returned from a function |
Date: |
Mon, 08 Jun 2020 01:16:36 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; ) |
Hi,
With the attached gmo.pk, I can run
(poke) (gmo @ 0#B).get_translation_slow("foo")
"foo"
To make things more handy, I defined a function
defun the_gmo = gmo :
{
return gmo @ 0#B;
}
and expected the above expression to be equivalent to
the_gmo.get_translation_slow("foo")
But this does not work. How to reproduce:
$ poke
.load gmo.pk
.file de.mo
(gmo @ 0#B).get_translation_slow("foo")
the_gmo.get_translation_slow("foo")
The latter evalution crashes. Here's the stack trace:
#0 0x00007ffff6ecb428 in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007ffff6ecd02a in __GI_abort () at abort.c:89
#2 0x00007ffff6ec3bd7 in __assert_fail_base (fmt=<optimized out>,
assertion=assertion@entry=0x4c4bf0 "PVM_IS_SCT (sct) && PVM_IS_STR (name)",
file=file@entry=0x4c4be0 "pvm-val.c",
line=line@entry=169, function=function@entry=0x4c4f20
<__PRETTY_FUNCTION__.7355> "pvm_ref_struct") at assert.c:92
#3 0x00007ffff6ec3c82 in __GI___assert_fail (assertion=0x4c4bf0 "PVM_IS_SCT
(sct) && PVM_IS_STR (name)", file=0x4c4be0 "pvm-val.c",
line=169, function=0x4c4f20 <__PRETTY_FUNCTION__.7355> "pvm_ref_struct") at
assert.c:101
#4 0x000000000046f218 in pvm_ref_struct (sct=16531366, name=13372006) at
pvm-val.c:169
#5 0x000000000049e946 in pvm_execute_or_initialize (jitter_initialize=false,
jitter_initial_program_point=0xa39700,
jitter_original_state=0x6f9310) at ./pvm.jitter:3739
#6 0x0000000000482e09 in pvm_execute_executable_routine (er=0xa22d40,
s=0x6f9310) at ./pvm.jitter:527
#7 0x000000000047c156 in pvm_execute_routine (r=0xa465e0, s=0x6f9310) at
./pvm.jitter:711
#8 0x000000000046e947 in pvm_run (apvm=0x6f9310, program=0xfc1e10,
res=0x7fffffffd5a0) at pvm.c:125
#9 0x0000000000416b03 in pkl_execute_statement (compiler=0x701110,
buffer=0xadd490 "the_gmo.get_translation_slow(\"foo\");",
end=0x7fffffffd5e0, val=0x7fffffffd5a0) at pkl.c:363
#10 0x00000000004147b9 in pk_compile_statement (pkc=0x6fcdc0, buffer=0xadd490
"the_gmo.get_translation_slow(\"foo\");",
end=0x7fffffffd5e0, valp=0x7fffffffd5e8) at libpoke.c:102
#11 0x0000000000406c67 in pk_cmd_exec (str=0xa22d80
"the_gmo.get_translation_slow(\"foo\")") at pk-cmd.c:618
#12 0x000000000040591d in pk_repl () at pk-repl.c:339
#13 0x0000000000404d07 in main (argc=1, argv=0x7fffffffd7f8) at poke.c:681
gmo.pk
Description: application/tex-pk
de.mo
Description: application/gettext-translation
- crash when invoking a method on a struct returned from a function,
Bruno Haible <=