Dear contributor,
Our automatic CI has detected problems related to your patch(es). Please find some details below.
In aarch64 native, after: | commit glibc-2.43.9000-403-g9ed3576e61f | Author: Yury Khrustalev yury.khrustalev@arm.com | Date: Tue May 26 11:19:53 2026 +0100 | | malloc: aarch64: Add ifuncs for malloc functions | | Introduce ifuncs and resolvers for functions pertinent to the | malloc interface on the AArch64 target: malloc, calloc, free, | realloc, memalign, valloc, pvalloc, posix_memalign, aligned_alloc, | ... 13 lines of the commit log omitted.
Produces 118 regressions: | | regressions.sum: | Running gdb:gdb.base/call-strs.exp ... | FAIL: gdb.base/call-strs.exp: call str_func("a","b","c","d","e","f","g") | FAIL: gdb.base/call-strs.exp: print str_func("a","b","c","d","e","f","g") | Running gdb:gdb.base/callfuncs.exp ... | FAIL: gdb.base/callfuncs.exp: noproto: p t_char_array_values("carray 1","carray 2") | ... and 125 more
Used configuration : *CI config* tcwg_gnu_native_check_gdb aarch64-linux-gnu *configure and test flags:* none, autodetected on aarch64-unknown-linux-gnu--disable-multilib --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-arch=armv8-a
We track this bug report under https://linaro.atlassian.net/browse/GNU-1934. (Require Linaro login) Please let us know if you have a fix.
If you have any questions regarding this report, please ask on linaro-toolchain@lists.linaro.org mailing list.
-----------------8<--------------------------8<--------------------------8<--------------------------
The information below contains the details of the failures, and the ways to reproduce a debug environment:
You can find the failure logs in *.log.1.xz files in * http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui... The full lists of regressions and improvements as well as configure and make commands are in * http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui... The list of [ignored] baseline and flaky failures are in * http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui...
Current build : http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui... Reference build : http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui...
Instruction to reproduce the build : https://gitlab.com/LinaroLtd/tcwg/ci/interesting-commits/-/raw/master/glibc/...
Full commit : https://sourceware.org/git/?p=glibc.git%3Ba=commitdiff%3Bh=9ed3576e61f7a87eb...
Hi, thanks for this report.
I've looked into these issues, and it seems like most of them are caused by how GDB treats malloc function for evaluating expressions that require a function call.
GDB seems to ignore that malloc has become n ifunc in Glibc and it tries to access symbol 'malloc' directly.
It seems like GDB has been having some issues with ifuncs before, e.g. [1].
Simple way to reproduce the issue: use a program with just empty main function:
int main(void) { return 0; }
In GDB (not that __libc_malloc is the implementation that is returned by the ifunc resolver):
(gdb) br main (gdb) r (gdb) disassemble __libc_malloc
Notice first 2 instructions
(gdb) call printf("%s\n", "hello")
Might result in SIGILL or SIGSEGV... but if it works, it prints format string instead of 'hello'.
(gdb) disassemble __libc_malloc
Notice first 2 instructions have now been re-written with gibberish (hence the signals).
I would appreciate if this could be looked at from the GDB point of view. Perhaps, this should be fixed in GDB?
FWIW, lldb works as expected.
Thanks, Yury
--- [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=28224
________________________________________ From: ci_notify@linaro.org ci_notify@linaro.org Sent: 19 June 2026 06:40 AM To: Yury Khrustalev Cc: linaro-toolchain@lists.linaro.org Subject: [Linaro-TCWG-CI] glibc-2.43.9000-403-g9ed3576e61f: 118 regressions on aarch64
Dear contributor,
Our automatic CI has detected problems related to your patch(es). Please find some details below.
In aarch64 native, after: | commit glibc-2.43.9000-403-g9ed3576e61f | Author: Yury Khrustalev yury.khrustalev@arm.com | Date: Tue May 26 11:19:53 2026 +0100 | | malloc: aarch64: Add ifuncs for malloc functions | | Introduce ifuncs and resolvers for functions pertinent to the | malloc interface on the AArch64 target: malloc, calloc, free, | realloc, memalign, valloc, pvalloc, posix_memalign, aligned_alloc, | ... 13 lines of the commit log omitted.
Produces 118 regressions: | | regressions.sum: | Running gdb:gdb.base/call-strs.exp ... | FAIL: gdb.base/call-strs.exp: call str_func("a","b","c","d","e","f","g") | FAIL: gdb.base/call-strs.exp: print str_func("a","b","c","d","e","f","g") | Running gdb:gdb.base/callfuncs.exp ... | FAIL: gdb.base/callfuncs.exp: noproto: p t_char_array_values("carray 1","carray 2") | ... and 125 more
Used configuration : *CI config* tcwg_gnu_native_check_gdb aarch64-linux-gnu *configure and test flags:* none, autodetected on aarch64-unknown-linux-gnu--disable-multilib --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-arch=armv8-a
We track this bug report under https://linaro.atlassian.net/browse/GNU-1934. (Require Linaro login) Please let us know if you have a fix.
If you have any questions regarding this report, please ask on linaro-toolchain@lists.linaro.org mailing list.
-----------------8<--------------------------8<--------------------------8<--------------------------
The information below contains the details of the failures, and the ways to reproduce a debug environment:
You can find the failure logs in *.log.1.xz files in * http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui... The full lists of regressions and improvements as well as configure and make commands are in * http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui... The list of [ignored] baseline and flaky failures are in * http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui...
Current build : http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui... Reference build : http://54.172.246.49:9090/jobs/tcwg_gnu_native_check_gdb--master-aarch64-bui...
Instruction to reproduce the build : https://gitlab.com/LinaroLtd/tcwg/ci/interesting-commits/-/raw/master/glibc/...
Full commit : https://sourceware.org/git/?p=glibc.git%3Ba=commitdiff%3Bh=9ed3576e61f7a87eb... IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Hello Yury,
Yury Khrustalev Yury.Khrustalev@arm.com writes:
Hi, thanks for this report.
I've looked into these issues, and it seems like most of them are caused by how GDB treats malloc function for evaluating expressions that require a function call.
GDB seems to ignore that malloc has become n ifunc in Glibc and it tries to access symbol 'malloc' directly.
It seems like GDB has been having some issues with ifuncs before, e.g. [1].
Simple way to reproduce the issue: use a program with just empty main function:
int main(void) { return 0; }
In GDB (not that __libc_malloc is the implementation that is returned by the ifunc resolver):
(gdb) br main (gdb) r (gdb) disassemble __libc_malloc
Notice first 2 instructions
(gdb) call printf("%s\n", "hello")
Might result in SIGILL or SIGSEGV... but if it works, it prints format string instead of 'hello'.
(gdb) disassemble __libc_malloc
Notice first 2 instructions have now been re-written with gibberish (hence the signals).
I would appreciate if this could be looked at from the GDB point of view. Perhaps, this should be fixed in GDB?
FWIW, lldb works as expected.
Thank you for the investigation and the detailed report. I was able to reproduce the problem and will work on a fix.
On 23/06/2026 04:00, Thiago Jung Bauermann wrote:
Hello Yury,
Yury Khrustalev Yury.Khrustalev@arm.com writes:
Hi, thanks for this report.
I've looked into these issues, and it seems like most of them are caused by how GDB treats malloc function for evaluating expressions that require a function call.
GDB seems to ignore that malloc has become n ifunc in Glibc and it tries to access symbol 'malloc' directly.
It seems like GDB has been having some issues with ifuncs before, e.g. [1].
Simple way to reproduce the issue: use a program with just empty main function:
int main(void) { return 0; }
In GDB (not that __libc_malloc is the implementation that is returned by the ifunc resolver):
(gdb) br main (gdb) r (gdb) disassemble __libc_malloc
Notice first 2 instructions
(gdb) call printf("%s\n", "hello")
Might result in SIGILL or SIGSEGV... but if it works, it prints format string instead of 'hello'.
(gdb) disassemble __libc_malloc
Notice first 2 instructions have now been re-written with gibberish (hence the signals).
I would appreciate if this could be looked at from the GDB point of view. Perhaps, this should be fixed in GDB?
FWIW, lldb works as expected.
Thank you for the investigation and the detailed report. I was able to reproduce the problem and will work on a fix.
Hi Thiago,
I’ve spent some time looking into this issue. The problem appears to be in find_function_in_inferior, which GDB uses when expression evaluation needs to call functions in the inferior, such as malloc for allocating storage for string literal arguments.
When the lookup falls back to a minimal symbol, GDB constructs a synthetic function type from the symbol address. For GNU IFUNC symbols such as malloc, this path loses the IFUNC marker, causing the inferior call machinery to treat the symbol as an ordinary function and skip IFUNC resolution.
The patch below preserves the IFUNC property when creating the synthetic function type. With this change, Yury’s reproducer behaves correctly on my setup.
Does this look like a reasonable approach to you?
Thanks, Kamran
-- >8 -- commit 960287b93f737dab13d7be40612dcc091b69737d Author: Muhammad Kamran muhammad.kamran@arm.com Date: Mon Jun 22 16:55:23 2026 +0100
gdb: Preserve IFUNC marker when finding inferior functions
GDB calls find_function_in_inferior ("malloc") when expression evaluation needs to allocate memory in the inferior, e.g. for string literal arguments.
The minimal-symbol fallback created a synthetic ordinary function pointer from msymbol.value_address (). If the symbol was a GNU IFUNC, this discarded the IFUNC marker, so call_function_by_hand did not resolve the symbol before calling it.
Use find_minsym_type_and_address to classify the minimal symbol and propagate the GNU IFUNC marker to the synthetic function type. This keeps the existing fallback return type while allowing inferior calls through IFUNC symbols to be resolved correctly.
diff --git a/gdb/valops.c b/gdb/valops.c index ab6fd5079e1..7d305871efc 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -133,11 +133,15 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) struct gdbarch *gdbarch = objfile->arch ();
struct type *type; + struct type *resolved_type; CORE_ADDR maddr; type = lookup_pointer_type (builtin_type (gdbarch)->builtin_char); type = lookup_function_type (type); type = lookup_pointer_type (type); - maddr = msymbol.value_address (); + resolved_type = find_minsym_type_and_address (msymbol.minsym, objfile, + &maddr); + if (resolved_type->is_gnu_ifunc ()) + type->target_type ()->set_is_gnu_ifunc (true);
if (objf_p) *objf_p = objfile;
On 23/06/26 06:27, Muhammad Kamran wrote:
On 23/06/2026 04:00, Thiago Jung Bauermann wrote:
Hello Yury,
Yury Khrustalev Yury.Khrustalev@arm.com writes:
Hi, thanks for this report.
I've looked into these issues, and it seems like most of them are caused by how GDB treats malloc function for evaluating expressions that require a function call.
GDB seems to ignore that malloc has become n ifunc in Glibc and it tries to access symbol 'malloc' directly.
It seems like GDB has been having some issues with ifuncs before, e.g. [1].
Simple way to reproduce the issue: use a program with just empty main function:
int main(void) { return 0; }
In GDB (not that __libc_malloc is the implementation that is returned by the ifunc resolver):
(gdb) br main (gdb) r (gdb) disassemble __libc_malloc
Notice first 2 instructions
(gdb) call printf("%s\n", "hello")
Might result in SIGILL or SIGSEGV... but if it works, it prints format string instead of 'hello'.
(gdb) disassemble __libc_malloc
Notice first 2 instructions have now been re-written with gibberish (hence the signals).
I would appreciate if this could be looked at from the GDB point of view. Perhaps, this should be fixed in GDB?
FWIW, lldb works as expected.
Thank you for the investigation and the detailed report. I was able to reproduce the problem and will work on a fix.
Hi Thiago,
I’ve spent some time looking into this issue. The problem appears to be in find_function_in_inferior, which GDB uses when expression evaluation needs to call functions in the inferior, such as malloc for allocating storage for string literal arguments.
When the lookup falls back to a minimal symbol, GDB constructs a synthetic function type from the symbol address. For GNU IFUNC symbols such as malloc, this path loses the IFUNC marker, causing the inferior call machinery to treat the symbol as an ordinary function and skip IFUNC resolution.
The patch below preserves the IFUNC property when creating the synthetic function type. With this change, Yury’s reproducer behaves correctly on my setup.
Does this look like a reasonable approach to you?
Thanks for working on this Kamran. One thing that worries me is this ifunc change made glibc hard to debug on old gdb without this fix. Usually newer glibc versions take some time to be deployed widely, and deployers also use more recent binutils versions along it.
Hello Kamran,
Muhammad Kamran muhammad.kamran@arm.com writes:
On 23/06/2026 04:00, Thiago Jung Bauermann wrote:
Hello Yury, Yury Khrustalev Yury.Khrustalev@arm.com writes:
Notice first 2 instructions have now been re-written with gibberish (hence the signals).
I would appreciate if this could be looked at from the GDB point of view. Perhaps, this should be fixed in GDB?
FWIW, lldb works as expected.
Thank you for the investigation and the detailed report. I was able to reproduce the problem and will work on a fix.
I’ve spent some time looking into this issue. The problem appears to be in find_function_in_inferior, which GDB uses when expression evaluation needs to call functions in the inferior, such as malloc for allocating storage for string literal arguments.
When the lookup falls back to a minimal symbol, GDB constructs a synthetic function type from the symbol address. For GNU IFUNC symbols such as malloc, this path loses the IFUNC marker, causing the inferior call machinery to treat the symbol as an ordinary function and skip IFUNC resolution.
Great! Thank you for the investigation and analysis!
The patch below preserves the IFUNC property when creating the synthetic function type. With this change, Yury’s reproducer behaves correctly on my setup.
Does this look like a reasonable approach to you?
It does, thank you for the patch! I can add my Reviewed-by when you post it on the mailing list.
As a bit of a rambling side note, I thought it was strange that the call to lookup_symbol at the beginning of find_function_in_inferior is using SEARCH_TYPE_DOMAIN. I thought it made more sense if it used SEARCH_FUNCTION_DOMAIN so I made that change to see if it would also fix the bug (at least when libc6 has debug info available), but it didn't. I even changed it to SEARCH_VAR_DOMAIN because of the comment saying that C functions are in the VAR domain, but it also didn't fix the bug.
linaro-toolchain@lists.linaro.org