Professional Web Applications Themes

[PHP-DEV] PHP dumps core loading extension - PHP Development

I hope this is the right place for this type of question. If not, please let me know a more appropriate forum. I have a PHP extension (written in C) that calls a utility library that I wrote in C++. For my testing and debugging, I have been trying to exercise my code using PHP from the command line (‘/usr/bin/php’). For some reason, PHP dumps core (segmentation fault) when I try to use any of my functions. Even if my php script is simply <?php phpinfo(); ?>. At this point, I’m not even calling any of my C++ utility functions, ...

  1. #1

    Default [PHP-DEV] PHP dumps core loading extension

    I hope this is the right place for this type of question. If not, please
    let me know a more appropriate forum.

    I have a PHP extension (written in C) that calls a utility library that I
    wrote in C++. For my testing and debugging, I have been trying to exercise
    my code using PHP from the command line (‘/usr/bin/php’). For some reason,
    PHP dumps core (segmentation fault) when I try to use any of my functions.

    Even if my php script is simply <?php phpinfo(); ?>. At this point, I’m not
    even calling any of my C++ utility functions, PHP_MINIT_FUNCTION(myext) and
    PHP_RINIT_FUNCTION(myext) are essentially no-ops, and
    PHP_MINFO_FUNCTION(myext) has only constant asciiz strings. My phpinfo()
    still dumps core.

    To load my utility library, I have a config.m4 line:

    PHP_EVAL_LIBLINE("-L/bjb/lib -lbjbutility")

    When I comment out the ‘PHP_EVAL_LIBLINE’, the phpinfo() functions works OK.

    I have used the C++ utility library for several years, outside of the
    context of PHP with no problems, even when calling from a C mainline.

    Has anyone seen this before?
    Any suggestions as to what might be strategy for debugging this?
    Where else can I look for information that might be useful?

    Thanks in advance,

    Bruce

    Environment information:

    Php 4.3.1
    Configure Command => './configure' '--target=' '--prefix=/bjb'
    '--with-apxs=/bjb/home/www_serv/bin/apxs' '--with-gd' '--with-zlib'
    '--with-zlib-dir=/home/jeb/target/bjb' '--with-jpeg'
    '--with-jpeg-dir=/home/jeb/target/bjb' '--with-png'
    '--with-png-dir=/home/jeb/target/bjb' '--with-freetype'
    '--with-freetype-dir=/home/jeb/target/bjb'
    '--with-pdflib=/home/jeb/target/bjb' '--with-enable-dba' '--with-cdb'
    '--with-dbm'

    DEC Tru64
    cxx -V
    DIGITAL C++ V6.1-027 on DIGITAL UNIX V4.0 (Rev. 1229)

    __________________________________________________ _______________
    The new MSN 8: advanced junk mail protection and 2 months FREE*
    [url]http://join.msn.com/?page=features/junkmail[/url]


    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]

    Bruce Bailey Guest

  2. #2

    Default Re: [PHP-DEV] PHP dumps core loading extension

    A backtrace would be useful.


    On Friday, July 25, 2003, at 01:55 PM, Bruce Bailey wrote:
    > I hope this is the right place for this type of question. If not,
    > please let me know a more appropriate forum.

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]

    George Schlossnagle Guest

  3. #3

    Default Fwd: [PHP-DEV] PHP dumps core loading extension

    I should have thought of including a backtrace before:

    (gdb) bt
    #0 0x0000030002891c30 in ?? ()
    #1 0x000003ff800dd7d0 in exit () from /usr/shlib/libc.so
    #2 0x000003ff800dd7d0 in exit () from /usr/shlib/libc.so
    Cannot access memory at address 0x20
    (gdb)


    >From: "Bruce Bailey" <bruce1828hotmail.com>
    >To: [email]internalslists.php.net[/email]
    >Subject: [PHP-DEV] PHP dumps core loading extension
    >Date: Fri, 25 Jul 2003 10:55:50 -0700
    >
    >I hope this is the right place for this type of question. If not, please
    >let me know a more appropriate forum.
    >
    >I have a PHP extension (written in C) that calls a utility library that I
    >wrote in C++. For my testing and debugging, I have been trying to exercise
    >my code using PHP from the command line (‘/usr/bin/php’). For some reason,
    >PHP dumps core (segmentation fault) when I try to use any of my functions.
    >
    >Even if my php script is simply <?php phpinfo(); ?>. At this point, I’m
    >not even calling any of my C++ utility functions, PHP_MINIT_FUNCTION(myext)
    >and PHP_RINIT_FUNCTION(myext) are essentially no-ops, and
    >PHP_MINFO_FUNCTION(myext) has only constant asciiz strings. My phpinfo()
    >still dumps core.
    >
    >To load my utility library, I have a config.m4 line:
    >
    >PHP_EVAL_LIBLINE("-L/bjb/lib -lbjbutility")
    >
    >When I comment out the ‘PHP_EVAL_LIBLINE’, the phpinfo() functions works
    >OK.
    >
    >I have used the C++ utility library for several years, outside of the
    >context of PHP with no problems, even when calling from a C mainline.
    >
    >Has anyone seen this before?
    >Any suggestions as to what might be strategy for debugging this?
    >Where else can I look for information that might be useful?
    >
    >Thanks in advance,
    >
    >Bruce
    >
    >Environment information:
    >
    >Php 4.3.1
    >Configure Command => './configure' '--target=' '--prefix=/bjb'
    >'--with-apxs=/bjb/home/www_serv/bin/apxs' '--with-gd' '--with-zlib'
    >'--with-zlib-dir=/home/jeb/target/bjb' '--with-jpeg'
    >'--with-jpeg-dir=/home/jeb/target/bjb' '--with-png'
    >'--with-png-dir=/home/jeb/target/bjb' '--with-freetype'
    >'--with-freetype-dir=/home/jeb/target/bjb'
    >'--with-pdflib=/home/jeb/target/bjb' '--with-enable-dba' '--with-cdb'
    >'--with-dbm'
    >
    >DEC Tru64
    >cxx -V
    >DIGITAL C++ V6.1-027 on DIGITAL UNIX V4.0 (Rev. 1229)
    >
    >_________________________________________________ ________________
    >The new MSN 8: advanced junk mail protection and 2 months FREE*
    >http://join.msn.com/?page=features/junkmail
    >
    >
    >--
    >PHP Internals - PHP Runtime Development Mailing List
    >To unsubscribe, visit: http://www.php.net/unsub.php
    >
    __________________________________________________ _______________
    MSN 8 with e-mail virus protection service: 2 months FREE*
    http://join.msn.com/?page=features/virus


    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php

    Bruce Bailey Guest

Similar Threads

  1. [PHP-DEV] PHP dumps core loading extension - problem solved.
    By Bruce Bailey in forum PHP Development
    Replies: 0
    Last Post: July 29th, 04:59 PM
  2. [PHP-DEV] PHP dumps core loading extension - more information
    By Bruce Bailey in forum PHP Development
    Replies: 0
    Last Post: July 25th, 10:33 PM
  3. gui smit core dumps only for certain users
    By Michelle DeVault in forum AIX
    Replies: 0
    Last Post: July 18th, 07:43 PM
  4. Replies: 6
    Last Post: June 25th, 08:49 PM
  5. Replies: 0
    Last Post: June 24th, 06:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139