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. Server crash after client calls QtTcpSocket::disconnectFromHost();
Forum Updated to NodeBB v4.3 + New Features

Server crash after client calls QtTcpSocket::disconnectFromHost();

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 2 Posters 920 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi and welcome to devnet,

    What are you using of the server ?

    Please provide the stack trace of your crash.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vadru
      wrote on last edited by
      #3

      I'm new to linux and I dont know how can I get the stack trace?

      The server is running on a RaspberryPI.
      The RaspberryPI is controlling my boiler and gathering some information like temperature, etc.
      And the server is sending that information to the client so I can watch my boiler on my pc even when I'm not home.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Use gdb to run your application.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • V Offline
          V Offline
          Vadru
          wrote on last edited by
          #5

          This is the stack trace:

          Thread 5 "test" received signal SIGPIPE, Broken pipe.
          [Switching to Thread 0xb4fff450 (LWP 7463)]
          __GI___libc_write (nbytes=52, buf=0xb50008a0, fd=5)
              at ../sysdeps/unix/sysv/linux/write.c:26
          26      ../sysdeps/unix/sysv/linux/write.c: No such file or directory.
          
          
          1 Reply Last reply
          0
          • V Offline
            V Offline
            Vadru
            wrote on last edited by Vadru
            #6
            __libc_write (int fd, const void *buf, size_t nbytes)
            {
              return SYSCALL_CANCEL (write, fd, buf, nbytes); <- this is that line of code
            }
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #7

              Are you using a QTcpServer ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                If not, are you handling that signal ? See here for some suggestions related to that.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1
                • V Offline
                  V Offline
                  Vadru
                  wrote on last edited by
                  #9

                  Such a simple mistake I have not used TCP in such a long time that I forgot all about signals.
                  I was getting so frustrated trying to solve it for several hours.
                  Now it works, thank you so much!

                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    Vadru
                    wrote on last edited by
                    #10

                    Just of curiosity, why does disconnectFromHost() sends a sigpipe but when I close application it does not send a sigpipe?

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      Sorry, I currently don't know although I am also intrigued.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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