Porting my project from qt5 to qt6
-
I think this is a problem with openssh, and may be lucky: somebody encountered this problem :)
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)My program uses getaffinty to determine the CPU it can run, then tries to allocate a random (I imagine an uninitialized variable)
sched_getaffinity(27512, 8, [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23]) = 8
futex(0x7b13d427a7bc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
mmap(NULL, 4611686018427392000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(0x40005ed8465d1000) = 0x5ed8465b8000
mmap(NULL, 4611686018427523072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
futex(0x7b13d7f9b230, FUTEX_WAKE_PRIVATE, 2147483647) = 0terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_allocProgram received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
warning: 44 ./nptl/pthread_kill.c: No such file or directorySystem Information
Linux torin 6.8.0-53-generic #55-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 15:37:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Operating System: Kubuntu 24.04
Kernel Version: 6.8.0-53-generic (64-bit)
Graphics Platform: X11
Memory: 62.7 GiB of RAM
Graphics Processor: NV137 -
Welcome to the forum.
You have a generic memory allocation error, most likely because this very suspicious line:
mmap(NULL, 4611686018427392000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM
cannot map approximately 4 million terrabytes of memory (2^62 bytes). That stupidly large value probably comes from somewhere earlier in the program; as you say, an uninitialized or otherwise corrupted value.
I think you will have to take a step back and explain what any of this has to do with Qt.
-
Welcome to the forum.
You have a generic memory allocation error, most likely because this very suspicious line:
mmap(NULL, 4611686018427392000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM
cannot map approximately 4 million terrabytes of memory (2^62 bytes). That stupidly large value probably comes from somewhere earlier in the program; as you say, an uninitialized or otherwise corrupted value.
I think you will have to take a step back and explain what any of this has to do with Qt.
-
Welcome to the forum.
You have a generic memory allocation error, most likely because this very suspicious line:
mmap(NULL, 4611686018427392000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM
cannot map approximately 4 million terrabytes of memory (2^62 bytes). That stupidly large value probably comes from somewhere earlier in the program; as you say, an uninitialized or otherwise corrupted value.
I think you will have to take a step back and explain what any of this has to do with Qt.
@ChrisW67 said in Porting my project from qt5 to qt6:
map approximately 4 million terrabytes of memory (2^62 bytes)
= 4 Exabyte :)
Maybe in couple years :)
In the mid-90s, Bill Gates (IIRC) said something along the lines that a typical user will never need more memory than the capacity of a 3.5” floppy...
In 15 years from now 4EB fits on a regular portable USB flash drive... who knows?! :D -
Thanks for all your answers: the problem was that the old code was pulling
QtPrivate::QDebug
the semaphore was from the QDebug initializing (I imagine to serialize the output)
and the memory allocation was the same issue QDebug tried to allocate an output buffer with a long initialized variable
I removed the code, and now everything works.