Opened 9 years ago

Closed 9 years ago

#4294 closed bug (fixed)

hClose003 test failes on Solaris/OpenBSD on i386/x86 host

Reported by: kgardas Owned by: igloo
Priority: normal Milestone: 7.0.1
Component: Test Suite Version: 6.13
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: x86
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Hello, it seems hClose003 expected output is kind of Linux specific hence it fails on both Solaris and OpenBSD running on x86 host where I've been able to test this. Anyway, both OSes are not that sensitive to closing pipe read end as Linux seems to be. I also expect that other Unix(-like) systems will behave more like Solaris/OpenBSD and so the behavior of Linux is specific. Hence I'm proposing attached patch which moves currect stdout to new stdout-i386-unknown-linux and provide new stdout with the Solaris/OpenBSD result. I would suggest to commit this and allow it to test on FreeBSD/Darwin as this seems to be available to GHC team as builder machines... Thanks, Karel

Attachments (1)

hClose003.dpatch (76.5 KB) - added by kgardas 9 years ago.
Proposed fix for this issue

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by kgardas

Attachment: hClose003.dpatch added

Proposed fix for this issue

comment:1 Changed 9 years ago by kgardas

Owner: set to igloo

comment:2 Changed 9 years ago by igloo

Milestone: 7.0.1

comment:3 Changed 9 years ago by igloo

The test passes on Linux and OS X, and fails on Solaris (sparky).

This C program:

#include <sys/wait.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <errno.h>

int main(void) {
    int pipefd[2];
    int r;

    signal(SIGPIPE, SIG_IGN);

    if (pipe(pipefd) == -1) {
        perror("pipe");
        exit(1);
    }

    close(pipefd[0]);
    r = write(pipefd[1], "foobar", 3);
    printf("r is %d; errno is %d; %s\n", r, errno, strerror(errno));
    return 0;
}

gives me the same output on both Linux and Solaris, though:

r is -1; errno is 32; Broken pipe

Am I missing something, or is there a bug in the Haskell code on Solaris?

comment:4 in reply to:  3 Changed 9 years ago by simonmar

Replying to igloo:

The test passes on Linux and OS X, and fails on Solaris (sparky).

This C program:

#include <sys/wait.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <errno.h>

int main(void) {
    int pipefd[2];
    int r;

    signal(SIGPIPE, SIG_IGN);

    if (pipe(pipefd) == -1) {
        perror("pipe");
        exit(1);
    }

    close(pipefd[0]);
    r = write(pipefd[1], "foobar", 3);
    printf("r is %d; errno is %d; %s\n", r, errno, strerror(errno));
    return 0;
}

gives me the same output on both Linux and Solaris, though:

r is -1; errno is 32; Broken pipe

Am I missing something, or is there a bug in the Haskell code on Solaris?

I don't see an obvious bug in the Haskell code. Any idea what the bug is?

comment:5 Changed 9 years ago by igloo

Resolution: fixed
Status: newclosed

Aha, looks like it's this:

Wed Dec  1 13:08:47 GMT 2010  Simon Marlow <marlowsd@gmail.com>
  * fix a discarded exception in hClose

Fixed in HEAD and 7.0.

Note: See TracTickets for help on using tickets.