Bug 472460 - callgrind on nvidia orin aarch64 did not get a right call graph
Summary: callgrind on nvidia orin aarch64 did not get a right call graph
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: callgrind (show other bugs)
Version: 3.21.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Josef Weidendorfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-21 08:49 UTC by haomiao.wang
Modified: 2023-07-24 06:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
result (211.40 KB, application/gzip)
2023-07-21 08:49 UTC, haomiao.wang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description haomiao.wang 2023-07-21 08:49:17 UTC
Created attachment 160419 [details]
result

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. compile the below demo program with debug (-g) using cross compiler. 
#include <stdio.h>
#include <sys/select.h>

/* According to earlier standards */
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <sys/types.h>          /* See NOTES */
#include <sys/socket.h>


void func_888()
{
    printf("hello world\n");
    return;
}

void func_666()
{
	printf("你好 世界\n");
	return;
}

int main(int argc, char *argv[])
{
    while(1)
    {
        func_888();
	printf("blabla...\n");
	func_666();
	usleep(10);
    }
    return 0;
}

2. using callgrind tool to run the demo: valgrind --tool=callgrind ./a.out
3. using kcachegrind to check the result.

OBSERVED RESULT
I did not get a right call graph, but it was right on x86_64. The wrong result named aarch64.png is attached.

EXPECTED RESULT
The right result named x86_64.png is attached.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Linux tegra-ubuntu 5.10.104-rt63-tegra #3 SMP PREEMPT RT Wed Jul 19 14:09:01 CST 2023 aarch64 aarch64 aarch64 GNU/Linux
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
The kernel version of x86_64: Linux ubuntu 5.15.0-72-generic #79~20.04.1-Ubuntu SMP Thu Apr 20 22:12:07 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Comment 1 Paul Floyd 2023-07-22 14:21:28 UTC
Strange. I suppose that the assembler for main has no surprises.
Comment 2 haomiao.wang 2023-07-24 02:06:06 UTC
(In reply to Paul Floyd from comment #1)
> Strange. I suppose that the assembler for main has no surprises.

So, How can I deal with it.
Comment 3 Paul Floyd 2023-07-24 06:16:27 UTC
Be very patient or start debugging Callgrind. I’ll see if I can reproduce the problem but won’t have time to work on it for several weeks.