Exclude Resource in Zend Guard 6.0.0 & PHP 5.4

General discussion on Zend Guard / Optimizer

Exclude Resource in Zend Guard 6.0.0 & PHP 5.4

Postby adrianolek on Wed Aug 14, 2013 3:00 pm

When trying to encode a project with excluded resources for PHP 5.4 i get:
The operation has completed with bad exit status: 134

This happens only for 5.4, encoding for 5.3 works fine.

Here is the console output:
Code: Select all
/home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/GuardEngine --xml-file /home/adrian/Zend/workspaces/ZendGuardProjects/test/guard.xml
/home/adrian/Desktop/test/test2.php - /home/adrian/Desktop/test
Entering directory: /home/adrian/Desktop/test
/home/adrian/Desktop/test/test1.php: Done.
Leaving directory: /home/adrian/Desktop/test
Unknown(line 0): Function registration failed - duplicate name - each
Copying /home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources//home/adrian/Desktop/test/test2.php: Done.
*** Error in `/home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/GuardEngine': free(): invalid pointer: 0x0a0aef90 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x767e2)[0xb75f87e2]
/lib/i386-linux-gnu/libc.so.6(+0x77530)[0xb75f9530]
/home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/ZendEncoder54.so(+0x8544a)[0xb737844a]
/home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/ZendEncoder54.so(+0x7e520)[0xb7371520]
/home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/ZendEncoder54.so(+0x2aa51)[0xb731da51]
======= Memory map: ========
08048000-082a2000 r-xp 00000000 08:01 187172     /home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/GuardEngine
082a2000-082cb000 rwxp 00259000 08:01 187172     /home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/GuardEngine
082cb000-082d1000 rwxp 00000000 00:00 0
0a064000-0a0fb000 rwxp 00000000 00:00 0          [heap]
b71c3000-b71de000 r-xp 00000000 08:01 132125     /lib/i386-linux-gnu/libgcc_s.so.1
b71de000-b71df000 r-xp 0001a000 08:01 132125     /lib/i386-linux-gnu/libgcc_s.so.1
b71df000-b71e0000 rwxp 0001b000 08:01 132125     /lib/i386-linux-gnu/libgcc_s.so.1
b71f2000-b72f3000 rwxp 00000000 00:00 0
b72f3000-b755c000 r-xp 00000000 08:01 187175     /home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/ZendEncoder54.so
b755c000-b757b000 rwxp 00268000 08:01 187175     /home/adrian/ZendGuard-6_0_0/plugins/com.zend.guard.core.resources.linux.x86_6.0.0.201305051318/resources/ZendEncoder54.so
b757b000-b7582000 rwxp 00000000 00:00 0
b7582000-b772f000 r-xp 00000000 08:01 132100     /lib/i386-linux-gnu/libc-2.17.so
b772f000-b7731000 r-xp 001ad000 08:01 132100     /lib/i386-linux-gnu/libc-2.17.so
b7731000-b7732000 rwxp 001af000 08:01 132100     /lib/i386-linux-gnu/libc-2.17.so
b7732000-b7735000 rwxp 00000000 00:00 0
b7735000-b7776000 r-xp 00000000 08:01 132148     /lib/i386-linux-gnu/libm-2.17.so
b7776000-b7777000 r-xp 00040000 08:01 132148     /lib/i386-linux-gnu/libm-2.17.so
b7777000-b7778000 rwxp 00041000 08:01 132148     /lib/i386-linux-gnu/libm-2.17.so
b7778000-b778f000 r-xp 00000000 08:01 132212     /lib/i386-linux-gnu/libpthread-2.17.so
b778f000-b7790000 r-xp 00016000 08:01 132212     /lib/i386-linux-gnu/libpthread-2.17.so
b7790000-b7791000 rwxp 00017000 08:01 132212     /lib/i386-linux-gnu/libpthread-2.17.so
b7791000-b7794000 rwxp 00000000 00:00 0
b7794000-b779b000 r-xp 00000000 08:01 132220     /lib/i386-linux-gnu/librt-2.17.so
b779b000-b779c000 r-xp 00006000 08:01 132220     /lib/i386-linux-gnu/librt-2.17.so
b779c000-b779d000 rwxp 00007000 08:01 132220     /lib/i386-linux-gnu/librt-2.17.so
b779d000-b77a0000 r-xp 00000000 08:01 132115     /lib/i386-linux-gnu/libdl-2.17.so
b77a0000-b77a1000 r-xp 00002000 08:01 132115     /lib/i386-linux-gnu/libdl-2.17.so
b77a1000-b77a2000 rwxp 00003000 08:01 132115     /lib/i386-linux-gnu/libdl-2.17.so
b77b3000-b77b6000 rwxp 00000000 00:00 0
b77b6000-b77b7000 r-xp 00000000 00:00 0          [vdso]
b77b7000-b77d7000 r-xp 00000000 08:01 132076     /lib/i386-linux-gnu/ld-2.17.so
b77d7000-b77d8000 r-xp 0001f000 08:01 132076     /lib/i386-linux-gnu/ld-2.17.so
b77d8000-b77d9000 rwxp 00020000 08:01 132076     /lib/i386-linux-gnu/ld-2.17.so
bff18000-bff39000 rwxp 00000000 00:00 0          [stack]
The operation has completed with bad exit status: 134


I've tested it on clean installation of Ubuntu 13.04 i386, clean Ubuntu 13.04 amd64 & Ubuntu 12.04 amd64 with the same results (status 134).

I use OpenJDK jvm
Code: Select all
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)
OpenJDK Client VM (build 23.7-b01, mixed mode, sharing)

also tested under Oracle jvm, with the same result.

Steps to reproduce:
1. Install Ubuntu 13.04 i386 from http://releases.ubuntu.com/raring/
2. Install jvm (openjdk-7-jre package)
3. Download & unpack Zend Guard 6.0.0 from zend.com
4. Create 2 source php files, eg.:
test1.php
Code: Select all
<?php
echo 'test1.php';

test2.php
Code: Select all
<?php
echo 'test2.php';

5. Create new project in Zend Guard with test2.php excluded from encoding, eg:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<guardProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" appName="test" appVersion="1" targetDir="/home/adrian/Desktop/out" xsi:noNamespaceSchemaLocation="guard.xsd">
   
   <options>
      <phpVersion value="5.4"/>

      <phpFilesExtensions>
         <extension>php</extension>
         <extension>inc</extension>
         <extension>php3</extension>
         <extension>php4</extension>
         <extension>phtml</extension>
      </phpFilesExtensions>

      <supportShortTags value="true"/>
      <supportASPTags value="false"/>
      <workWithEncodedFilesOnly value="false"/>
      
      <expiration>
         <none/>
      </expiration>

      <licenseType value="none"/>
      <privateKey>
         <keyData/>
      </privateKey>

      <headerInformation>
         <default/>
      </headerInformation>

      <optimizationLevel value="full"/>
      <ignoreErrors value="false"/>
      <verbosityLevel value="verbose"/>
      <allowEncodedFileModification value="true"/>
      <resolveSymlinks value="true"/>
      
      <securityMethodList>
         <securityMethod name="encodePhpFiles" value="true"/>
         <securityMethod name="removeLineNumbers" value="false"/>
         <securityMethod name="removePhpDoc" value="true"/>
         <securityMethod name="obfuscateVariables" value="false"/>
         <securityMethod name="obfuscateFunctions" value="false"/>
         <securityMethod name="obfuscateClasses" value="false"/>
         <securityMethod name="obfuscatePhpEntities" value="false"/>
      </securityMethodList>

      <ignorePatterns>
         <pattern>CVS</pattern>
         <pattern>.svn</pattern>
         <pattern>.#*</pattern>
         <pattern>.cvsignore</pattern>
      </ignorePatterns>
   </options>

   <!-- Source entries: -->
   <source path="/home/adrian/Desktop/test">
      <options/>
   </source>
   <source path="/home/adrian/Desktop/test/test2.php">
      <options>
         <phpFilesExtensions/>
      </options>
   </source>
</guardProject>

6. Run encoding - you should get exit status 134

Is it a know issue? If so, how can I encode my projects, which use excluded resources, for PHP 5.4?
adrianolek
 
Posts: 4
Joined: Thu Apr 21, 2011 9:00 am

Re: Exclude Resource in Zend Guard 6.0.0 & PHP 5.4

Postby heik3882 on Tue Sep 17, 2013 9:59 am

I have the same issue, is there a solution?
heik3882
 
Posts: 2
Joined: Tue Sep 17, 2013 9:59 am

Re: Exclude Resource in Zend Guard 6.0.0 & PHP 5.4

Postby zvika on Tue Sep 17, 2013 12:01 pm

Hi
First of all - thank you for bringing this to our attention.
I will cross check for existing bugs and will test simple scenario on Ubuntu 12.04 64-bit and report back with findings.

I don't see a relation between the JAVA and the segfault, but since this happens within GuardEngine process,
please see if you can use command line encoding for now to push your projects. As far as I tested PHP 5.4 encoding using zendenc54 is working fine on this OS+Arch.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 984
Joined: Sun Dec 14, 2008 9:48 am

Re: Exclude Resource in Zend Guard 6.0.0 & PHP 5.4

Postby heik3882 on Tue Apr 08, 2014 8:03 am

OK first:
why it works when i choose php 5.3 but not when i choose php 5.4

second:
didt you have anny idea how complicated it is to use the cli whil all the ignors and stuff.

last:
Sorry but i spend alot of mony for this software and should now expect that it just not work like promoted?
And it will give no fixes within month?
heik3882
 
Posts: 2
Joined: Tue Sep 17, 2013 9:59 am

Re: Exclude Resource in Zend Guard 6.0.0 & PHP 5.4

Postby zvika on Thu May 01, 2014 8:43 am

As far as I recall, this came up as working result so low priority bug.
Which means you can ignore the notification (or not) and still package and release the encoded files.

I hope it will be resolved for future release with PHP 5.5 support (at least for the PHP 5.5 pass).

Encoding from CLI is much better in terms of flexibility, since you can pass any file set in any order and copy-as-is any other files you wish to exclude from encoding (like open source libraries, configuration file etc.).
The only problem is that there is no "alternative" GUI for CLI, but its a matter of bringing up a verbose HTML form to collect the encoding details (files, encoding params, licensing etc.) and keeping them in some backend file/SQLite/DB for future pulling per project / profile so your inputs are kept and you don't need to repeat on each encoding / new project. Also the web form / interface can hold a section for generating licenses with zendenc_sign, to use in zendenc5x encoding later on.
Once you have encoded files in a "new" dir on target filesystem, you can package with/without a license file and test / send to a client.

Zend Server deployment can come in handy for continuous delivery (even in the simplest form), but generating a ZPK (Zend Package) and using deployment wizard / api to drop a new version in Zend Server for testing before sending to your clients.

About the price quote - I'm sure you can have a quick chat with our sales team (in the Zend Store - green chat button), but this price is for the encryption and ability to protect your sources.
When you use Zend Server (free or commercial) and Studio (free or commercial) to develop and run your Guard applications, you benefit from the complete Zend solution without going over the budget for maintenance fees and support to your clients (Zend Server has Guard Loader component and is able to execute encoded apps out of the box on most common systems - Windows, Linux, Mac and IBM i).

Hope this reassure you about the value and features.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 984
Joined: Sun Dec 14, 2008 9:48 am

Re: Exclude Resource in Zend Guard 6.0.0 & PHP 5.4

Postby adrianolek on Fri Jul 18, 2014 9:34 am

Any news? It's been almost a year and it still isn't fixed.

Which means you can ignore the notification (or not) and still package and release the encoded files.


So you're saying that even though Zend Guard displays "The operation has completed with bad exit status: 134", the Zend Guard project will be encoded completely and can be safely deployed to production server?
adrianolek
 
Posts: 4
Joined: Thu Apr 21, 2011 9:00 am

Re: Exclude Resource in Zend Guard 6.0.0 & PHP 5.4

Postby igor6500 on Thu Dec 08, 2016 3:57 pm

I had the same problem, but it was my mistake, I chancheg the source code and tried to encrypt my project.
igor6500
 
Posts: 1
Joined: Thu Dec 08, 2016 3:54 pm


Return to Zend Guard / Optimizer

Who is online

Users browsing this forum: No registered users and 1 guest