ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> ionCube Loader

PHP7 - Beta7 - Segmentation fault

Author Message
iCOM



Joined: 12 Jul 2016
Posts: 6

PostPosted: Tue Jul 12, 2016 9:43 am    Post subject: PHP7 - Beta7 - Segmentation fault Reply with quote

Hello,

i just want to report the following error.
(i cannot create a ticket because my support has expired, but want to help to improve ionCube)


Code:

<?php

/**
 * test
 */

    function myTestFunc() {

        echo 'Hello World';

    }

    myTestFunc();


Will result in:
"Segmentation fault (core dumped)"

But this code works ( "/*" instead of "/**" )

Code:

<?php

/*
 * test
 */

    function myTestFunc() {

        echo 'Hello World';

    }

    myTestFunc();



If i just echo 'Hello World' without the function call, both "/*" and "/**" work.
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2757

PostPosted: Tue Jul 12, 2016 6:56 pm    Post subject: Reply with quote

Thanks for flagging an issue. Support will certainly take a look and see if they can reproduce.
_________________
Community Admin
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 189

PostPosted: Wed Jul 13, 2016 9:22 am    Post subject: Reply with quote

Hi,

Thanks, iCom, for reporting this fault and we have reproduced this issue with the example that you gave.

This seems to occur only when doc comments are suppressed, which will be the default in the GUI. With the command line encoders the segment fault will only occur if the --no-doc-comments flag is used. If doc comments are preserved when encoding then the fault does not occur.

We are looking into a fix for this which should be included in the next release of the PHP 7 Loader.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
iCOM



Joined: 12 Jul 2016
Posts: 6

PostPosted: Fri Jul 15, 2016 1:39 pm    Post subject: Reply with quote

Thank you both for your response!

You are right, I've used "--no-doc-comments", sorry for not telling you right from the start.

I removed this parameter and my application runs without (spotted) problems so far.

- Very good work Ioncube Team - Thank you!

I'm looking forward for future loader updates Smile.
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 189

PostPosted: Fri Jul 22, 2016 5:52 pm    Post subject: Reply with quote

Hi,

Thanks again for letting us know about that problem,

We will be releasing a new beta loader early next week that will fix the issue you reported amongst others.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 189

PostPosted: Thu Jul 28, 2016 4:03 pm    Post subject: Reply with quote

Hi,

This is later than expected but we have now released the Beta 8 loaders for PHP 7 on Linux, as can be seen in the post at http://forum.ioncube.com/viewtopic.php?t=4380
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
iCOM



Joined: 12 Jul 2016
Posts: 6

PostPosted: Mon Aug 01, 2016 11:30 am    Post subject: Reply with quote

Hi alastair!

Thank you for the new Beta!

I tried it today - the segmentation error is gone Smile - but i encountered this strange problem with opendir/readdir. i nailed it down to the following lines:


Code:
$searchDirectory = '/root/';

/*
    if( $handle2 = opendir($searchDirectory) )
    {
        while(false !== ($filename2 = readdir($handle2)))
        {
            // not important stuff
        }
        closedir($handle2);
    }
*/

myfunction($searchDirectory);

function myfunction($directory)
{
    if( $handle = opendir($directory) )
    {
        while( false !== ($filename = readdir($handle)) )
        {
            $path = $directory.$filename;
            echo $path.PHP_EOL;

        }
        closedir($handle);
        return true;
    }
    return false;
}



If i run this code (as root, cli mode), it loops and loops and loops. Example output:

Quote:
/root/test.php
/root/test.php
/root/test.php
/root/test.php
/root/test.php
/root/test.php
....(forever)



But if you uncomment the /* ... */ above, it works like expected and output every file just once.

If you need additional informations concerning my encoding settings, please let me know.


Thanks for your work
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 189

PostPosted: Tue Aug 02, 2016 9:37 am    Post subject: Reply with quote

Hi,

Many thanks, iCOM for testing that new Loader.

We are, however, having problems reproducing the opendir/readdir problem that you gave in that, even with those lines commented out.

Please could you give your encoding settings as that might have a bearing, although we have tried the example both with and without obfuscation.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
iCOM



Joined: 12 Jul 2016
Posts: 6

PostPosted: Wed Aug 03, 2016 7:01 am    Post subject: Reply with quote

Hi alastair,

these are my encoding settings:

Code:

--disable-auto-prepend-append
--property "application='my_application_id'"
--include-if-property "application='my_application_id'"
--no-doc-comments

--add-comment ""
--add-comment "W A R N I N G - Do not try to edit this file."
--add-comment ""

--message-if-no-loader "No IONCUBE-Loader installed. Please contact support."
--optimize max


Thank you!
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 189

PostPosted: Wed Aug 03, 2016 9:59 am    Post subject: Reply with quote

Hi,

Thanks, iCom, for supplying that. However, we are still having difficulty reproducing the error. Indeed, the encoded file appears to work with earlier betas.

Please could you create a ticket in our Support Help Desk about this (you should be able to create the ticket for the "ionCube 24" department) and attach the encoded file so we can investigate further.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube Loader All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum