1
votes

When I run the file (my-file) command, I get

my-file: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=d0fa19146049b8f8b97701a7fc91284f157403ef, not stripped

When I try and run ./my-file: * Error in `./lano-campipe': realloc(): invalid pointer: 0x0000000000406dc8 * Aborted (core dumped)

1

1 Answers

0
votes

There is an aarch64 port of valgrind. If you run your program under that, it will likely tell you precisely what is wrong and where the bug happens.

My guess, based on the address, is that you are passing an addresss (of an array or string?) to realloc that is allocated in the .data (or .rodata) section, and not in the heap. If you run the program under GDB and enter this command

info symbol 0x0000000000406dc8

it will likely print symbol information for the address. It is probably necessary to call malloc and copy the data to the heap to fix this bug.