I'm trying to write and run some file IO code for ARM, but I encounter a
fatal error when trying to run this simple C program:

test.c:
```c
#include <stdio.h>

int main(int argc, char **argv)
{
    FILE *input = fopen(argv[1], "rb");
    if (input == NULL)
    {
        printf("Error reading file: %s\n", argv[1]);
        return 1;
    }
    fseek(input, 0L, SEEK_END);
    long int size = ftell(input);
    fseek(input, 0L, SEEK_SET);
    return 0;
}
```

Binary (test.arm) compiled using command: arm-linux-gnueabihf-gcc -static
-o test.arm -std=gnu99 test.c

Run output:
```
$ build/ARM/gem5.opt configs/example/se.py -c test.arm -o
hashmark/500.txtbuild/ARM/base/statistics.hh:277: warn: One of the stats is
a legacy stat. Legacy stat is a stat that does not belong to any
statistics::Group. Legacy stat is deprecated.
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 version 21.1.0.0
gem5 compiled Aug 11 2021 16:16:59
gem5 started Aug 15 2021 18:33:07
gem5 executing on Shiva, pid 6082
command line: build/ARM/gem5.opt configs/example/se.py -c test.arm -o
hashmark/500.txt

warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
Global frequency set at 1000000000000 ticks per second
warn: No dot file generated. Please install pydot to generate the dot file
and pdf.
build/ARM/mem/mem_interface.cc:791: warn: DRAM device capacity (8192
Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****
build/ARM/sim/simulate.cc:107: info: Entering event queue @ 0.  Starting
simulation...
build/ARM/sim/mem_state.cc:443: info: Increasing stack size by one page.
build/ARM/sim/syscall_emul.cc:73: warn: ignoring syscall mprotect(...)
build/ARM/mem/port_proxy.hh:195: fatal: writeBlob(0x1cde, ...) failed
Memory Usage: 650296 KBytes
```

I can confirm that the `fopen()` call completes successfully. The `fseek`
and `ftell` functions incur the fatal failed writeBlob error.

A backtrace of the error is here:
https://gist.github.com/Icohedron/8fb339fccf323c9813d79dd466ae4f66

Operating System: Debian 11
gcc-arm-linux-gnueabihf version: 4:10.2.1-1
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to