Thanks Deric, I wonder if it is linked to this problem:
https://gem5.atlassian.net/jira/software/c/projects/GEM5/issues/GEM5-1074 What happens if you cross-compile for aarch64? Kind Regards Giacomo > -----Original Message----- > From: Deric Cheung via gem5-users <gem5-users@gem5.org> > Sent: 16 August 2021 15:25 > To: gem5 users mailing list <gem5-users@gem5.org> > Cc: Deric Cheung <dache...@ualberta.ca> > Subject: [gem5-users] Re: SE ARM C stdio fseek() function invokes a failed > writeBlob in port_proxy.hh > > Using --debug-flag=Exec I have also produced an execution trace of the > binary: > https://gist.github.com/Icohedron/1920d7b0130d8348d509038a10122c23 > > On Sun, Aug 15, 2021 at 6:46 PM Deric Cheung <dache...@ualberta.ca > <mailto:dache...@ualberta.ca> > wrote: > > > 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 > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________ 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