Hello,

I’m seeking assistance with a challenging issue involving an
executable on an ARM64 Ubuntu system. Here’s the problem and what I’ve
done to investigate it so far:

Problem Summary: I have an ARM64 executable that crashes with a
segmentation fault(early to main function, looks like when loading .so
libraries) when run independently. However, when running it with
Valgrind, the program completes its execution, although Valgrind does
report an Invalid free error.

Technical Details:
================
System: Ubuntu ARM64( Jammy)
Executable behavior:

Runs with Valgrind but reports an Invalid free error.
Segmentation fault when running directly, before the main function
starts executing.

Valgrind Output (partial):
===================
plaintext
Copy code
==2644== Invalid free() / delete / delete[] / realloc()
==2644==    at 0x7127AD0: free (in
/usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==2644==    by 0x838C0CB: BN_clear_free (in
/usr/lib/aarch64-linux-gnu/libcrypto.so.3)
==2644==    by 0x7B8CEAB: ??? (in /usr/lib/aarch64-linux-gnu/libssh.so.4.8.7)
==2644==    by 0x7B9121F: ??? (in /usr/lib/aarch64-linux-gnu/libssh.so.4.8.7)
==2644==    by 0x7B7DF3F: ??? (in /usr/lib/aarch64-linux-gnu/libssh.so.4.8.7)
==2644==    by 0x68C5623: call_init (dl-init.c:70)
==2644==    by 0x68C5623: call_init (dl-init.c:26)
==2644==    by 0x68C572B: _dl_init (dl-init.c:117)
==2644==    by 0x68D7CC7: ??? (in
/usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1)
==2644==  Address 0x1 is not stack'd, malloc'd or (recently) free'd

GDB Investigation:
==============
Using gdb on the executable confirms that the crash happens before
reaching main(). Here’s a backtrace from GDB:

(gdb) bt
#0  0x0000000007127ad0 in _vgr10050ZU_VgSoSynsomalloc_free () from
/usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so
#1  0x000000000838c0cc in BN_clear_free () from
/lib/aarch64-linux-gnu/libcrypto.so.3
#2  0x0000000007b8ceac in ?? () from /lib/aarch64-linux-gnu/libssh.so.4
#3  0x0000000007b91220 in ?? () from /lib/aarch64-linux-gnu/libssh.so.4

Additional Information:
====================
The crash appears to be related to libcrypto and libssh libraries.
libssh.so.4 and libcrypto.so.3 versions on the system match the
versions the executable was compiled against.
I have attempted to gather debug symbols for these libraries to
analyze further, but only limited information is available from the
system-provided packages.

Questions:
=========
1. Could the difference in behavior (running under Valgrind vs.
standalone) indicate a specific type of issue, such as a memory
alignment problem?
2. Are there recommended methods or tools, other than Valgrind and
GDB, that might help debug memory management issues specifically on
ARM64?
3. Has anyone encountered similar issues when libcrypto or libssh
functions are involved?

Thank you for any guidance or suggestions you can offer.

Regards,
Matthew


_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to