This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] Updated: gcc-6.3.0-2 (x86/x86_64)(Test)


On 2017-07-28 09:19, Marco Atzeri wrote:
On 27/07/2017 23:04, Ross Smith wrote:

gcc 6.3 works fine for me unless I use threads. Any C++ program that
uses std::thread (and worked with the previous gcc) will fail. Simple
example:

    #include <iostream>
    #include <thread>
    void payload() {
        std::cout << "Thread\n";
    }
    int main() {
        std::cout << "Start\n";
        std::thread t(payload);
        t.join();
        std::cout << "Done\n";
    }

Build and run with:

    g++ thread.cpp -o thread && ./thread || echo Fail

This will print Fail, indicating that the executable errored out.
There's no other output. Sorry, I'm not familiar enough with gcc
debugging to narrow down the error further.

Code that uses raw pthreads instead of the C++ API works fine.

(I'm running 64-bit Cygwin on Windows 8.1.)

Ross Smith


it works for me on W7-64

./thread || echo "fail"
Start
Thread
Done

$ g++ --version
g++ (GCC) 6.3.0

That's interesting. Maybe I have something wrong with my installation? I updated the gcc-core, gcc-g++, and libgcc1 packages to the 6.3 test version; was there something else I needed? (I found those by searching the installed package list in the Cygwin installer for gcc or g++, and seeing which ones offered the option of updating to 6.3; there doesn't seem to be any way of checking what you actually need in a case like this.)

Ross Smith

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]