Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/exception/t9657 fails on OpenBSD #13760

Closed
euantorano opened this issue Mar 25, 2020 · 1 comment
Closed

tests/exception/t9657 fails on OpenBSD #13760

euantorano opened this issue Mar 25, 2020 · 1 comment

Comments

@euantorano
Copy link
Contributor

euantorano commented Mar 25, 2020

The test tests/exception/t9657 fails on OpenBSD, as the test exits with exit code 0.

The following C file also exits without any output and a status code of 0:

#include <stdio.h>
#include <string.h>

int main(int argc, char** argv)
{
        char* msg = "exception!";
        int ret = fclose(stdout);

        if (ret != 0) {
                perror("fclose error");
                return 1;
        }

        fwrite(msg, 1, 10, stdout);
        ret = ferror(stdout);

        if (ret != 0) {
                char* errmsg = strerror(ret);
                fprintf(stderr, "fwrite error %d: %s", ret, errmsg);
                return 1;
        }

        return 0;
}

We should probably disable this test for OpenBSD, though it seems odd that this isn't an error in OpenBSD...

euantorano added a commit to euantorano/Nim that referenced this issue Mar 25, 2020
@brynet
Copy link

brynet commented Mar 25, 2020

Calling fwrite/ferror after fclose is undefined behaviour. If that's what the test is boiling down to, then the test is bogus.

After the call to fclose(), any use of stream results in undefined behavior.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/fclose.html

euantorano added a commit to euantorano/Nim that referenced this issue Mar 26, 2020
euantorano added a commit to euantorano/Nim that referenced this issue Mar 31, 2020
euantorano added a commit to euantorano/Nim that referenced this issue Apr 20, 2020
Araq pushed a commit that referenced this issue Apr 21, 2020
* Working on OpenBSD CI
* Condense steps into 2 steps to make output easier to follow.
* Move up one directory after csources build.
* Remove FreeBSD build manifest and add OpenBSD test ignores for coroutines and hot code reloading.
* If runCI fails, run the test results script.
* Add email trigger for build failure
* Remove .git from repository URL
* Disable SFML test on OpenBSD
* Disable tgetaddrinfo on OpenBSD as only UDP and TCP protocols are supported.
* Remove getFilePermissions as it causes CI test failures with NimScript.
* Set clang as cc in nim.cfg and use gmake to build csources.
* Add getCurrentDir to nimscript.
* Remove duplicate getCurrentDir and check for not weirdTarget.
* Add CI badge for OpenBSD.
* Disable tests which allocate lots of memory for OpenBSD.
* Use `CORO_BACKEND_SETJMP` on OpenBSD rather than ucontext.
* Simplify building of koch
* Disable t8657 on OpenBSD. See issue #13760.
* Fix #12142 - tarray_of_channels fails on OpenBSD
* Disable thhtpclient_ssl and tosprocterminate on OpenBSD. These tests can be enabled at a later date after fixing them.
* Install libffi.
* Set path to libc for openbsd.
* Disable tevalffi for now.
* Remove tevalffi.nim.
* Use ncpuonline sysctl rather than ncpu.
* Disable tacceptcloserace and tasynchttpserver on OpenBSD.
* Enable tacceptcloserace and tasynchttpserver.
* Fix #13775 as suggested by @alaviss - use /bin/cat on OpenBSD rather than /bin/sh.
* Enable test on OpenBSD.
* Disable tflowvar on OpenBSD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants