libCrun symbol "zero_ints" - Solaris

This is a discussion on libCrun symbol "zero_ints" - Solaris ; Hello, I also posted this question to comp.unix.solaris. Does anybody know what the function "zero_ints", which is found in the Sun C++ Compiler runtime library libCrun.so.1, does? I need to know the answer for a problem I'm having with a ...

+ Reply to Thread
Results 1 to 17 of 17

Thread: libCrun symbol "zero_ints"

  1. libCrun symbol "zero_ints"

    Hello,

    I also posted this question to comp.unix.solaris. Does anybody know
    what the function "zero_ints", which is found in the Sun C++ Compiler
    runtime library libCrun.so.1, does? I need to know the answer for a
    problem I'm having with a Solaris 2.6 core dump (C++ application).

    Thanks


  2. Re: libCrun symbol "zero_ints"

    clarkbt36@optonline.net wrote:
    > Hello,
    >
    > I also posted this question to comp.unix.solaris. Does anybody know
    > what the function "zero_ints", which is found in the Sun C++ Compiler
    > runtime library libCrun.so.1, does? I need to know the answer for a
    > problem I'm having with a Solaris 2.6 core dump (C++ application).
    >


    Well, from reading many language specifications, it infers that this
    function initializes integers variables to zero. Some languages do not
    intialize variables and I've found in the past that one has to do all
    your own initializations in your program.

  3. Re: libCrun symbol "zero_ints"

    On Feb 23, 11:10 pm, Maverick wrote:
    > clarkb...@optonline.net wrote:
    > > Hello,

    >
    > > I also posted this question to comp.unix.solaris. Does anybody know
    > > what the function "zero_ints", which is found in the Sun C++ Compiler
    > > runtime library libCrun.so.1, does? I need to know the answer for a
    > > problem I'm having with a Solaris 2.6 core dump (C++ application).

    >
    > Well, from reading many language specifications, it infers that this
    > function initializes integers variables to zero. Some languages do not
    > intialize variables and I've found in the past that one has to do all
    > your own initializations in your program.


    I know this answer seems kind of obvious, but then why would this
    function be in the C++ runtime library, instead of the C runtime
    library. And why would it exist anyway, since both C++ and C typically
    allow (and require) programmers to initialize their variables
    themselves? It's very confusing.

    Thanks


  4. Re: libCrun symbol "zero_ints"

    clarkbt36@optonline.net wrote:
    > On Feb 23, 11:10 pm, Maverick wrote:
    >
    >>clarkb...@optonline.net wrote:
    >>
    >>>Hello,

    >>
    >>>I also posted this question to comp.unix.solaris. Does anybody know
    >>>what the function "zero_ints", which is found in the Sun C++ Compiler
    >>>runtime library libCrun.so.1, does? I need to know the answer for a
    >>>problem I'm having with a Solaris 2.6 core dump (C++ application).

    >>
    >>Well, from reading many language specifications, it infers that this
    >>function initializes integers variables to zero. Some languages do not
    >>intialize variables and I've found in the past that one has to do all
    >>your own initializations in your program.

    >
    >
    > I know this answer seems kind of obvious, but then why would this
    > function be in the C++ runtime library, instead of the C runtime
    > library. And why would it exist anyway, since both C++ and C typically
    > allow (and require) programmers to initialize their variables
    > themselves? It's very confusing.


    That answer may very well be in Soustrups book on C++.
    It is obviously post C era improvements and it appears to have to do
    with possibly the object oriented aspect of the language.
    I know you can initialize your own variables to some value other than
    zero, the language does initialize integers to 0, floats to 0.0, etc.
    It just helps alleviate some of the obvious and tedious tasks of
    intializing everything you have. I know that in other languages like
    the earlier fortrans, you had to initialize all of your variables to
    some value, whereas later versions did not.

  5. Re: libCrun symbol "zero_ints"

    On Sat, 24 Feb 2007 16:59:23 -0700, Maverick wrote:
    > clarkbt36@optonline.net wrote:


    > That answer may very well be in Soustrups book on C++.
    > It is obviously post C era improvements and it appears to have to do
    > with possibly the object oriented aspect of the language.
    > I know you can initialize your own variables to some value other than
    > zero, the language does initialize integers to 0, floats to 0.0, etc.
    > It just helps alleviate some of the obvious and tedious tasks of
    > intializing everything you have. I know that in other languages like
    > the earlier fortrans, you had to initialize all of your variables to
    > some value, whereas later versions did not.


    This is wrong.

    Global and static data that is not initialized is normally put in the
    BSS section. This is flagged with just the size in the object code of
    the library/application. When the app starts, that amount of memory is
    allocated and initialized to 0. Note that it is not guaranteed that all
    0 bytes corresponds to float 0.0f or double 0,0.

    Other data that is not initialized is just that - not initialized. It
    can contain any junk.

    See section 3.4.2 of the C++ standard. I'm pretty certain that the same
    applies to C as well.

    A bientot
    Paul


  6. Re: libCrun symbol "zero_ints"

    Paul Floyd wrote:
    > On Sat, 24 Feb 2007 16:59:23 -0700, Maverick wrote:
    >
    >>clarkbt36@optonline.net wrote:

    >
    >
    >>That answer may very well be in Soustrups book on C++.
    >>It is obviously post C era improvements and it appears to have to do
    >>with possibly the object oriented aspect of the language.
    >>I know you can initialize your own variables to some value other than
    >>zero, the language does initialize integers to 0, floats to 0.0, etc.
    >>It just helps alleviate some of the obvious and tedious tasks of
    >>intializing everything you have. I know that in other languages like
    >>the earlier fortrans, you had to initialize all of your variables to
    >>some value, whereas later versions did not.

    >
    >
    > This is wrong.
    >
    > Global and static data that is not initialized is normally put in the
    > BSS section. This is flagged with just the size in the object code of
    > the library/application. When the app starts, that amount of memory is
    > allocated and initialized to 0. Note that it is not guaranteed that all
    > 0 bytes corresponds to float 0.0f or double 0,0.
    >
    > Other data that is not initialized is just that - not initialized. It
    > can contain any junk.
    >
    > See section 3.4.2 of the C++ standard. I'm pretty certain that the same
    > applies to C as well.


    It is supposed to work that way, but from experience I found that it
    isn't so. It all depends on which compiler you have. Now if he is
    using the Sun compilers, that may very well be the case. In other
    languages, I've run into a similar run time routine that does initialize
    all variables to their respective default states. In some compilers no
    initializations are done and is left to the programmer to initialize
    variables. In object contructors, from what I've seen, all member
    variables have a default value assigned.

    Maybe the OP can tell us which compiler he is using, as he didn't say.
    Of course he could compile to object only and then disassemble and see
    what the zero_ints is doing or not doing.

  7. Re: libCrun symbol "zero_ints"

    On Feb 25, 6:53 pm, Maverick wrote:

    > Maybe the OP can tell us which compiler he is using, as he didn't say.
    > Of course he could compile to object only and then disassemble and see
    > what the zero_ints is doing or not doing.- Hide quoted text -


    I'm using Sun's Forte 6 update 2 C++ compiler. I'm ashamed to say that
    here very clearly I see the bad effects of my multi-posting of my
    original
    question to both comp.unix.solaris and this newsgroup. I was
    criticized for
    doing just that in comp.unix.solaris instead of cross-posting, and I'm
    sure you
    guys are going to be just as angry with me here as they were with me
    in
    comp.unix.solaris. Forgive me, I'm a total newbie to Usenet, and I
    didn't understand
    these things until someone brought them up.

    To quote from my most recent post to this question's thread in
    comp.unix.solaris:
    Quote:
    "Thanks for all your help. The problem is doing what you suggest is
    not
    much of a help.
    The bug we're trying to diagnose or figure out only happens very
    rarely. Unfortunately,
    the software runs unattended for months and causes our company nasty
    downtime when
    it manifests itself.
    I sort of apologize for asking my original question on this forum. I
    am (as I have said) a newbie
    to Usenet and I figured I would post my question to comp.unix.solaris
    since it was sort-of related to
    Solaris usage. I have since seen that this forum is more concerned
    with OS-related questions. Perhaps
    I posted in the wrong forum.

    In order to get more information, I joined Sun's Solaris Developer
    Network yesterday and posted my
    question in the C++ Development Environments forum there (clearly
    more
    specific to my kind of question).
    I got this responese from Steve Clamage (Sun C/C++ development
    environment guru):
    "The zero_ints function sets to zero a region of memory that is known
    to be aligned on an int boundary (4-byte alignment on sparc). Similar
    functions, zero_bytes and zero_ptrs, are for regions with unknown
    alignment and pointer alignment (8 bytes for sparc/v9), respectively.


    Calls to these functions are generated by the compiler usually for
    default initialization of POD objects and arrays of POD obects."


    So I have an answer. I don't know whether this will be of any
    interest
    to anyone here. Steve Clamage's answer does help
    me though. Once again, I apologize for what may well have been an
    inappropriate post to this group"

    So I'm sorry for multi-posting instead of cross-posting. I realize now
    what a terrible inconvenience it is to members of both groups. I
    really
    appreciate everyone's answers and help.



  8. Re: libCrun symbol "zero_ints"

    clarkbt36@gmail.com wrote:
    > On Feb 25, 6:53 pm, Maverick wrote:
    >
    >
    >>Maybe the OP can tell us which compiler he is using, as he didn't say.
    >>Of course he could compile to object only and then disassemble and see
    >>what the zero_ints is doing or not doing.- Hide quoted text -

    >
    >
    > I'm using Sun's Forte 6 update 2 C++ compiler.


    Is there a reason why you use that very old compiler?

    --
    Ian Collins.

  9. Re: libCrun symbol "zero_ints"

    On Feb 25, 7:30 pm, Ian Collins wrote:
    > Is there a reason why you use that very old compiler?


    I'm not absolutely certain, but I believe my company is cash-strapped,
    and so we haven't changed from the one we got several years ago. It
    seems to work fairly well for us though.


  10. Re: libCrun symbol "zero_ints"

    clarkbt36@gmail.com wrote:
    > On Feb 25, 7:30 pm, Ian Collins wrote:
    >
    >>Is there a reason why you use that very old compiler?

    >
    >
    > I'm not absolutely certain, but I believe my company is cash-strapped,
    > and so we haven't changed from the one we got several years ago. It
    > seems to work fairly well for us though.
    >

    The latest and greatest (studio 11) is free!

    --
    Ian Collins.

  11. Re: libCrun symbol "zero_ints"

    clarkbt36@gmail.com wrote:
    > I'm using Sun's Forte 6 update 2 C++ compiler. I'm ashamed to say that
    > here very clearly I see the bad effects of my multi-posting of my
    > original


    If you see and understand, that actually puts you ahead of 99.5% of Usenet
    users.

    --
    Brandon Hume - hume -> BOFH.Ca, http://WWW.BOFH.Ca/

  12. Re: libCrun symbol "zero_ints"

    clarkbt36@gmail.com wrote:

    > On Feb 25, 6:53 pm, Maverick wrote:
    >
    >
    >>Maybe the OP can tell us which compiler he is using, as he didn't say.
    >>Of course he could compile to object only and then disassemble and see
    >>what the zero_ints is doing or not doing.- Hide quoted text -

    >
    >
    > I'm using Sun's Forte 6 update 2 C++ compiler. I'm ashamed to say that
    > here very clearly I see the bad effects of my multi-posting of my
    > original
    > question to both comp.unix.solaris and this newsgroup.


    That is ok. I've read your other posts over there. What it really
    means is that it is Sparc specific.

    > I was
    > criticized for
    > doing just that in comp.unix.solaris instead of cross-posting, and I'm
    > sure you
    > guys are going to be just as angry with me here as they were with me
    > in
    > comp.unix.solaris. Forgive me, I'm a total newbie to Usenet, and I
    > didn't understand
    > these things until someone brought them up.


    Not a problem by me. I did notice that no one was answering up, and it
    should be I that should apologize for my unorthodox means of generating
    an answer by others. I've seen a lot of technical questions go by
    unanswered and I think that the original poster may get a bit frustrated
    when no one answers. It was just my means of trying to get things
    moving a bit... I guessed at the obvious first... and I wasn't too far
    off the mark.

    >
    > To quote from my most recent post to this question's thread in
    > comp.unix.solaris:
    > Quote:
    > "Thanks for all your help. The problem is doing what you suggest is
    > not
    > much of a help.
    > The bug we're trying to diagnose or figure out only happens very
    > rarely. Unfortunately,
    > the software runs unattended for months and causes our company nasty
    > downtime when
    > it manifests itself.
    > I sort of apologize for asking my original question on this forum. I
    > am (as I have said) a newbie
    > to Usenet and I figured I would post my question to comp.unix.solaris
    > since it was sort-of related to
    > Solaris usage. I have since seen that this forum is more concerned
    > with OS-related questions. Perhaps
    > I posted in the wrong forum.
    >
    > In order to get more information, I joined Sun's Solaris Developer
    > Network yesterday and posted my
    > question in the C++ Development Environments forum there (clearly
    > more
    > specific to my kind of question).
    > I got this responese from Steve Clamage (Sun C/C++ development
    > environment guru):
    > "The zero_ints function sets to zero a region of memory that is known
    > to be aligned on an int boundary (4-byte alignment on sparc). Similar
    > functions, zero_bytes and zero_ptrs, are for regions with unknown
    > alignment and pointer alignment (8 bytes for sparc/v9), respectively.
    >
    >
    > Calls to these functions are generated by the compiler usually for
    > default initialization of POD objects and arrays of POD obects."
    >
    >
    > So I have an answer. I don't know whether this will be of any
    > interest
    > to anyone here.


    Not really, but it always gets one curious as to what it was anyways.
    At least you did get an appropriate answer. In the older days of
    compilers, the documentation usually does cover the C run time startup
    code that is compiled into code. I don't see that nowadays.

  13. Re: libCrun symbol "zero_ints"

    On Sun, 25 Feb 2007 16:53:45 -0700, Maverick wrote:
    >
    > It is supposed to work that way, but from experience I found that it
    > isn't so. It all depends on which compiler you have. Now if he is
    > using the Sun compilers, that may very well be the case. In other
    > languages, I've run into a similar run time routine that does initialize
    > all variables to their respective default states. In some compilers no
    > initializations are done and is left to the programmer to initialize
    > variables. In object contructors, from what I've seen, all member
    > variables have a default value assigned.
    >
    > Maybe the OP can tell us which compiler he is using, as he didn't say.
    > Of course he could compile to object only and then disassemble and see
    > what the zero_ints is doing or not doing.


    The subject is about libCrun, the Sun C++ runtime library.The subject is
    about libCrun, the Sun C++ runtime library.

    A bientot
    Paul


  14. Re: libCrun symbol "zero_ints"

    On Mon, 26 Feb 2007 10:46:44 -0700, Maverick wrote:
    > clarkbt36@gmail.com wrote:
    >> I'm using Sun's Forte 6 update 2 C++ compiler. I'm ashamed to say that
    >> here very clearly I see the bad effects of my multi-posting of my
    >> original
    >> question to both comp.unix.solaris and this newsgroup.

    >
    > That is ok. I've read your other posts over there. What it really
    > means is that it is Sparc specific.


    What are you talking about?? Other than Studio 7 (when Sun suspended x86
    support), all the compilers back to Forte 6.0 have been available on
    both SPARC and x86. And probably further (I worked on a product with a
    Solaris x86 port back in '98, which would have been WorkShop 4 or 5).

    [snip]

    > Not really, but it always gets one curious as to what it was anyways.
    > At least you did get an appropriate answer. In the older days of
    > compilers, the documentation usually does cover the C run time startup
    > code that is compiled into code. I don't see that nowadays.


    Of course, C++ startup code is significantly more complex than C startup
    code.

    A bientot
    Paul


  15. Re: libCrun symbol "zero_ints"

    Paul Floyd wrote:
    > On Mon, 26 Feb 2007 10:46:44 -0700, Maverick wrote:
    >
    >>clarkbt36@gmail.com wrote:
    >>
    >>>I'm using Sun's Forte 6 update 2 C++ compiler. I'm ashamed to say that
    >>>here very clearly I see the bad effects of my multi-posting of my
    >>>original
    >>>question to both comp.unix.solaris and this newsgroup.

    >>
    >>That is ok. I've read your other posts over there. What it really
    >>means is that it is Sparc specific.

    >
    >
    > What are you talking about?? Other than Studio 7 (when Sun suspended x86
    > support), all the compilers back to Forte 6.0 have been available on
    > both SPARC and x86. And probably further (I worked on a product with a
    > Solaris x86 port back in '98, which would have been WorkShop 4 or 5).
    >


    I mean by Sparc specific is 'zero_ints'. Do you know of another
    compiler that has this?

    >
    >
    >>Not really, but it always gets one curious as to what it was anyways.
    >>At least you did get an appropriate answer. In the older days of
    >>compilers, the documentation usually does cover the C run time startup
    >>code that is compiled into code. I don't see that nowadays.

    >
    >
    > Of course, C++ startup code is significantly more complex than C startup
    > code.
    >


    Of course. With each new generation in languages, things will only get
    more complicated.

  16. Re: libCrun symbol "zero_ints"

    On 2007-02-26 23:13:36 +0000, Maverick said:

    > Paul Floyd wrote:
    >> On Mon, 26 Feb 2007 10:46:44 -0700, Maverick wrote:
    >>
    >>> clarkbt36@gmail.com wrote:
    >>>
    >>>> I'm using Sun's Forte 6 update 2 C++ compiler. I'm ashamed to say that
    >>>> here very clearly I see the bad effects of my multi-posting of my
    >>>> original
    >>>> question to both comp.unix.solaris and this newsgroup.
    >>>
    >>> That is ok. I've read your other posts over there. What it really
    >>> means is that it is Sparc specific.

    >>
    >>
    >> What are you talking about?? Other than Studio 7 (when Sun suspended x86
    >> support), all the compilers back to Forte 6.0 have been available on
    >> both SPARC and x86. And probably further (I worked on a product with a
    >> Solaris x86 port back in '98, which would have been WorkShop 4 or 5).
    >>

    >
    > I mean by Sparc specific is 'zero_ints'. Do you know of another
    > compiler that has this?


    libCrun on x86 has this symbol (and zero_ptrs and zero_bytes), so it is
    Solaris-specific and not SPARC-specifici.

    Cheers,

    Chris


  17. Re: libCrun symbol "zero_ints"

    Chris Ridd wrote:
    > On 2007-02-26 23:13:36 +0000, Maverick said:
    >
    >> Paul Floyd wrote:
    >>
    >>> On Mon, 26 Feb 2007 10:46:44 -0700, Maverick wrote:
    >>>
    >>>> clarkbt36@gmail.com wrote:
    >>>>
    >>>>> I'm using Sun's Forte 6 update 2 C++ compiler. I'm ashamed to say that
    >>>>> here very clearly I see the bad effects of my multi-posting of my
    >>>>> original
    >>>>> question to both comp.unix.solaris and this newsgroup.
    >>>>
    >>>>
    >>>> That is ok. I've read your other posts over there. What it really
    >>>> means is that it is Sparc specific.
    >>>
    >>>
    >>>
    >>> What are you talking about?? Other than Studio 7 (when Sun suspended x86
    >>> support), all the compilers back to Forte 6.0 have been available on
    >>> both SPARC and x86. And probably further (I worked on a product with a
    >>> Solaris x86 port back in '98, which would have been WorkShop 4 or 5).
    >>>

    >>
    >> I mean by Sparc specific is 'zero_ints'. Do you know of another
    >> compiler that has this?

    >
    >
    > libCrun on x86 has this symbol (and zero_ptrs and zero_bytes), so it is
    > Solaris-specific and not SPARC-specifici.


    Hmm... is it also in gnu g++?

+ Reply to Thread