public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Updated: gcc-7.3.0-2 (x86/x86_64)
       [not found] <1268fcb1-715a-0518-cc94-91f452d029fb@gmail.com>
@ 2018-05-30 10:57 ` Alberto Escrig Vidal
  2018-05-30 16:14   ` JonY
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alberto Escrig Vidal @ 2018-05-30 10:57 UTC (permalink / raw)
  To: The Cygwin Mailing List


Thanks so much Jon!


I have noticed a couple of issues with g++-7.


1)


#include <string>
#include <iostream>
#include <sstream>

int main()
{
std::string Str;
std::stringstream ss("hello");
std::getline(ss,Str);
std::cout << Str;

return 0;
}

Compiling the above program with:

g++ -g -std=c++17 foo.cpp

Compiles just fine, but aborts when running it.

Running it with gdb:

Program received signal SIGABRT, Aborted.
0x6326126a in cygstdc++-6!_ZNSs7reserveEj () from /usr/bin/cygstdc++-6.dll

The program works fine if compiled with -std=c++14.

2)

This program fails to compile (it also failed with g++-6).

#include <shared_mutex>

int main() {}



--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Updated: gcc-7.3.0-2 (x86/x86_64)
  2018-05-30 10:57 ` Updated: gcc-7.3.0-2 (x86/x86_64) Alberto Escrig Vidal
@ 2018-05-30 16:14   ` JonY
  2018-05-31  2:22     ` Ken Brown
  2018-06-05 18:07   ` Alberto Escrig Vidal
  2018-06-05 23:28   ` JonY
  2 siblings, 1 reply; 7+ messages in thread
From: JonY @ 2018-05-30 16:14 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 1097 bytes --]

On 05/29/2018 05:32 PM, Alberto Escrig Vidal wrote:
> 
> Thanks so much Jon!
> 
> 
> I have noticed a couple of issues with g++-7.
> 
> 
> 1)
> 
> 
> #include <string>
> #include <iostream>
> #include <sstream>
> 
> int main()
> {
> std::string Str;
> std::stringstream ss("hello");
> std::getline(ss,Str);
> std::cout << Str;
> 
> return 0;
> }
> 
> Compiling the above program with:
> 
> g++ -g -std=c++17 foo.cpp
> 
> Compiles just fine, but aborts when running it.
> 
> Running it with gdb:
> 
> Program received signal SIGABRT, Aborted.
> 0x6326126a in cygstdc++-6!_ZNSs7reserveEj () from /usr/bin/cygstdc++-6.dll
> 
> The program works fine if compiled with -std=c++14.
> 

$ c++filt _ZNSs7reserveEj
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>::reserve(unsigned int)

Does -static change anything?

> 2)
> 
> This program fails to compile (it also failed with g++-6).
> 
> #include <shared_mutex>
> 
> int main() {}
> 

I'm guessing Cygwin does not support the functionality declared in the
headers yet.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Updated: gcc-7.3.0-2 (x86/x86_64)
  2018-05-30 16:14   ` JonY
@ 2018-05-31  2:22     ` Ken Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Ken Brown @ 2018-05-31  2:22 UTC (permalink / raw)
  To: cygwin

On 5/30/2018 7:58 AM, JonY wrote:
> On 05/29/2018 05:32 PM, Alberto Escrig Vidal wrote:
>> This program fails to compile (it also failed with g++-6).
>>
>> #include <shared_mutex>
>>
>> int main() {}
>>
> 
> I'm guessing Cygwin does not support the functionality declared in the
> headers yet.

I think the explanation is simpler.  The problem is that the 
shared_mutex header uses some pthread_rwlock_* functions (if __cplusplus 
 >= 201402L) but the declaration of these in pthread.h is guarded by

   #if __XSI_VISIBLE >= 500 || __POSIX_VISIBLE >= 200112

I've submitted a patch to fix this:

   https://cygwin.com/ml/cygwin-patches/2018-q2/msg00018.html

Ken

--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Updated: gcc-7.3.0-2 (x86/x86_64)
  2018-05-30 10:57 ` Updated: gcc-7.3.0-2 (x86/x86_64) Alberto Escrig Vidal
  2018-05-30 16:14   ` JonY
@ 2018-06-05 18:07   ` Alberto Escrig Vidal
  2018-06-05 23:28   ` JonY
  2 siblings, 0 replies; 7+ messages in thread
From: Alberto Escrig Vidal @ 2018-06-05 18:07 UTC (permalink / raw)
  To: The Cygwin Mailing List

Some more imput: Problem (1) is related to getline. I prepared this minimal example after disecting a program that parses a text file which aborted under cygwin (despite it worked well compiled with g++-7 under ubuntu).


Thanks for the patch for problem (2) Ken!

________________________________
De: Alberto Escrig Vidal
Enviado: martes, 29 de mayo de 2018 19:32:39
Para: The Cygwin Mailing List
Asunto: Re: Updated: gcc-7.3.0-2 (x86/x86_64)



Thanks so much Jon!


I have noticed a couple of issues with g++-7.


1)


#include <string>
#include <iostream>
#include <sstream>

int main()
{
std::string Str;
std::stringstream ss("hello");
std::getline(ss,Str);
std::cout << Str;

return 0;
}

Compiling the above program with:

g++ -g -std=c++17 foo.cpp

Compiles just fine, but aborts when running it.

Running it with gdb:

Program received signal SIGABRT, Aborted.
0x6326126a in cygstdc++-6!_ZNSs7reserveEj () from /usr/bin/cygstdc++-6.dll

The program works fine if compiled with -std=c++14.

2)

This program fails to compile (it also failed with g++-6).

#include <shared_mutex>

int main() {}



--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Updated: gcc-7.3.0-2 (x86/x86_64)
  2018-05-30 10:57 ` Updated: gcc-7.3.0-2 (x86/x86_64) Alberto Escrig Vidal
  2018-05-30 16:14   ` JonY
  2018-06-05 18:07   ` Alberto Escrig Vidal
