Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#76435 - [glibc] mtrace() not working

Attached to Project: Arch Linux
Opened by Raman Mohan (mohan43u) - Saturday, 05 November 2022, 19:48 GMT
Last edited by Toolybird (Toolybird) - Friday, 15 September 2023, 06:39 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To freswa (frederik)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


mtrace() suppose to use MALLOC_TRACE environment variable to open the trace file and add trace about head memory usage. but its not happening. I also added '#define _GNU_SOURCE' at the beginning, not working

example test.c:

#define _GNU_SOURCE
#include <mcheck.h>

int main(int argc, char *argv[]) {
char *buffer = NULL;
buffer = calloc(1, 1000);
return 0;

$ gcc -o test test.c

command which I used to run the test:
$ (export MALLOC_TRACE=$(pwd)/test.mtrace; ./test)

Someone also noticed this here

Additional info:
* package version(s): 2.36-6
This task depends upon

Closed by  Toolybird (Toolybird)
Friday, 15 September 2023, 06:39 GMT
Reason for closing:  Upstream
Additional comments about closing:  See comments
Comment by freswa (frederik) - Saturday, 05 November 2022, 20:01 GMT
Could you report this upstream please?
Comment by Toolybird (Toolybird) - Saturday, 05 November 2022, 23:28 GMT
It's by design. Please see [1]. I suppose the man page needs updating. You can get it to work by:

$ LD_PRELOAD=/usr/lib/ ./foo

Comment by Toolybird (Toolybird) - Friday, 15 September 2023, 06:39 GMT
The man page in question [1] comes from the "man-pages" project [2]. Any issues should therefore be reported there.