Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Segfault core dumped
QtWS25 Last Chance

Segfault core dumped

Scheduled Pinned Locked Moved Solved C++ Gurus
segmentationsegfault
3 Posts 2 Posters 2.1k Views
  • 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.
  • QjayQ Offline
    QjayQ Offline
    Qjay
    wrote on last edited by
    #1

    Hello , i need help with a segfault error in this program .

    line 56: 5252 Segmentation fault (core dumped)

    Program is here : https://ghostbin.com/paste/j453x

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      This is not a Qt problem at all.

      Anyway, the bug is in line 61 in = &inFile; - you assign a variable created on a stack to variable in. In the next line, the inFile goes out of scope and is deleted. So when you try to access in later in the code, it segfaults.

      (Z(:^

      QjayQ 1 Reply Last reply
      4
      • sierdzioS sierdzio

        This is not a Qt problem at all.

        Anyway, the bug is in line 61 in = &inFile; - you assign a variable created on a stack to variable in. In the next line, the inFile goes out of scope and is deleted. So when you try to access in later in the code, it segfaults.

        QjayQ Offline
        QjayQ Offline
        Qjay
        wrote on last edited by
        #3

        @sierdzio said in Segfault core dumped:

        Anyway, the bug is in line 61 in = &inFile; - you assign a variable created on a stack to variable in. In the next line, the inFile goes out of scope and is deleted. So when you try to access in later in the code, it segfaults.

        Thanks !! . I know it's not Qt problem but that's why i posted it in C++ section

        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