-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valgrind Massif Tool Breaks During Verify Operation of Falcon Algorithms on Raspberry Pi #1761
Comments
Hi @crt26 , Thanks for the detailed report. As far as I see, the stack trace is at the tool itself. It simply loads data from memory and performs computation with the bound is I don't know enough about Massif tool to comment. |
@cothan thanks for volunteering to take a look at this. Are you OK with my assigning the issue to you? EDIT: never mind, I missed the self-assignment... thanks again! |
Hi @crt26 , Thanks for the detail information. The Falcon ARM code was developed by me, I review my code and I don't know why it causes bugs with Command with default build instruction in README.md:
Output:
When I build with
I tried another build option, to show exact location where it's crash:
The output assembly from Rizin, where it's crashed:
As shown in the ASM output, I confirm it does not use additional memory. I honestly don't know why and don't know enough about Valgrind and Massif to make the current code works with Massif. Since Valgrind and |
I mark this issue as |
@cothan Thanks for looking into this -- I'm just not sure I understand: Are you saying this is a bug in |
Hi @baentsch , I won't dare to say the bug is in Valgrind itself, the bug is in Here is the run with pure Valgrind:
And here is the run with Valgrind and
I think the bug is definitely in the I don't know if this is worthwhile to report to maintainers of |
Well, I consider
How did you deduce this? The line
At first blush, this looks like a massive piece of ARM specific code (depending on where within this return function the error occurred), no? Thus, it could be a You're the expert on this code of course and Raspberry Pi is not a platform supported by |
Oh yeah, I didn't notice "139,470,880" bytes numbers (~140 Mb). My Falcon ARM never uses such large memory. |
Hi @cothan, apologies for the length of time getting back. I saw this issue had been moved to Liboqs planning and labelled as wont fix. If the consensus is that the fault lies with the massif tool, then I would be happy to try and report the issue to the Valgrind team like you had mentioned in your previous message and see what they suggest. Thank you for taking a look at this issue :) |
Issue Description
When using the Valgrind memory profiler (version - 3.19.0) with the Massif tool to gain information on the maxHeap and maxStack for an algorithm/operation combination, any Falcon algorithm variation with the verify operation will cause a break in Valgrind and produces the error below.
Main Error:
The functions related to the issues according to the Valgrind Outputs are:
*This comes from the example output given, in the verbose output files the functions with issues for the other Falcon variations are detailed.
This issue is persistent across Raspberry Pi 4 and 5 models and various build configurations. When using the test_sig_mem script by itself, the verification completes without issue. This is also the case when using the Valgrind profiler by itself without Massif. Furthermore, the issue is the same regardless if the ARM PMU is enabled or disabled.
Standard test_sig_mem Verify Output
Command:
Output
Valgrind Output without Massif
Command:
Output:
Valgrind with Massif Tool Error Full
Command:
Output:
Verbose Outputs
An output of the issue with the verbose flag alongside outputs for each affected Falcon variation can be found in the following text files:
Build Configurations
The error is persistent across various setups using differing build flags:
Default Setup
Build Commands:
Configuration Details:
Custom Setup
Build Commands (Contained within the script, but all paths variables have been verified):
Configuration Details:
Expected behaviour
The setup and configurations detailed in this bug report were also tested on a Debian 12 x86 machine, and the issue was not present. The environment that this setup, when executed on a Debian 12 x86 system, gives the following outputs:
Valgrind with Massif Output
Massif File after Passing to ms_print:
x86-ms_print.txt
Build details for the x86 machine are detailed below
Environment Details
The issue was tested on both Raspberry Pi 4 and 5 models with the following details:
Pi-4:
Pi-5:
Debian x86 Machine used to Verify Issue:
Debian x86 Build Commands
Additional context
I would be happy to provide any additional information or outputs for this issue and, if necessary, the current developing branch for the repository where this environment is set up and run.
The text was updated successfully, but these errors were encountered: