public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* perl-Win32-API package problem
@ 2018-04-28 11:41 SJ Luo
  2018-05-15 19:43 ` Achim Gratz
  2019-09-07 15:11 ` Achim Gratz
  0 siblings, 2 replies; 4+ messages in thread
From: SJ Luo @ 2018-04-28 11:41 UTC (permalink / raw)
  To: cygwin

Hi,

  I have a small Perl program that utilize module
Win32::API::Callback. This module works properly if I downloaded this
module from CPAN and compile by myself. There occurs a problem if I
get it from binary package perl-Win32-API downloaded by Cygwin setup
program. I then tried to figure this problem out by downloading source
module and compile by myself. I found a simple flow to duplicate the
fail with the following sequence.

----- Cut here -----
% cd /usr/src/perl-Win32-API-0.84-1.src
% cygport perl-Win32-API.cygport prep compile
    :
% cd perl-Win32-API-0.84-1.x86_64/build/
% mv API_test64.dll API_test64.dll.lnk; cp API_test64.dll.lnk API_test64.dll
% mv rtc64.dll rtc64.dll.lnk; cp rtc64.dll.lnk rtc64.dll
% cd Callback
% make test
    :
    (Failed test 'callback function works' at t/02_Callback.t line 58.)
    :
% touch Callback.c
% make
% make test
    :
    (All tests passed)
    :
----- Cut here -----

  The two lines of commands "mv xxxx; cp xxx" are to dereference the
symbolic links of testing-needed dll files because
Win32::API::LoadLibrary() seems not be able to resolve Cygwin symbolic
link.
  Two "make test" commands are shown above. The first test fails at
02_Callback.t line 75. After fail, a force recompile of the
Callback.dll module is done by touch and make. Doing "make test"
again, this time all test items passed.

  By checking the gcc compile option, I found there is a gcc option
"-fno-stack-protector" provided when I compile this module by myself,
while the option is removed when I compile with cygport. If I try
manually compiling without this option, the same problem occurs.

The host system is Windows7. Cygwin dll is 64bit version 2.10.0-1.
wish it can be solved soon in next package release.

Thanks,
SJ
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /> <table
style="border-top: 1px solid #D3D4DE;">
	<tr>
      <td style="width: 55px; padding-top: 18px;"><a
href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
target="_blank"><img
src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif"
alt="" width="46" height="29" style="width: 46px; height: 29px;"
/></a></td>
		<td style="width: 470px; padding-top: 17px; color: #41424e;
font-size: 13px; font-family: Arial, Helvetica, sans-serif;
line-height: 18px;">不含病毒。<a
href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
target="_blank" style="color: #4453ea;">www.avast.com</a> 		</td>
	</tr>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>

--
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] 4+ messages in thread
* Re: perl-Win32-API package problem
@ 2018-05-16 22:28 S.J. Luo
  0 siblings, 0 replies; 4+ messages in thread
From: S.J. Luo @ 2018-05-16 22:28 UTC (permalink / raw)
  To: cygwin

Hi Achim,

> >   By checking the gcc compile option, I found there is a gcc option
> > "-fno-stack-protector" provided when I compile this module by myself,
> > while the option is removed when I compile with cygport. If I try
> > manually compiling without this option, the same problem occurs.
>
> I don't know enough of how the stack protector actually is implemented
> to understand why it would work without the protector and stop working
> with.
>
> I'll see if it's possible to remove the option from within cygport, if
> yo I'll have to think about any ramifications that might have.

Thanks for the responding. I just learned that stack protector is
trying to prevent against buffer overflow/stack-corruption based
attacks. It might not be a big issue. A crack-aware program shall
simply avoid this module.

And yes I believe it is complex that how stack protector have
influence on this Perl module. But I think this option is just
necessary. The Makefile.PL explicitly applies -fno-stack-protector
option on non-MSVC compilers with 64bit target:

https://metacpan.org/source/BULKDD/Win32-API-0.84/Makefile.PL#L149

SJ

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

end of thread, other threads:[~2019-09-07 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-28 11:41 perl-Win32-API package problem SJ Luo
2018-05-15 19:43 ` Achim Gratz
2019-09-07 15:11 ` Achim Gratz
2018-05-16 22:28 S.J. Luo

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