Ticket #4294 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

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 Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

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

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

Change History

Changed 3 years ago by kgardas

Proposed fix for this issue

  Changed 3 years ago by kgardas

  • owner set to igloo

  Changed 3 years ago by igloo

  • milestone set to 7.0.1

follow-up: ↓ 4   Changed 2 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?

in reply to: ↑ 3   Changed 2 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?

  Changed 2 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

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.