Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2024 19:05:16 +0000
From:      bugzilla-noreply@freebsd.org
To:        threads@FreeBSD.org
Subject:   [Bug 278551] pthread_join() kills the process with a return code of 134
Message-ID:  <bug-278551-13406-A8zJJWt5DF@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-278551-13406@https.bugs.freebsd.org/bugzilla/>
References:  <bug-278551-13406@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278551

--- Comment #3 from Mohammed Goder <mohammedgoder@gmail.com> ---
(In reply to Konstantin Belousov from comment #2)

I apologize; this is the first time I've ever filed a bug report to a proje=
ct.
I'm aware of the return code message. I'm 100 percent sure that this has to=
 do
with the FreeBSD or it's compiler toolchain/libraries.

main.cpp:
#include "iostream" // iostream's static library has issues on freebsd.
#include "cstdio"
#include "pthread.h"
#include "pthread_np.h"

void* kernel(void* par) {
    printf("kernel\n");
    return NULL;
}

int main(int argc, const char* const* args){
    pthread_t thread;
    pthread_create(
        &thread,
        NULL,
        kernel,
        NULL
    );

    pthread_join(thread, NULL);

    printf("FreeBSD RELEASE 14.0 doesn't reach here.\n");

    return 0;
}

build.sh:
#!/bin/sh
g++ -std=3Dc++20 -static-libgcc -static-libstdc++ -static -pthread -O3 "mai=
n.cpp"
-o "main_g++"
clang++ -std=3Dc++20 -static-libgcc -static-libstdc++ -static -pthread -O3
"main.cpp" -o "main_clang++"

Problem:
I've narrowed the issue down to "iostream" and it's static libraries causing
problems. The issue goes away if you remove the flags to statically link
libraries or remove the "iostream" header from the list of includes. Also,
please keep in mind that this is all still being done in a virtual machine =
so I
don't know if the issue persists on bare metal.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-278551-13406-A8zJJWt5DF>