public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* [64bit] cygwin-devel headers broken
@ 2015-04-30 18:52 Thomas Wolff
  2015-05-01  5:03 ` Marco Atzeri
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Wolff @ 2015-04-30 18:52 UTC (permalink / raw)
  To: cygwin

There is a crash issue induced on cygwin-64 (not on -32) after
compilation with cygwin-devel 2.0.0 include files. I am recompiling my
editor mined and it crashes, maybe immediately or after typing
non-trivial input (like function keys, waiting for input with select()).
It does not occur after recompiling only certain source files, but it
happens after recompiling only io.c which makes heavy use of terminal
I/O like read(), select(), ioctl().

Reverting the cygwin-devel package to 1.7 (and leaving everything else
up-to-date) solves the issue.
Selective copying of files from the cygwin-devel 2.0 package further
reveals:
/lib: all from 2.0: no problem.
/usr/include/sys: all from 2.0 except the following: no problem.
But if signal.h, stat.h, time.h, types.h, and associated dependencies
are used, the compiled program crashes.
I can try to narrow down the issue further but maybe this is a clue already?

------
Thomas

---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
http://www.avast.com


--
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] 10+ messages in thread

* Re: [64bit] cygwin-devel headers broken
  2015-04-30 18:52 [64bit] cygwin-devel headers broken Thomas Wolff
@ 2015-05-01  5:03 ` Marco Atzeri
  2015-05-01 12:10   ` Jon TURNEY
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Atzeri @ 2015-05-01  5:03 UTC (permalink / raw)
  To: cygwin



On 4/30/2015 8:52 PM, Thomas Wolff wrote:
> There is a crash issue induced on cygwin-64 (not on -32) after
> compilation with cygwin-devel 2.0.0 include files. I am recompiling my
> editor mined and it crashes, maybe immediately or after typing
> non-trivial input (like function keys, waiting for input with select()).
> It does not occur after recompiling only certain source files, but it
> happens after recompiling only io.c which makes heavy use of terminal
> I/O like read(), select(), ioctl().
>
> Reverting the cygwin-devel package to 1.7 (and leaving everything else
> up-to-date) solves the issue.
> Selective copying of files from the cygwin-devel 2.0 package further
> reveals:
> /lib: all from 2.0: no problem.
> /usr/include/sys: all from 2.0 except the following: no problem.
> But if signal.h, stat.h, time.h, types.h, and associated dependencies
> are used, the compiled program crashes.
> I can try to narrow down the issue further but maybe this is a clue
> already?
>
> ------
> Thomas
>

I had a similar issue. But in my case the compilation fails as
select seems gone:

In file included from 
/pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/sin
gular-4.0.2a/libpolys/reporter/s_buff.cc:16:0:
/pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/singular-4.0.2a/libpolys/
reporter/si_signals.h: In function ‘int si_select(int, _types_fd_set*, 
_types_fd
_set*, _types_fd_set*, timeval*)’:
/pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/singular-4.0.2a/libpolys/
reporter/si_signals.h:47:63: error: ‘select’ was not declared in this scope
                     (nfds,readfds, writefds, exceptfds, timeout)
                                                                ^
/pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/singular-4.0.2a/libpolys/
reporter/si_signals.h:33:16: note: in definition of macro 
‘SI_EINTR_SAVE_FUNC_TE
MPLATE’
      res = func args;           \
                 ^
/pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/singular-4.0.2a/libpolys/
reporter/si_signals.h:44:1: note: in expansion of macro ‘SI_EINTR_SAVE_FUNC’
  SI_EINTR_SAVE_FUNC(int, select,
  ^

cheers
Marco

--
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] 10+ messages in thread

* Re: [64bit] cygwin-devel headers broken
  2015-05-01  5:03 ` Marco Atzeri
@ 2015-05-01 12:10   ` Jon TURNEY
  2015-05-01 18:19     ` Thomas Wolff
  2015-05-01 20:25     ` J. Offerman
  0 siblings, 2 replies; 10+ messages in thread
From: Jon TURNEY @ 2015-05-01 12:10 UTC (permalink / raw)
  To: cygwin

On 01/05/2015 06:03, Marco Atzeri wrote:
> On 4/30/2015 8:52 PM, Thomas Wolff wrote:
>> There is a crash issue induced on cygwin-64 (not on -32) after
>> compilation with cygwin-devel 2.0.0 include files. I am recompiling my
>> editor mined and it crashes, maybe immediately or after typing
>> non-trivial input (like function keys, waiting for input with select()).
>> It does not occur after recompiling only certain source files, but it
>> happens after recompiling only io.c which makes heavy use of terminal
>> I/O like read(), select(), ioctl().
>>
>> Reverting the cygwin-devel package to 1.7 (and leaving everything else
>> up-to-date) solves the issue.
>> Selective copying of files from the cygwin-devel 2.0 package further
>> reveals:
>> /lib: all from 2.0: no problem.
>> /usr/include/sys: all from 2.0 except the following: no problem.
>> But if signal.h, stat.h, time.h, types.h, and associated dependencies
>> are used, the compiled program crashes.
>> I can try to narrow down the issue further but maybe this is a clue
>> already?
>>
>> ------
>> Thomas
>>
>
> I had a similar issue. But in my case the compilation fails as
> select seems gone:

It seems that sys/select.h is no longer implicitly included by some 
other header, I think probably sys/time.h.

> In file included from
> /pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/sin
> gular-4.0.2a/libpolys/reporter/s_buff.cc:16:0:
> /pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/singular-4.0.2a/libpolys/
>
> reporter/si_signals.h: In function ‘int si_select(int, _types_fd_set*,
> _types_fd
> _set*, _types_fd_set*, timeval*)’:
> /pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/singular-4.0.2a/libpolys/
>
> reporter/si_signals.h:47:63: error: ‘select’ was not declared in this scope
>                      (nfds,readfds, writefds, exceptfds, timeout)
>                                                                 ^

--
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] 10+ messages in thread

* Re: [64bit] cygwin-devel headers broken
  2015-05-01 12:10   ` Jon TURNEY
@ 2015-05-01 18:19     ` Thomas Wolff
  2015-05-01 20:12       ` Michael Enright
  2015-05-01 20:23       ` Marco Atzeri
  2015-05-01 20:25     ` J. Offerman
  1 sibling, 2 replies; 10+ messages in thread
From: Thomas Wolff @ 2015-05-01 18:19 UTC (permalink / raw)
  To: cygwin

Am 01.05.2015 um 14:10 schrieb Jon TURNEY:
> On 01/05/2015 06:03, Marco Atzeri wrote:
>> On 4/30/2015 8:52 PM, Thomas Wolff wrote:
>>> There is a crash issue induced on cygwin-64 (not on -32) after
>>> compilation with cygwin-devel 2.0.0 include files. I am recompiling my
>>> editor mined and it crashes, maybe immediately or after typing
>>> non-trivial input (like function keys, waiting for input with 
>>> select()).
>>> ...
>>>
>>
>> I had a similar issue. But in my case the compilation fails as
>> select seems gone:
>
> It seems that sys/select.h is no longer implicitly included by some 
> other header, I think probably sys/time.h.
Thanks for the hint, adding an include solves the issue.
It had compiled without because I have a plain extern int select() 
declaration. It's obviously not a good declaration because the pointer 
arguments can now be 64 bit. (I think I could not unconditionally 
include select.h for porting compatibility with some legacy systems that 
don't have it.)

Not sure whether it's a bug then as arguably a program using select 
should declare it properly. On the other hand this issue has not 
appeared on any other system and if traditionally include time.h used to 
imply include select.h maybe that should be maintained.
------
Thomas

--
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] 10+ messages in thread

* Re: [64bit] cygwin-devel headers broken
  2015-05-01 18:19     ` Thomas Wolff
@ 2015-05-01 20:12       ` Michael Enright
  2015-05-02 17:38         ` Csaba Raduly
  2015-05-01 20:23       ` Marco Atzeri
  1 sibling, 1 reply; 10+ messages in thread
From: Michael Enright @ 2015-05-01 20:12 UTC (permalink / raw)
  To: cygwin

When changing from compiler to compiler, even if it be just an OS
point version upgrade, implicit header inclusions go away all the
time. As a developer, I just shrug this off as one of the trade-offs
of choosing to develop in C or C++, which lack proper module systems.


On Fri, May 1, 2015 at 10:58 AM, Thomas Wolff <towo@towo.net> wrote:
> Am 01.05.2015 um 14:10 schrieb Jon TURNEY:
>>
>> On 01/05/2015 06:03, Marco Atzeri wrote:
>>>
>>> On 4/30/2015 8:52 PM, Thomas Wolff wrote:
>>>>
>>>> There is a crash issue induced on cygwin-64 (not on -32) after
>>>> compilation with cygwin-devel 2.0.0 include files. I am recompiling my
>>>> editor mined and it crashes, maybe immediately or after typing
>>>> non-trivial input (like function keys, waiting for input with select()).
>>>> ...
>>>>
>>>
>>> I had a similar issue. But in my case the compilation fails as
>>> select seems gone:
>>
>>
>> It seems that sys/select.h is no longer implicitly included by some other
>> header, I think probably sys/time.h.
>
> Thanks for the hint, adding an include solves the issue.
> It had compiled without because I have a plain extern int select()
> declaration. It's obviously not a good declaration because the pointer
> arguments can now be 64 bit. (I think I could not unconditionally include
> select.h for porting compatibility with some legacy systems that don't have
> it.)
>
> Not sure whether it's a bug then as arguably a program using select should
> declare it properly. On the other hand this issue has not appeared on any
> other system and if traditionally include time.h used to imply include
> select.h maybe that should be maintained.
> ------
> Thomas
>
>
> --
> 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
>

--
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] 10+ messages in thread

* Re: [64bit] cygwin-devel headers broken
  2015-05-01 18:19     ` Thomas Wolff
  2015-05-01 20:12       ` Michael Enright
@ 2015-05-01 20:23       ` Marco Atzeri
  2015-05-01 20:38         ` Eric Blake
  1 sibling, 1 reply; 10+ messages in thread
From: Marco Atzeri @ 2015-05-01 20:23 UTC (permalink / raw)
  To: cygwin

On 5/1/2015 7:58 PM, Thomas Wolff wrote:
> Am 01.05.2015 um 14:10 schrieb Jon TURNEY:
>> On 01/05/2015 06:03, Marco Atzeri wrote:
>>> On 4/30/2015 8:52 PM, Thomas Wolff wrote:

>> It seems that sys/select.h is no longer implicitly included by some
>> other header, I think probably sys/time.h.
> Thanks for the hint, adding an include solves the issue.



same here, I will highlight liliypod upstream,
of the missing include [1]



thanks
Marco

[1]http://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html


--
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] 10+ messages in thread

* Re: [64bit] cygwin-devel headers broken
  2015-05-01 12:10   ` Jon TURNEY
  2015-05-01 18:19     ` Thomas Wolff
@ 2015-05-01 20:25     ` J. Offerman
  1 sibling, 0 replies; 10+ messages in thread
From: J. Offerman @ 2015-05-01 20:25 UTC (permalink / raw)
  To: Cygwin List

Yes, xserver builds on Cygwin 2.0.1-1 now. It failed because of
"select" being undeclared.

On Fri, May 1, 2015 at 5:10 AM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
> On 01/05/2015 06:03, Marco Atzeri wrote:
>>
>> On 4/30/2015 8:52 PM, Thomas Wolff wrote:
>>>
>>> There is a crash issue induced on cygwin-64 (not on -32) after
>>> compilation with cygwin-devel 2.0.0 include files. I am recompiling my
>>> editor mined and it crashes, maybe immediately or after typing
>>> non-trivial input (like function keys, waiting for input with select()).
>>> It does not occur after recompiling only certain source files, but it
>>> happens after recompiling only io.c which makes heavy use of terminal
>>> I/O like read(), select(), ioctl().
>>>
>>> Reverting the cygwin-devel package to 1.7 (and leaving everything else
>>> up-to-date) solves the issue.
>>> Selective copying of files from the cygwin-devel 2.0 package further
>>> reveals:
>>> /lib: all from 2.0: no problem.
>>> /usr/include/sys: all from 2.0 except the following: no problem.
>>> But if signal.h, stat.h, time.h, types.h, and associated dependencies
>>> are used, the compiled program crashes.
>>> I can try to narrow down the issue further but maybe this is a clue
>>> already?
>>>
>>> ------
>>> Thomas
>>>
>>
>> I had a similar issue. But in my case the compilation fails as
>> select seems gone:
>
>
> It seems that sys/select.h is no longer implicitly included by some other
> header, I think probably sys/time.h.
>
>> In file included from
>> /pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/sin
>> gular-4.0.2a/libpolys/reporter/s_buff.cc:16:0:
>>
>> /pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/singular-4.0.2a/libpolys/
>>
>> reporter/si_signals.h: In function ‘int si_select(int, _types_fd_set*,
>> _types_fd
>> _set*, _types_fd_set*, timeval*)’:
>>
>> /pub/devel/singular/prova/singular-4.0.2a-1.x86_64/src/singular-4.0.2a/libpolys/
>>
>> reporter/si_signals.h:47:63: error: ‘select’ was not declared in this
>> scope
>>                      (nfds,readfds, writefds, exceptfds, timeout)
>>                                                                 ^
>
>
> --
> 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
>

--
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] 10+ messages in thread

* Re: [64bit] cygwin-devel headers broken
  2015-05-01 20:23       ` Marco Atzeri
@ 2015-05-01 20:38         ` Eric Blake
  2015-05-02 13:38           ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Blake @ 2015-05-01 20:38 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 926 bytes --]

On 05/01/2015 02:12 PM, Marco Atzeri wrote:
>>> It seems that sys/select.h is no longer implicitly included by some
>>> other header, I think probably sys/time.h.

POSIX says:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html#tag_13_64

"Inclusion of the <sys/time.h> header may make visible all symbols from
the <sys/select.h> header."

which means <sys/time.h> may (but not must) pollute the namespace with
select().  This means two things:

1. Portable applications should not depend on the pollution (so
reporting it to upstream projects is the right thing to do)

2. Cygwin should do better at emulating Linux and include the namespace
pollution, for the sake of applications that have not yet been patched.

Anyone want to tackle the patch to cygwin's sys/time.h?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

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

* Re: [64bit] cygwin-devel headers broken
  2015-05-01 20:38         ` Eric Blake
@ 2015-05-02 13:38           ` Corinna Vinschen
  0 siblings, 0 replies; 10+ messages in thread
From: Corinna Vinschen @ 2015-05-02 13:38 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

On May  1 14:38, Eric Blake wrote:
> On 05/01/2015 02:12 PM, Marco Atzeri wrote:
> >>> It seems that sys/select.h is no longer implicitly included by some
> >>> other header, I think probably sys/time.h.
> 
> POSIX says:
> 
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html#tag_13_64
> 
> "Inclusion of the <sys/time.h> header may make visible all symbols from
> the <sys/select.h> header."
> 
> which means <sys/time.h> may (but not must) pollute the namespace with
> select().  This means two things:
> 
> 1. Portable applications should not depend on the pollution (so
> reporting it to upstream projects is the right thing to do)
> 
> 2. Cygwin should do better at emulating Linux and include the namespace
> pollution, for the sake of applications that have not yet been patched.

I screwed that up, didn't I?

This is a result of the newlib change to sys/time.h.  It has been
updated to the latest stuff from FreeBSD in March.

Before, we had a <cygwin/sys_time.h> header which defines futimes and
lutimes.  Since these symbols are now defined in newlib's new sys/time.h,
I concluded razor-sharp, that we don't need the cygwin-specific
cygwin/sys_time.h anymore.

Unfortunately I missed the fact that this file also includes <sys/select.h>.

> Anyone want to tackle the patch to cygwin's sys/time.h?

I applied a patch.  A new version of Cygwin has to wait until I'm back
from vaca, sorry.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [64bit] cygwin-devel headers broken
  2015-05-01 20:12       ` Michael Enright
@ 2015-05-02 17:38         ` Csaba Raduly
  0 siblings, 0 replies; 10+ messages in thread
From: Csaba Raduly @ 2015-05-02 17:38 UTC (permalink / raw)
  To: cygwin list

On Fri, May 1, 2015 at 9:29 PM, Michael Enright  wrote:
> When changing from compiler to compiler, even if it be just an OS
> point version upgrade, implicit header inclusions go away all the
> time. As a developer, I just shrug this off as one of the trade-offs
> of choosing to develop in C or C++, which lack proper module systems.
(snip)

Please don't top-post.

No need for a trade-off. Include-what-you-use (
http://code.google.com/p/include-what-you-use/ )
will tell exactly which headers are needed, so there's no need to rely
on which header includes which.

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
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] 10+ messages in thread

end of thread, other threads:[~2015-05-02 17:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30 18:52 [64bit] cygwin-devel headers broken Thomas Wolff
2015-05-01  5:03 ` Marco Atzeri
2015-05-01 12:10   ` Jon TURNEY
2015-05-01 18:19     ` Thomas Wolff
2015-05-01 20:12       ` Michael Enright
2015-05-02 17:38         ` Csaba Raduly
2015-05-01 20:23       ` Marco Atzeri
2015-05-01 20:38         ` Eric Blake
2015-05-02 13:38           ` Corinna Vinschen
2015-05-01 20:25     ` J. Offerman

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