process using .so files created with different file format

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default process using .so files created with different file format

    A process uses some shared libraries(.so files). We are suspecting
    stack corruption problem as a value returned from one particular
    function to its caller is found to be different.The return value is
    printed once inside the function body, just before the 'return'
    statement and immediately again after the function call.


    Though there can be many reasons for this problem, we are suspecting
    on
    the file format of the files with which the .so file were created.
    When we opened the file, vim shows that, some of the files that are
    required tp
    create a .so are in 'DOS' format. But, we are compiling in an
    Unix(Solaris) machine using SUN C++ compiler. The process also runs on
    Solaris only.Can that cause any problems(may not be 'stack
    corruption', but something else)?
    qazmlp Guest

  2. Similar Questions and Discussions

    1. Getting Bookmarks to Appear in PDF file created from multiple files
      Hi all, I'd toast anyone's health who could solve this !! When I turn an individual doc file into a PDF by opening the doc file in Word then...
    2. PDF file format is having difficulties when saving Illustrator 10 files
      We had this problem with OSX 10.2 and 10.3 in combination with Illustrator 10. In our document there were Cyrillic fonts used, when we removed these...
    3. Illustrator 10 saving over .ai files as PDF format file
      HI I am experiencing a very similar problem, which no-one has an answer to. I have upgraded to the latest version but it still happens. I edit an...
    4. How to navigate inside a projector file that created with mult dir files
      Hi, I created a projector file with combination of two director files. I use "go to frame of moive" lingo but fail. I put both dcr files to the...
    5. file permissions on files created with lotofile
      when using lotofile the files created (on linux) get permissions 600 owned by informix:informix. this prohibits scenarios where for example a web...
  3. #2

    Default process using .so files created with different file format

    A process uses some shared libraries(.so files). We are suspecting
    stack corruption problem as a value returned from one particular
    function to its caller is found to be different.The return value is
    printed once inside the function body, just before the 'return'
    statement and immediately again after the function call.


    Though there can be many reasons for this problem, we are suspecting
    on
    the file format of the files with which the .so file were created.
    When we opened the file, vim shows that, some of the files that are
    required tp
    create a .so are in 'DOS' format. But, we are compiling in an
    Unix(Solaris) machine using SUN C++ compiler. The process also runs on
    Solaris only.Can that cause any problems(may not be 'stack
    corruption', but something else)?
    qazmlp Guest

  4. #3

    Default Re: process using .so files created with different file format

    qazmlp wrote:
    > A process uses some shared libraries(.so files). We are suspecting
    > stack corruption problem as a value returned from one particular
    > function to its caller is found to be different.The return value is
    > printed once inside the function body, just before the 'return'
    > statement and immediately again after the function call.
    That's the definition of stack corruption, isn't it?
    > Though there can be many reasons for this problem, we are suspecting
    > on
    > the file format of the files with which the .so file were created.
    > When we opened the file, vim shows that, some of the files that are
    > required tp
    > create a .so are in 'DOS' format.
    COFF isn't a DOS format but a standardized linker format. Are the libraries
    binary only third party products (and if so, what should they do)?
    > But, we are compiling in an
    > Unix(Solaris) machine using SUN C++ compiler. The process also runs on
    > Solaris only.Can that cause any problems(may not be 'stack
    > corruption', but something else)?
    If the loader can load the library this shouldn't be the problem. (According
    to the documentation to the GNU binutils the ld.so of SUN had a bug, but
    let's hope it isn't _as_ buggy:-)
    You amy have used different or dangerous compiler options (like
    optimization, never use a '-O') while compiling Your modules.
    --
    Best Regards
    Sven
    Sven Gohlke Guest

  5. #4

    Default Re: process using .so files created with different file format

    qazmlp wrote:
    > A process uses some shared libraries(.so files). We are suspecting
    > stack corruption problem as a value returned from one particular
    > function to its caller is found to be different.The return value is
    > printed once inside the function body, just before the 'return'
    > statement and immediately again after the function call.
    That's the definition of stack corruption, isn't it?
    > Though there can be many reasons for this problem, we are suspecting
    > on
    > the file format of the files with which the .so file were created.
    > When we opened the file, vim shows that, some of the files that are
    > required tp
    > create a .so are in 'DOS' format.
    COFF isn't a DOS format but a standardized linker format. Are the libraries
    binary only third party products (and if so, what should they do)?
    > But, we are compiling in an
    > Unix(Solaris) machine using SUN C++ compiler. The process also runs on
    > Solaris only.Can that cause any problems(may not be 'stack
    > corruption', but something else)?
    If the loader can load the library this shouldn't be the problem. (According
    to the documentation to the GNU binutils the ld.so of SUN had a bug, but
    let's hope it isn't _as_ buggy:-)
    You amy have used different or dangerous compiler options (like
    optimization, never use a '-O') while compiling Your modules.
    --
    Best Regards
    Sven
    Sven Gohlke Guest

  6. #5

    Default Re: process using .so files created with different file format

    Sven Gohlke <sven@clio.in-berlin.de> wrote in message news:<2397021.Tnpv1LEklG@clio.in-berlin.de>...
    > qazmlp wrote:
    >
    > > A process uses some shared libraries(.so files). We are suspecting
    > > stack corruption problem as a value returned from one particular
    > > function to its caller is found to be different.The return value is
    > > printed once inside the function body, just before the 'return'
    > > statement and immediately again after the function call.
    >
    > That's the definition of stack corruption, isn't it?
    >
    > > Though there can be many reasons for this problem, we are suspecting
    > > on
    > > the file format of the files with which the .so file were created.
    > > When we opened the file, vim shows that, some of the files that are
    > > required tp
    > > create a .so are in 'DOS' format.
    >
    > COFF isn't a DOS format but a standardized linker format. Are the libraries
    > binary only third party products (and if so, what should they do)?
    >
    > > But, we are compiling in an
    > > Unix(Solaris) machine using SUN C++ compiler. The process also runs on
    > > Solaris only.Can that cause any problems(may not be 'stack
    > > corruption', but something else)?
    >
    > If the loader can load the library this shouldn't be the problem. (According
    > to the documentation to the GNU binutils the ld.so of SUN had a bug, but
    > let's hope it isn't _as_ buggy:-)
    > You amy have used different or dangerous compiler options (like
    > optimization, never use a '-O') while compiling Your modules.
    That is the key here...I used '-O' flag. I have been using it for a
    quite long time. Can you point out any bug in using that flag and the
    possibilities of that being the cause of the problem that I am facing.

    Thanks!
    qazmlp Guest

  7. #6

    Default Re: process using .so files created with different file format

    Sven Gohlke <sven@clio.in-berlin.de> wrote in message news:<2397021.Tnpv1LEklG@clio.in-berlin.de>...
    > qazmlp wrote:
    >
    > > A process uses some shared libraries(.so files). We are suspecting
    > > stack corruption problem as a value returned from one particular
    > > function to its caller is found to be different.The return value is
    > > printed once inside the function body, just before the 'return'
    > > statement and immediately again after the function call.
    >
    > That's the definition of stack corruption, isn't it?
    >
    > > Though there can be many reasons for this problem, we are suspecting
    > > on
    > > the file format of the files with which the .so file were created.
    > > When we opened the file, vim shows that, some of the files that are
    > > required tp
    > > create a .so are in 'DOS' format.
    >
    > COFF isn't a DOS format but a standardized linker format. Are the libraries
    > binary only third party products (and if so, what should they do)?
    >
    > > But, we are compiling in an
    > > Unix(Solaris) machine using SUN C++ compiler. The process also runs on
    > > Solaris only.Can that cause any problems(may not be 'stack
    > > corruption', but something else)?
    >
    > If the loader can load the library this shouldn't be the problem. (According
    > to the documentation to the GNU binutils the ld.so of SUN had a bug, but
    > let's hope it isn't _as_ buggy:-)
    > You amy have used different or dangerous compiler options (like
    > optimization, never use a '-O') while compiling Your modules.
    That is the key here...I used '-O' flag. I have been using it for a
    quite long time. Can you point out any bug in using that flag and the
    possibilities of that being the cause of the problem that I am facing.

    Thanks!
    qazmlp Guest

  8. #7

    Default Re: process using .so files created with different file format

    qazmlp wrote:
    >> You amy have used different or dangerous compiler options (like
    >> optimization, never use a '-O') while compiling Your modules.
    >
    > That is the key here...I used '-O' flag. I have been using it for a
    > quite long time. Can you point out any bug in using that flag and the
    > possibilities of that being the cause of the problem that I am facing.
    A library function may expect the return value in a register while the
    caller returns it on the stack. Usual You get this problem only if You
    compile parts with the optimizer and parts without.

    There is a reason why You often read: "Never use the -O flag" (except,
    maybe, the compiler is the GCC where even '-O2' works astonishingly
    stable:-)
    --
    Best Regards
    Sven
    Sven Gohlke Guest

  9. #8

    Default Re: process using .so files created with different file format

    qazmlp wrote:
    >> You amy have used different or dangerous compiler options (like
    >> optimization, never use a '-O') while compiling Your modules.
    >
    > That is the key here...I used '-O' flag. I have been using it for a
    > quite long time. Can you point out any bug in using that flag and the
    > possibilities of that being the cause of the problem that I am facing.
    A library function may expect the return value in a register while the
    caller returns it on the stack. Usual You get this problem only if You
    compile parts with the optimizer and parts without.

    There is a reason why You often read: "Never use the -O flag" (except,
    maybe, the compiler is the GCC where even '-O2' works astonishingly
    stable:-)
    --
    Best Regards
    Sven
    Sven Gohlke Guest

  10. #9

    Default Re: process using .so files created with different file format

    Sven Gohlke <sven@clio.in-berlin.de> writes:
    >qazmlp wrote:
    >>> You amy have used different or dangerous compiler options (like
    >>> optimization, never use a '-O') while compiling Your modules.
    >>
    >> That is the key here...I used '-O' flag. I have been using it for a
    >> quite long time. Can you point out any bug in using that flag and the
    >> possibilities of that being the cause of the problem that I am facing.
    >A library function may expect the return value in a register while the
    >caller returns it on the stack. Usual You get this problem only if You
    >compile parts with the optimizer and parts without.
    Nonsense; any compiler which uses a different calling convention
    when specifying any option is broken. PERIOD.

    While there are some options to gcc which allow for different calling
    conventions, the default has been the system's default calling
    convention for some time now.. As long as those options are avoided,
    then nothng can go wrong.

    When differnet calling conventions are used, the compiler
    should generate incompatible objects, such as when using
    compiling in 32 or 64 bit mode.

    Casper
    --
    Expressed in this posting are my opinions. They are in no way related
    to opinions held by my employer, Sun Microsystems.
    Statements on Sun products included here are not gospel and may
    be fiction rather than truth.
    Casper H.S. Dik Guest

Posting Permissions

  • You may not post new threads
  • You may 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