Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Porting my project from qt5 to qt6
Forum Updated to NodeBB v4.3 + New Features

Porting my project from qt5 to qt6

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 432 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    clopez
    wrote on last edited by
    #1

    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) = 0

    terminate called after throwing an instance of 'std::bad_alloc'
    what(): std::bad_alloc

    Program 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 directory

    System 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

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      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.

      JonBJ Pl45m4P 2 Replies Last reply
      5
      • C ChrisW67

        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.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @ChrisW67 said in Porting my project from qt5 to qt6:

        cannot map approximately 4 million terrabytes of memory (2^62 bytes).

        :D

        1 Reply Last reply
        0
        • C ChrisW67

          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.

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @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


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          0
          • C Offline
            C Offline
            clopez
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved