Bug 95553

Summary: [Qt] QNX does not support SOCK_SEQPACKET socket type for socketpair in ProcessLauncherQt
Product: WebKit Reporter: Milian Wolff <milian.wolff>
Component: WebKit QtAssignee: Milian Wolff <milian.wolff>
Status: RESOLVED FIXED    
Severity: Normal CC: abecsi, cmarcelo, menard, webkit.review.bot, zoltan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 95466    
Attachments:
Description Flags
Patch none

Description Milian Wolff 2012-08-31 04:12:22 PDT
Running a WebKit2/QML app on QNX shows this debug output:

Creation of socket failed with errno: 241

This is from ProcessLauncherQt.cpp, where we currently have:

#if defined(SOCK_SEQPACKET) && !defined(Q_OS_MACX)
#define SOCKET_TYPE SOCK_SEQPACKET
#else
#define SOCKET_TYPE SOCK_DGRAM
#endif

Thus on QNX the SOCK_SEQPACKET socket type is passed to socketpair futher below. On QNX this is apparently not supported, as can be reproduced with this minimal test case:

#include <sys/socket.h>
#include <stdio.h>

int main(int argc, char** argv)
{
    int fds[2];
    char c;

    if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds) == -1) {
        perror("socketpair");
        return 1;
    }

    if (send(fds[0], "a", 1, 0) == -1) {
        perror("send");
        return 1;
    }

    if (recv(fds[1], &c, 1, 0) == -1) {
        perror("recv");
        return 1;
    }

    printf("%c\n", c);

    return 0;
}

The output on a Playbook (bbndk 2.0.1) is: socketpair: Protocol wrong type for socket

Changing SOCK_SEQPACKET to SOCK_DGRAM in the example makes it work, i.e. the output will be "a".

Thus I propose to use SOCK_DGRAM in ProcessLauncherQt.cpp as well, I'll publish a patch.
Comment 1 Milian Wolff 2012-08-31 04:20:14 PDT
Created attachment 161661 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-31 06:33:36 PDT
Comment on attachment 161661 [details]
Patch

Clearing flags on attachment: 161661

Committed r127253: <http://trac.webkit.org/changeset/127253>
Comment 3 WebKit Review Bot 2012-08-31 06:33:39 PDT
All reviewed patches have been landed.  Closing bug.