[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGABRT on struct assignment
From: |
Jose E. Marchesi |
Subject: |
Re: SIGABRT on struct assignment |
Date: |
Fri, 21 May 2021 23:16:06 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi there.
> I have encountered an issue while using poke 1.2.
>
> I use the mbr.pk pickle, and I have constructed a 1KB test image using
> fdisk (which can be found attached).
>
>
>
> I then ran the following script:
>
> #!/usr/bin/poke -L
> !#
>
> if (argv'length != 1) {
> print "Usage: ./make_active.pk <image>\n";
> exit;
> }
>
> load mbr;
>
> var image_path = argv[0];
> open (image_path);
>
> var pte0_off = 0x1BE#B;
> var pte0 = MBR_PTE @ pte0_off;
>
> printf "PTE0: %v\n", pte0;
>
> print "Trying to set active bit...\n";
>
> pte0.attr.active = 1;
>
> print "Successfully set active bit on PTE0!";
> printf "PTE0: %v\n", pte0;
>
>
> Upon running, a SIGABRT happens when trying to set the `active` field of the
> anonymous `attr` struct. The error seems to happen in the PVM:
>
> poke: ../../libpoke/pvm.jitter:1567: pvm_execute_or_initialize:
> Assertion `PVM_VAL_CLS_ENV (closure) != NULL' failed.
>
> This happens in GNU poke 1.2, using Jitter 0.9.263.
>
> Thank you and let me know if I can help.
>
> Kind regards,
> dekenevs
This is a known bug. I'm working on fixing it.
In the meanwhile, you can workaround it by changing mbr.pk in order to
use a named type for the `attr' field, like in:
type MBR_PTE_Attributes =
struct byte
{
uint<1> active; /* bootable */
uint<7>;
method _print = void:
{
printf "#<active=%u1d>", active;
}
};
type MBR_PTE =
struct
{
MBR_PTE_Attributes attr;
[...];
};
Sorry for the inconvenience...