Results 1 to 2 of 2

Thread: Broken Sigpipe crashing in QT event loop on OS X

  1. #1

    Default Broken Sigpipe crashing in QT event loop on OS X

    I'm working on a cross-platform app. It works fine for the most part on Windows and Linux, but on OS X, I am getting crashes due to SIGPIPE Broken Pipe.

    The source of this crash is inside of the event loop, and the last place in my code the debugger can show me is where I call exec().

    I have already tried disabling the SIGPIPE with a call to
    Qt Code:
    1. signal(SIGPIPE, SIG_IGN)
    To copy to clipboard, switch view to plain text mode 
    but that doesn't seem to be working.

    While my code does use networking, this isn't the way I'd expect a SIGPIPE problem with sockets to manifest, in the QT event loop.

    Does anyone have any idea why this might be happening, and what I could do to fix it?

  2. #2
    Join Date
    Apr 2013
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Broken Sigpipe crashing in QT event loop on OS X

    Quote Originally Posted by willjones View Post
    I'm working on a cross-platform app. It works fine for the most part on Windows and Linux, but on OS X, I am getting crashes due to SIGPIPE Broken Pipe.

    The source of this crash is inside of the event loop, and the last place in my code the debugger can show me is where I call exec().

    I have already tried disabling the SIGPIPE with a call to
    Qt Code:
    1. signal(SIGPIPE, SIG_IGN)
    To copy to clipboard, switch view to plain text mode 
    but that doesn't seem to be working.

    While my code does use networking, this isn't the way I'd expect a SIGPIPE problem with sockets to manifest, in the QT event loop.

    Does anyone have any idea why this might be happening, and what I could do to fix it?
    In source code, the SIGPIPE handler must be explicitness set to SIG_INT.
    see http://stackoverflow.com/questions/7...ls-and-sigpipe
    In Qt Creator, in "Preferences" -> "Debugger" -> in tab "GDB", section "Additional Startup Commands" -> next command must be typed: handle SIGPIPE nostop noprint pass
    (http://ahlamnote.blogspot.ro/2006/12...e-sigpipe.html)
    gdb stops at SIGPIPE
    By default, gdb captures SIGPIPE of a process and pauses it. However, some program ignores SIGPIPE. So, the default behavour of gdb is not desired when debugging those program. To avoid gdb stopping in SIGPIPE, use the folloing command in gdb:
    handle SIGPIPE nostop noprint pass

Similar Threads

  1. Replies: 4
    Last Post: 6th August 2011, 01:40
  2. QT event loop
    By theprobe in forum Newbie
    Replies: 1
    Last Post: 26th January 2011, 13:21
  3. Event loop
    By jefs in forum Qt Programming
    Replies: 2
    Last Post: 2nd January 2011, 17:51
  4. Replies: 10
    Last Post: 15th January 2010, 14:35
  5. Replies: 0
    Last Post: 23rd October 2008, 12:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.