# AIX + PHP Extension Module Does Not Work (giving core dump at zend_parse_parameters)

- Thread: https://externals.io/message/4489
- Original archive: https://news-web.php.net/php.internals/4489
- Started by ashish b\\ on 2003-09-15T14:30:07+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #4489 — ashish b\\ — 2003-09-15T14:30:07+00:00

URL: https://externals.io/message/4489#4489

Hi ,
    I am writing a php extension module on AIX 4.3.3  RS6000 machine.I 
have compiled php as CGI.When I test my php extension module function 
from a test php script I get a CORE dump.The gdb php core is as below
        Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
#0  0xd0990180 in zend_parse_parameters ()
(gdb)  bt
#0  0xd0990180 in zend_parse_parameters ()
#1  0xd0990930 in zif_myfunction ()
#2  0x1002c5a4 in execute (op_array=0x200e6c70, tsrm_ls=0x20027738)
    at /usr/local/php-4.3.2/Zend/zend_execute.c:1606
#3  0x1000e0d4 in zend_execute_scripts (type=8, tsrm_ls=0x20027738, 
retval=0x0, file_count=3)
    at /usr/local/php-4.3.2/Zend/zend.c:869
#4  0x10007410 in php_execute_script (primary_file=0x5, 
tsrm_ls=0x3027738)
    at /usr/local/php-4.3.2/main/main.c:1671
#5  0x10001ec8 in main (argc=2, argv=0x2ff228c0) at 
/usr/local/php-4.3.2/sapi/cgi/cgi_main.c:1501
#6  0x100001dc in __start ()
I have tried all combinations of ZTS=0 ZEND_DEBUG =0
                                             ZTS=0 ZEND_DEBUG =1
                                             ZTS=1 ZEND_DEBUG =0
                                             ZTS=1 ZEND_DEBUG =1
for compiling php as well as my extension module. All give the same 
result :-(
Has anyone encountered this on a AIX machine.
If not atleast has anyone successfully tested a PHP extension module on 
a AIX machine.I urgently need some Help.

I have followed the following steps to create the extension module:
1. ran the ext_skel command i.e. ext_skel --extname=rot13 --proto=rot13.def
2. with rot13 as current folder I ran phpize for creating a self contained extension.
3. /usr/local/php-4.3.2/ext/rot13> ./configure
4. /usr/local/php-4.3.2/ext/rot13> make
5. /usr/local/php-4.3.2/ext/rot13> make install
6. librot13.a is generated.
7. when I do a ldd ./librot13.a i get error as 
     `exec()`: 0509-036 Cannot load program ./librot13.a.  because of the following errors:
        0509-022 Cannot load module ./librot13.a.
        0509-103   The module has an invalid magic number.
8. so I used the library rot13.so.0  and got the core dump at zend_parse_parameters.
     It seems my extension is not getting the reference to zend_parse_parameters function in php.The same thing runs withou any problem on  Linux as well as Windows.
 
Thanks & Regards
Ashish Borkar




---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

---

## #4491 — Melvyn Sopacua — 2003-09-15T15:31:08+00:00

URL: https://externals.io/message/4489#4491 · In reply to: #4489

> 1. ran the ext_skel command i.e. ext_skel --extname=rot13 --proto=rot13.def
> 2. with rot13 as current folder I ran phpize for creating a self contained
> extension. 3. /usr/local/php-4.3.2/ext/rot13> ./configure
> 4. /usr/local/php-4.3.2/ext/rot13> make
> 5. /usr/local/php-4.3.2/ext/rot13> make install
> 6. librot13.a is generated.
> 7. when I do a ldd ./librot13.a i get error as
>      `exec()`: 0509-036 Cannot load program ./librot13.a.  because of the
> following errors: 0509-022 Cannot load module ./librot13.a.
>         0509-103   The module has an invalid magic number.
> 8. so I used the library rot13.so.0  and got the core dump at
> zend_parse_parameters. It seems my extension is not getting the reference
> to zend_parse_parameters function in php.The same thing runs withou any
> problem on  Linux as well as Windows.

What's the output of:
dump -h rot13.so.0

Does it work, when using the 'non-phpize' approach - ie: compile the extension 
into php itself. See README.EXT_SKEL for details.

--
Melvyn