@ 2018-06-05 23:28   ` JonY
  2 siblings, 0 replies; 7+ messages in thread
From: JonY @ 2018-06-05 23:28 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 769 bytes --]

On 05/29/2018 05:32 PM, Alberto Escrig Vidal wrote:
> 
> Thanks so much Jon!
> 
> 
> I have noticed a couple of issues with g++-7.
> 
> 
> 1)
> 
> 
> #include <string>
> #include <iostream>
> #include <sstream>
> 
> int main()
> {
> std::string Str;
> std::stringstream ss("hello");
> std::getline(ss,Str);
> std::cout << Str;
> 
> return 0;
> }
> 
> Compiling the above program with:
> 
> g++ -g -std=c++17 foo.cpp
> 
> Compiles just fine, but aborts when running it.
> 
> Running it with gdb:
> 
> Program received signal SIGABRT, Aborted.
> 0x6326126a in cygstdc++-6!_ZNSs7reserveEj () from /usr/bin/cygstdc++-6.dll

I suspect --enable-fully-dynamic-string may affect it, but this breaks
libstdc++ ABI. I'll test it soon-ish.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Updated: gcc-7.3.0-2 (x86/x86_64)
@ 2018-05-30 20:31 Dai Conrad
  0 siblings, 0 replies; 7+ messages in thread
From: Dai Conrad @ 2018-05-30 20:31 UTC (permalink / raw)
  To: cygwin mailing list

On Wed, 30 May 2018 11:58 AM, JonY <10walls@gmail.com> wrote:
>
> Does -static change anything?

Interesting! It succeeds with g++ -std=c++17, and does this with
clang++ -std=c++17:

$ clang++ -std=c++17 -static -Wall -Wextra -O2 -o testa testa.cc
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/libstdc++.a(cow-string-inst.o):cow-string-inst.cc:(.data$_ZNSs4_Rep20_S_empty_rep_storageE[_ZNSs4_Rep20_S_empty_rep_storageE]+0x0):
multiple definition of `std::string::_Rep::_S_empty_rep_storage'
/tmp/testa-c0acb8.o:(.bss[_ZNSs4_Rep20_S_empty_rep_storageE]+0x0):
first defined here
clang-5.0: error: linker command failed with exit code 1 (use -v to
see invocation)


>> #include <shared_mutex>
>
> I'm guessing Cygwin does not support the functionality declared in the
> headers yet.

If that were the case, it should not compile with g++ -std=c++11,
gnu++14, or gnu++17,
but it does. Also, a much cleaner error message could be shown with:

#error shared_mutex not supported

in the header file, instead of lots of "pthread_rwlock_* not declared
in this scope".

(Note: the first one, with the std::stringstream, still fails with -std=gnu++17)

--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Updated: gcc-7.3.0-2 (x86/x86_64)
@ 2018-05-30 19:57 Dai Conrad
  0 siblings, 0 replies; 7+ messages in thread
From: Dai Conrad @ 2018-05-30 19:57 UTC (permalink / raw)
  To: cygwin mailing list

On Tue, 29 May 2018 05:32 PM, Alberto Escrig Vidal
<alberto.escrig@itc.uji.es> wrote:
> I have noticed a couple of issues with g++-7.
>
> 1)
>
> #include <string>
> #include <iostream>
> #include <sstream>
>
> int main()
> {
> std::string Str;
> std::stringstream ss("hello");
> std::getline(ss,Str);
> std::cout << Str;
>
> return 0;
> }
>
> Compiling the above program with:
>
> g++ -g -std=c++17 foo.cpp
>
> Compiles just fine, but aborts when running it.
>
> Running it with gdb:
>
> Program received signal SIGABRT, Aborted.
> 0x6326126a in cygstdc++-6!_ZNSs7reserveEj () from /usr/bin/cygstdc++-6.dllcomp
>
> The program works fine if compiled with -std=c++14.

This also happens with clang++ from clang-5.0.1-2:

0x00000003f0e9ca0b in cygstdc++-6!_ZNSs7reserveEm () from
/usr/bin/cygstdc++-6.dll

> 2)
>
> This program fails to compile (it also failed with g++-6).
>
> #include <shared_mutex>
>
> int main() {}

This fails with g++ -std=c++14 or -std=c++17; it compiles with
-std=c++11, gcc-g++-7.3.0-2.

It DOES NOT fail with clang++ at any of those language levels. I'm on
Windows 10, 64-bit
Cygwin, latest everything i.e. whatever I have installed is fully
updated via setup.

"I don't have a solution, but I certainly admire the problem."

David Conrad

--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-05 23:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1268fcb1-715a-0518-cc94-91f452d029fb@gmail.com>
2018-05-30 10:57 ` Updated: gcc-7.3.0-2 (x86/x86_64) Alberto Escrig Vidal
2018-05-30 16:14   ` JonY
2018-05-31  2:22     ` Ken Brown
2018-06-05 18:07   ` Alberto Escrig Vidal
2018-06-05 23:28   ` JonY
2018-05-30 19:57 Dai Conrad
2018-05-30 20:31 Dai Conrad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).