Quantcast

"must be of type int, int given"

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"must be of type int, int given"

Denny Vrandečić-2
I'm running into a weird problem, which made me reset my whole vagrant.

I assume this is not strictly a MediaWiki issue, but probably an HHVM
problem, but maybe someone can help me here.

So, if I start a fresh MediaWiki Vagrant installation, and the vagrant ssh
into the virtual machine, the fastest way to reproduce the issue is to
start hhvmsh and type

function f():int { return 1; };

=f()

I get:

Hit fatal : Value returned from function f() must be of type int, int given

    #0 at [:1]

    #1 f(), called at [:1]

    #2 include(), called at [:1]


Any way to circumvent this (besides getting rid of the type hint,
obviously)? Update to a new HHVM version (According to Special:Version, the
HHMV version is 3.12.14 (srv)?
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

יגאל חיטרון-2
I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
Igal

On Apr 17, 2017 21:36, "Denny Vrandečić" <[hidden email]> wrote:

> I'm running into a weird problem, which made me reset my whole vagrant.
>
> I assume this is not strictly a MediaWiki issue, but probably an HHVM
> problem, but maybe someone can help me here.
>
> So, if I start a fresh MediaWiki Vagrant installation, and the vagrant ssh
> into the virtual machine, the fastest way to reproduce the issue is to
> start hhvmsh and type
>
> function f():int { return 1; };
>
> =f()
>
> I get:
>
> Hit fatal : Value returned from function f() must be of type int, int given
>
>     #0 at [:1]
>
>     #1 f(), called at [:1]
>
>     #2 include(), called at [:1]
>
>
> Any way to circumvent this (besides getting rid of the type hint,
> obviously)? Update to a new HHVM version (According to Special:Version, the
> HHMV version is 3.12.14 (srv)?
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Denny Vrandečić-2
Thanks for the suggestion, but I get exactly the same error message when I
try to typecast the 1 to int first.

‪On Mon, Apr 17, 2017 at 11:56 AM ‫יגאל חיטרון‬‎ <[hidden email]> wrote:‬

> I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
> Igal
>
> On Apr 17, 2017 21:36, "Denny Vrandečić" <[hidden email]> wrote:
>
> > I'm running into a weird problem, which made me reset my whole vagrant.
> >
> > I assume this is not strictly a MediaWiki issue, but probably an HHVM
> > problem, but maybe someone can help me here.
> >
> > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
> ssh
> > into the virtual machine, the fastest way to reproduce the issue is to
> > start hhvmsh and type
> >
> > function f():int { return 1; };
> >
> > =f()
> >
> > I get:
> >
> > Hit fatal : Value returned from function f() must be of type int, int
> given
> >
> >     #0 at [:1]
> >
> >     #1 f(), called at [:1]
> >
> >     #2 include(), called at [:1]
> >
> >
> > Any way to circumvent this (besides getting rid of the type hint,
> > obviously)? Update to a new HHVM version (According to Special:Version,
> the
> > HHMV version is 3.12.14 (srv)?
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

יגאל חיטרון-2
)-:

On Apr 17, 2017 23:16, "Denny Vrandečić" <[hidden email]> wrote:

> Thanks for the suggestion, but I get exactly the same error message when I
> try to typecast the 1 to int first.
>
> ‪On Mon, Apr 17, 2017 at 11:56 AM ‫יגאל חיטרון‬‎ <[hidden email]>
> wrote:‬
>
> > I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
> > Igal
> >
> > On Apr 17, 2017 21:36, "Denny Vrandečić" <[hidden email]> wrote:
> >
> > > I'm running into a weird problem, which made me reset my whole vagrant.
> > >
> > > I assume this is not strictly a MediaWiki issue, but probably an HHVM
> > > problem, but maybe someone can help me here.
> > >
> > > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
> > ssh
> > > into the virtual machine, the fastest way to reproduce the issue is to
> > > start hhvmsh and type
> > >
> > > function f():int { return 1; };
> > >
> > > =f()
> > >
> > > I get:
> > >
> > > Hit fatal : Value returned from function f() must be of type int, int
> > given
> > >
> > >     #0 at [:1]
> > >
> > >     #1 f(), called at [:1]
> > >
> > >     #2 include(), called at [:1]
> > >
> > >
> > > Any way to circumvent this (besides getting rid of the type hint,
> > > obviously)? Update to a new HHVM version (According to Special:Version,
> > the
> > > HHMV version is 3.12.14 (srv)?
> > > _______________________________________________
> > > Wikitech-l mailing list
> > > [hidden email]
> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Denny Vrandečić-2
In reply to this post by Denny Vrandečić-2
Hm. If I try it in https://3v4l.org/WOTg0 I actually get good behavior for
HHMV 3.12.14 - so it might be something problematic with our deployed HHMV
version?


On Mon, Apr 17, 2017 at 1:16 PM Denny Vrandečić <[hidden email]> wrote:

> Thanks for the suggestion, but I get exactly the same error message when I
> try to typecast the 1 to int first.
>
> ‪On Mon, Apr 17, 2017 at 11:56 AM ‫יגאל חיטרון‬‎ <[hidden email]>
> wrote:‬
>
>> I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
>> Igal
>>
>> On Apr 17, 2017 21:36, "Denny Vrandečić" <[hidden email]> wrote:
>>
>> > I'm running into a weird problem, which made me reset my whole vagrant.
>> >
>> > I assume this is not strictly a MediaWiki issue, but probably an HHVM
>> > problem, but maybe someone can help me here.
>> >
>> > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
>> ssh
>> > into the virtual machine, the fastest way to reproduce the issue is to
>> > start hhvmsh and type
>> >
>> > function f():int { return 1; };
>> >
>> > =f()
>> >
>> > I get:
>> >
>> > Hit fatal : Value returned from function f() must be of type int, int
>> given
>> >
>> >     #0 at [:1]
>> >
>> >     #1 f(), called at [:1]
>> >
>> >     #2 include(), called at [:1]
>> >
>> >
>> > Any way to circumvent this (besides getting rid of the type hint,
>> > obviously)? Update to a new HHVM version (According to Special:Version,
>> the
>> > HHMV version is 3.12.14 (srv)?
>> > _______________________________________________
>> > Wikitech-l mailing list
>> > [hidden email]
>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>> _______________________________________________
>> Wikitech-l mailing list
>> [hidden email]
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Denny Vrandečić-2
The same works with bool too. I am glad I don't have to write (bool)true :)

On Mon, Apr 17, 2017 at 1:19 PM Denny Vrandečić <[hidden email]> wrote:

> Hm. If I try it in https://3v4l.org/WOTg0 I actually get good behavior
> for HHMV 3.12.14 - so it might be something problematic with our deployed
> HHMV version?
>
>
> On Mon, Apr 17, 2017 at 1:16 PM Denny Vrandečić <[hidden email]>
> wrote:
>
>> Thanks for the suggestion, but I get exactly the same error message when
>> I try to typecast the 1 to int first.
>>
>> ‪On Mon, Apr 17, 2017 at 11:56 AM ‫יגאל חיטרון‬‎ <[hidden email]>
>> wrote:‬
>>
>>> I'm not so good in this, but try {return (int)1;} . Maximum, I'm wrong.
>>> Igal
>>>
>>> On Apr 17, 2017 21:36, "Denny Vrandečić" <[hidden email]> wrote:
>>>
>>> > I'm running into a weird problem, which made me reset my whole vagrant.
>>> >
>>> > I assume this is not strictly a MediaWiki issue, but probably an HHVM
>>> > problem, but maybe someone can help me here.
>>> >
>>> > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
>>> ssh
>>> > into the virtual machine, the fastest way to reproduce the issue is to
>>> > start hhvmsh and type
>>> >
>>> > function f():int { return 1; };
>>> >
>>> > =f()
>>> >
>>> > I get:
>>> >
>>> > Hit fatal : Value returned from function f() must be of type int, int
>>> given
>>> >
>>> >     #0 at [:1]
>>> >
>>> >     #1 f(), called at [:1]
>>> >
>>> >     #2 include(), called at [:1]
>>> >
>>> >
>>> > Any way to circumvent this (besides getting rid of the type hint,
>>> > obviously)? Update to a new HHVM version (According to
>>> Special:Version, the
>>> > HHMV version is 3.12.14 (srv)?
>>> > _______________________________________________
>>> > Wikitech-l mailing list
>>> > [hidden email]
>>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>> _______________________________________________
>>> Wikitech-l mailing list
>>> [hidden email]
>>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Gergo Tisza
In reply to this post by Denny Vrandečić-2
On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić <[hidden email]>
wrote:

> Value returned from function f() must be of type int, int given


Have you enabled PHP7 mode
<https://docs.hhvm.com/hhvm/configuration/INI-settings#php-7-settings>?
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Denny Vrandečić-2
Ah, that's a good point! Sorry, stupid error.

I think I did it now - adding to
mediawiki-vagrant/puppet/hieradata/common.yaml (I hope that is the right
approach).

Now I get the following error, which seems unrelated to my extension. Hm.

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #033[0m#033[22;31m[Mon Apr
17 21:48:57 2017] [hphp] [29575:7ff81f7ff700:1:000002] [] Exception handler
threw an object exception: TypeError: Argument 5 passed to pfsockopen()
must be an instance of float, int given in
/vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: Stack trace:

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #0
/vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php(233):
Redis->pconnect()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #1
/vagrant/mediawiki/includes/libs/objectcache/RedisBagOStuff.php(354):
RedisConnectionPool->getConnection()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #2
/vagrant/mediawiki/includes/libs/objectcache/RedisBagOStuff.php(151):
RedisBagOStuff->getConnection()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #3
/vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(304):
RedisBagOStuff->getMulti()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #4
/vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(251):
WANObjectCache->getMulti()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #5
/vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(948):
WANObjectCache->get()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #6
/vagrant/mediawiki/includes/libs/objectcache/WANObjectCache.php(895):
WANObjectCache->doGetWithSetCallback()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #7
/vagrant/mediawiki/includes/user/User.php(515):
WANObjectCache->getWithSetCallback()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #8
/vagrant/mediawiki/includes/user/User.php(445): User->loadFromCache()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #9
/vagrant/mediawiki/includes/user/User.php(409): User->loadFromId()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #10
/vagrant/mediawiki/includes/session/UserInfo.php(88): User->load()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #11
/vagrant/mediawiki/includes/session/CookieSessionProvider.php(119):
MediaWiki\Session\UserInfo::newFromId()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #12
/vagrant/mediawiki/includes/session/SessionManager.php(487):
MediaWiki\Session\CookieSessionProvider->provideSessionInfo()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #13
/vagrant/mediawiki/includes/session/SessionManager.php(190):
MediaWiki\Session\SessionManager->getSessionInfoForRequest()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #14
/vagrant/mediawiki/includes/WebRequest.php(735):
MediaWiki\Session\SessionManager->getSessionForRequest()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #15
/vagrant/mediawiki/includes/user/User.php(1143): WebRequest->getSession()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #16
/vagrant/mediawiki/includes/user/User.php(384): User->loadDefaults()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #17
/vagrant/mediawiki/includes/user/User.php(5225): User->load()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #18
/vagrant/mediawiki/includes/user/User.php(2847): User->loadOptions()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #19
/vagrant/mediawiki/includes/context/RequestContext.php(364):
User->getOption()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #20
/vagrant/mediawiki/includes/Message.php(380): RequestContext->getLanguage()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #21
/vagrant/mediawiki/includes/Message.php(1257): Message->getLanguage()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #22
/vagrant/mediawiki/includes/Message.php(842): Message->fetchMessage()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #23
/vagrant/mediawiki/includes/Message.php(934): Message->toString()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #24
/vagrant/mediawiki/includes/exception/MWExceptionRenderer.php(244):
Message->text()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #25
/vagrant/mediawiki/includes/exception/MWExceptionRenderer.php(179):
MWExceptionRenderer::msg()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #26
/vagrant/mediawiki/includes/exception/MWExceptionRenderer.php(50):
MWExceptionRenderer::reportHTML()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #27
/vagrant/mediawiki/includes/exception/MWExceptionHandler.php(74):
MWExceptionRenderer::output()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #28
/vagrant/mediawiki/includes/exception/MWExceptionHandler.php(140):
MWExceptionHandler::report()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #29 ():
MWExceptionHandler::handleException()

Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #30 {main}

On Mon, Apr 17, 2017 at 2:07 PM Gergo Tisza <[hidden email]> wrote:

> On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić <[hidden email]>
> wrote:
>
> > Value returned from function f() must be of type int, int given
>
>
> Have you enabled PHP7 mode
> <https://docs.hhvm.com/hhvm/configuration/INI-settings#php-7-settings>?
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Chad
On Mon, Apr 17, 2017 at 3:07 PM Denny Vrandečić <[hidden email]> wrote:

> Ah, that's a good point! Sorry, stupid error.
>
> I think I did it now - adding to
> mediawiki-vagrant/puppet/hieradata/common.yaml (I hope that is the right
> approach).
>
> Now I get the following error, which seems unrelated to my extension. Hm.
>
> Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #033[0m#033[22;31m[Mon Apr
> 17 21:48:57 2017] [hphp] [29575:7ff81f7ff700:1:000002] [] Exception handler
> threw an object exception: TypeError: Argument 5 passed to pfsockopen()
> must be an instance of float, int given in
> /vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233
>
>
That almost sounds like we should be casting the input to
RedisConnectionPool
to a float from an int. If it expects floats, easy enough to provide
one...could just
check with ctype_digit() so we can handle ints and strings that look like
numbers.

And probably throw an exception if we're not, it's probably bogus config or
a bug
if we're looking at non-numeric input.

-Chad
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Chad
In reply to this post by Gergo Tisza
On Mon, Apr 17, 2017 at 2:07 PM Gergo Tisza <[hidden email]> wrote:

> On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić <[hidden email]>
> wrote:
>
> > Value returned from function f() must be of type int, int given
>
>
> Have you enabled PHP7 mode
> <https://docs.hhvm.com/hhvm/configuration/INI-settings#php-7-settings>?
>
>
I'm curious if we should enable this in Vagrant and our Jenkins testing so
we can avoid weird failures that spawned this thread.

-Chad
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Stas Malyshev
In reply to this post by Denny Vrandečić-2
Hi!

> So, if I start a fresh MediaWiki Vagrant installation, and the vagrant ssh
> into the virtual machine, the fastest way to reproduce the issue is to
> start hhvmsh and type
>
> function f():int { return 1; };

Suspicion: HHVM thinks "int" is a class name, not primitive type name.
Not sure why though...

--
Stas Malyshev
[hidden email]

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Denny Vrandečić-2
In reply to this post by Chad
That would be neat!

On Mon, Apr 17, 2017 at 7:51 PM Chad <[hidden email]> wrote:

> On Mon, Apr 17, 2017 at 2:07 PM Gergo Tisza <[hidden email]> wrote:
>
> > On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić <[hidden email]>
> > wrote:
> >
> > > Value returned from function f() must be of type int, int given
> >
> >
> > Have you enabled PHP7 mode
> > <https://docs.hhvm.com/hhvm/configuration/INI-settings#php-7-settings>?
> >
> >
> I'm curious if we should enable this in Vagrant and our Jenkins testing so
> we can avoid weird failures that spawned this thread.
>
> -Chad
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Denny Vrandečić-2
In reply to this post by Stas Malyshev
Indeed, it seems your right - if I namespace the thing, the compiler
actually tells me that namespace/int is not the same as int. So yeah, it
probably assumes a type int here, which has no relation to the built-in
scalar int.

D'oh.

I didn't realize until know that one wasn't allowed to use type hints with
scalar types (int, string, bool, etc.) until PHP7. This explains a lot.

On Mon, Apr 17, 2017 at 9:33 PM Stas Malyshev <[hidden email]>
wrote:

> Hi!
>
> > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
> ssh
> > into the virtual machine, the fastest way to reproduce the issue is to
> > start hhvmsh and type
> >
> > function f():int { return 1; };
>
> Suspicion: HHVM thinks "int" is a class name, not primitive type name.
> Not sure why though...
>
> --
> Stas Malyshev
> [hidden email]
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Denny Vrandečić-2
In reply to this post by Chad
I tried to change the int to a float, easy enough, and the error went away.

Just to be replaced with

Exception handler threw an object exception: TypeError: Argument 2 passed
to stream_set_blocking() must be an instance of int, bool given in
/vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233

And I can't find a bool being given here. For fun, I cast $port to an int,
but that didn't change anything.

Grmpf.

Thanks for the pointer though.

On Mon, Apr 17, 2017 at 7:49 PM Chad <[hidden email]> wrote:

> On Mon, Apr 17, 2017 at 3:07 PM Denny Vrandečić <[hidden email]>
> wrote:
>
> > Ah, that's a good point! Sorry, stupid error.
> >
> > I think I did it now - adding to
> > mediawiki-vagrant/puppet/hieradata/common.yaml (I hope that is the right
> > approach).
> >
> > Now I get the following error, which seems unrelated to my extension. Hm.
> >
> > Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #033[0m#033[22;31m[Mon Apr
> > 17 21:48:57 2017] [hphp] [29575:7ff81f7ff700:1:000002] [] Exception
> handler
> > threw an object exception: TypeError: Argument 5 passed to pfsockopen()
> > must be an instance of float, int given in
> > /vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233
> >
> >
> That almost sounds like we should be casting the input to
> RedisConnectionPool
> to a float from an int. If it expects floats, easy enough to provide
> one...could just
> check with ctype_digit() so we can handle ints and strings that look like
> numbers.
>
> And probably throw an exception if we're not, it's probably bogus config or
> a bug
> if we're looking at non-numeric input.
>
> -Chad
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Stas Malyshev
Hi!

> Exception handler threw an object exception: TypeError: Argument 2 passed
> to stream_set_blocking() must be an instance of int, bool given in
> /vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233

This one is weird - second arg of stream_set_blocking should be boolean,
e.g.: http://php.net/stream_set_blocking

But looking into hhvm source, I find this:
https://github.com/facebook/hhvm/pull/7084

Looks like hhvm had a wrong definition of the function.

--
Stas Malyshev
[hidden email]

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "must be of type int, int given"

Matthew Flaschen-2
In reply to this post by Chad


On 04/17/2017 10:50 PM, Chad wrote:

> On Mon, Apr 17, 2017 at 2:07 PM Gergo Tisza <[hidden email]> wrote:
>
>> On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić <[hidden email]>
>> wrote:
>>
>>> Value returned from function f() must be of type int, int given
>>
>>
>> Have you enabled PHP7 mode
>> <https://docs.hhvm.com/hhvm/configuration/INI-settings#php-7-settings>?
>>
>>
> I'm curious if we should enable this in Vagrant and our Jenkins testing so
> we can avoid weird failures that spawned this thread.

That sounds like a good idea.  We would want to make sure there is still
a gate without PHP 7 too, as long as we support PHP 5.5.9 (as core does).

Matt Flaschen

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Loading...