[PHP-DEV] Re: non-PIC build broken on oss-fuzz

2019-09-09 Thread Stanislav Malyshev
Hi! On 9/9/19 2:16 AM, Dmitry Stogov wrote: > I've just rechecked, when PHP configured with "--with-pic", libtool > generates only PIC object files and there is no difference between *.lo > to *.o files. Sorry, you were right, --with-pic works, it was my mistake. -- Stas Malyshev smalys...@gma

Re: [PHP-DEV] non-PIC build broken on oss-fuzz

2019-09-09 Thread M. W. Moe
ok got thru the link: I think it's written in plain sight `recompile with -fPIE and relink with -pie`. On Mon, Sep 9, 2019 at 10:42 AM M. W. Moe wrote: > You try to mix static and dynamic linkage; there is something wrong > regarding the setup of target platform; > enumerate details about flavor

Re: [PHP-DEV] non-PIC build broken on oss-fuzz

2019-09-09 Thread M. W. Moe
You try to mix static and dynamic linkage; there is something wrong regarding the setup of target platform; enumerate details about flavors. On Sun, Sep 8, 2019 at 10:13 PM Stanislav Malyshev wrote: > Hi! > > Looks like commit eef85229d0fe9f69d325aa0231e592f35c468afb broke > oss-fuzz builds: >

[PHP-DEV] Re: FFI extension / NULL-Checks

2019-09-09 Thread Christoph M. Becker
On 09.09.2019 at 08:03, Philip Hofstetter wrote: > (I'm writing to the internals list because I don't think that at this > point, FFI usage is wide-spread enough to get an opinion on other venues) > > maybe I'm just stupid, but I think there has been a slight oversight in the > API design for the

[PHP-DEV] Re: FFI extension / NULL-Checks

2019-09-09 Thread Philip Hofstetter
In response to these findings so far, I have now submitted https://github.com/php/php-src/pull/4691 that adds an FFI::isNull() method that returns true if the passed CData instance points to NULL. If you agree that something like this is indeed needed, I will gladly update the PR and add unit te

Re: [PHP-DEV] FFI extension / NULL-Checks

2019-09-09 Thread Philip Hofstetter
On Mon, Sep 9, 2019 at 10:13 AM Stanislav Malyshev wrote: > > isset($err) > > $err[0] != null > > -> is always true, regardless of whether func as assigned an error or not > > > > $err[0]; > > -> segfault > > This is a bit confusing - if $err[0] segfaults, how it can be != null? > Does this beha

Re: [PHP-DEV] FFI extension / NULL-Checks

2019-09-09 Thread Stanislav Malyshev
Hi! > isset($err) > $err[0] != null > -> is always true, regardless of whether func as assigned an error or not > > $err[0]; > -> segfault This is a bit confusing - if $err[0] segfaults, how it can be != null? Does this behave differently in different contexts? Anyway, it shouldn't probably segf

[PHP-DEV] Re: non-PIC build broken on oss-fuzz

2019-09-09 Thread Stanislav Malyshev
Hi! >> I added --with-pic, it didn't change anything, same error. > > See . I am sorry, I don't understand how that comment helps. Could you explain a bit further, what needs to be done to make the build work again? configure --wit

[PHP-DEV] Re: non-PIC build broken on oss-fuzz

2019-09-09 Thread Stanislav Malyshev
Hi! On 9/9/19 12:57 AM, Dmitry Stogov wrote: > how do you add "-pie" flag? I do not. I just compile PHP. The script used to configure and build it is here: https://github.com/google/oss-fuzz/blob/master/projects/php/build.sh There are no special flags there as far as I can see. The fuzzing SAPI l

[PHP-DEV] Re: non-PIC build broken on oss-fuzz

2019-09-09 Thread Christoph M. Becker
On 09.09.2019 at 09:29, Stanislav Malyshev wrote: >> I suspect the problem caused by "-pie" linker flag (It requires all >> object files to be build with -fPIE or -fPIC). >> To quick fix this, you may add PHP configure flag "--with-pic". >> Actually, this should build PHP as before the patch. > >

[PHP-DEV] Re: non-PIC build broken on oss-fuzz

2019-09-09 Thread Stanislav Malyshev
Hi! > I suspect the problem caused by "-pie" linker flag (It requires all > object files to be build with -fPIE or -fPIC). > To quick fix this, you may add PHP configure flag "--with-pic". > Actually, this should build PHP as before the patch. I added --with-pic, it didn't change anything, same e