gem5-users@gem5.org

The gem5 Users mailing list

View all threads

ARM Page table fault

NS
Nazmus Sakib
Tue, Sep 2, 2025 8:07 PM

I am running with ARM, SE mode.
The  executable to test is compiled using gcc arm cross compiler (aarch64-linux-gnu-gcc-13).

Everything  works fine until my test code tries to read from a text file (.txt).

src/sim/faults.cc:102: panic: panic condition !handled && !tc->getSystemPtr()->trapToGdb(GDBSignal::SEGV, tc->contextId()) occurred: Page table fault when accessing virtual address 0xc0

The path to the text file is correct. The size of the file is large, around 87 MB.
I tried to increase my --mem-size from 8 GB to 100 GB, no effect.
I am using FILE *,  fopen(), fclose() and fscanf() from stdio.h to read from the file.
Note: I am using 2 separate memory ranges in my simulation, system.mem_ranges[0] and system.mem_ranges[1]. But they are carefully chosen to avoid overlapping (later starts where former ends). They worked fine for different cases, until I attempted to read from file.

Any suggestion or solution would be appreciated.
Thank you.

I am running with ARM, SE mode. The executable to test is compiled using gcc arm cross compiler (aarch64-linux-gnu-gcc-13). Everything works fine until my test code tries to read from a text file (.txt). src/sim/faults.cc:102: panic: panic condition !handled && !tc->getSystemPtr()->trapToGdb(GDBSignal::SEGV, tc->contextId()) occurred: Page table fault when accessing virtual address 0xc0 The path to the text file is correct. The size of the file is large, around 87 MB. I tried to increase my --mem-size from 8 GB to 100 GB, no effect. I am using FILE *, fopen(), fclose() and fscanf() from stdio.h to read from the file. Note: I am using 2 separate memory ranges in my simulation, system.mem_ranges[0] and system.mem_ranges[1]. But they are carefully chosen to avoid overlapping (later starts where former ends). They worked fine for different cases, until I attempted to read from file. Any suggestion or solution would be appreciated. Thank you.
NS
Nazmus Sakib
Wed, Sep 3, 2025 2:45 AM

Issue is resolved.
Truns out, although the .txt file is in the same directory and in my C code I am doing "./abc.txt", gem5 was trying to search the absolute path (/home/path to text file). I tried some debug flag, and --debug-flag=SyscallVerbose helped me to identify the issue.


From: Nazmus Sakib via gem5-users gem5-users@gem5.org
Sent: 02 September 2025 14:07
To: Harshil Patel via gem5-users gem5-users@gem5.org
Cc: Jason Lowe-Power jlowepower@ucdavis.edu; Nazmus Sakib nsakib6@nmsu.edu
Subject: [gem5-users] ARM Page table fault

WARNING This email originated external to the NMSU email system. Do not click on links or open attachments unless you are sure the content is safe.
I am running with ARM, SE mode.
The  executable to test is compiled using gcc arm cross compiler (aarch64-linux-gnu-gcc-13).

Everything  works fine until my test code tries to read from a text file (.txt).

src/sim/faults.cc:102: panic: panic condition !handled && !tc->getSystemPtr()->trapToGdb(GDBSignal::SEGV, tc->contextId()) occurred: Page table fault when accessing virtual address 0xc0

The path to the text file is correct. The size of the file is large, around 87 MB.
I tried to increase my --mem-size from 8 GB to 100 GB, no effect.
I am using FILE *,  fopen(), fclose() and fscanf() from stdio.h to read from the file.
Note: I am using 2 separate memory ranges in my simulation, system.mem_ranges[0] and system.mem_ranges[1]. But they are carefully chosen to avoid overlapping (later starts where former ends). They worked fine for different cases, until I attempted to read from file.

Any suggestion or solution would be appreciated.
Thank you.

Issue is resolved. Truns out, although the .txt file is in the same directory and in my C code I am doing "./abc.txt", gem5 was trying to search the absolute path (/home/path to text file). I tried some debug flag, and --debug-flag=SyscallVerbose helped me to identify the issue. ________________________________ From: Nazmus Sakib via gem5-users <gem5-users@gem5.org> Sent: 02 September 2025 14:07 To: Harshil Patel via gem5-users <gem5-users@gem5.org> Cc: Jason Lowe-Power <jlowepower@ucdavis.edu>; Nazmus Sakib <nsakib6@nmsu.edu> Subject: [gem5-users] ARM Page table fault WARNING This email originated external to the NMSU email system. Do not click on links or open attachments unless you are sure the content is safe. I am running with ARM, SE mode. The executable to test is compiled using gcc arm cross compiler (aarch64-linux-gnu-gcc-13). Everything works fine until my test code tries to read from a text file (.txt). src/sim/faults.cc:102: panic: panic condition !handled && !tc->getSystemPtr()->trapToGdb(GDBSignal::SEGV, tc->contextId()) occurred: Page table fault when accessing virtual address 0xc0 The path to the text file is correct. The size of the file is large, around 87 MB. I tried to increase my --mem-size from 8 GB to 100 GB, no effect. I am using FILE *, fopen(), fclose() and fscanf() from stdio.h to read from the file. Note: I am using 2 separate memory ranges in my simulation, system.mem_ranges[0] and system.mem_ranges[1]. But they are carefully chosen to avoid overlapping (later starts where former ends). They worked fine for different cases, until I attempted to read from file. Any suggestion or solution would be appreciated. Thank you.