f2py and -D_FORTIFY_SOURCE=2 compilation flag

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

f2py and -D_FORTIFY_SOURCE=2 compilation flag

David Huard
Hi,

On fedora 8, the docstrings of f2py generated extensions are strangely missing. On Ubuntu, the same modules do have the docstrings. The problem, as reported in the f2py ML, seems to come from the -D_FORTIFY_SOURCE flag which is set to 2 instead of 1. Could this be fixed in numpy.distutils and how ?

Thanks,

David



_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: f2py and -D_FORTIFY_SOURCE=2 compilation flag

Robert Kern-2
On Wed, May 14, 2008 at 2:46 PM, David Huard <[hidden email]> wrote:
> Hi,
>
> On fedora 8, the docstrings of f2py generated extensions are strangely
> missing. On Ubuntu, the same modules do have the docstrings. The problem, as
> reported in the f2py ML, seems to come from the -D_FORTIFY_SOURCE flag which
> is set to 2 instead of 1. Could this be fixed in numpy.distutils and how ?

There is no string "FORTIFY_SOURCE" anywhere in the numpy codebase.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: f2py and -D_FORTIFY_SOURCE=2 compilation flag

David Huard
In reply to this post by David Huard
I filed a patch that seems to do the trick in ticket #792.


2008/5/14 David Huard <[hidden email]>:
Hi,

On fedora 8, the docstrings of f2py generated extensions are strangely missing. On Ubuntu, the same modules do have the docstrings. The problem, as reported in the f2py ML, seems to come from the -D_FORTIFY_SOURCE flag which is set to 2 instead of 1. Could this be fixed in numpy.distutils and how ?

Thanks,

David




_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: f2py and -D_FORTIFY_SOURCE=2 compilation flag

Robert Kern-2
On Wed, May 14, 2008 at 3:20 PM, David Huard <[hidden email]> wrote:
> I filed a patch that seems to do the trick in ticket #792.

I don't think this is the right approach. The problem isn't that
_FORTIFY_SOURCE is set to 2 but that f2py is doing (probably) bad
things that trip these buffer overflow checks. IIRC, Pearu wasn't on
the f2py mailing list at the time this came up; please try him again.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: f2py and -D_FORTIFY_SOURCE=2 compilation flag

Pearu Peterson-3


Robert Kern wrote:
> On Wed, May 14, 2008 at 3:20 PM, David Huard <[hidden email]> wrote:
>> I filed a patch that seems to do the trick in ticket #792.
>
> I don't think this is the right approach. The problem isn't that
> _FORTIFY_SOURCE is set to 2 but that f2py is doing (probably) bad
> things that trip these buffer overflow checks. IIRC, Pearu wasn't on
> the f2py mailing list at the time this came up; please try him again.

I was able to reproduce the bug on a debian system. The fix with
a comment on what was causing the bug, is in svn:

   http://scipy.org/scipy/numpy/changeset/5173

I should warn that the bug fix does not have unittests because:
1) testing the bug requires Fortran compiler that for NumPy is
an optional requirement.
2) I have tested the fix with two different setups that should cover
all possible configurations.
3) In the case of problems with the fix, users should notice it immediately.
4) I have carefully read the patch before committing.

Regards,
Pearu
_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: f2py and -D_FORTIFY_SOURCE=2 compilation flag

David Huard
Works for me,

Thanks

David

2008/5/15 Pearu Peterson <[hidden email]>:


Robert Kern wrote:
> On Wed, May 14, 2008 at 3:20 PM, David Huard <[hidden email]> wrote:
>> I filed a patch that seems to do the trick in ticket #792.
>
> I don't think this is the right approach. The problem isn't that
> _FORTIFY_SOURCE is set to 2 but that f2py is doing (probably) bad
> things that trip these buffer overflow checks. IIRC, Pearu wasn't on
> the f2py mailing list at the time this came up; please try him again.

I was able to reproduce the bug on a debian system. The fix with
a comment on what was causing the bug, is in svn:

  http://scipy.org/scipy/numpy/changeset/5173

I should warn that the bug fix does not have unittests because:
1) testing the bug requires Fortran compiler that for NumPy is
an optional requirement.
2) I have tested the fix with two different setups that should cover
all possible configurations.
3) In the case of problems with the fix, users should notice it immediately.
4) I have carefully read the patch before committing.

Regards,
Pearu
_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion


_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion