Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-856

[Sun C++] data corruption in rw_printf() with "%{$VAR!:@}", "%A{*c}", and "%{@}"

Add voteWatch issue
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 4.2.0
    • 4.2.2
    • Test Driver
    • None
    • Sun C++ 5.9/Solaris 10/AMD64

    • Runtime Error

    Description

      When compiled with Sun C++ (both 5.9 and 5.8) in 15S build mode the program below exits with SIGABRT. It runs fine when compiled with HP aCC 3.73 or gcc 4.1.1 on Linux/x86_64 (both in wide mode). I suspect it might have something to do with STDCXX-828.

      $ cat t.cpp && gmake t && ./t
      #include <cassert>
      #include <cstring>
      #include <rw_printf.h>
      
      int main ()
      {
          char buf [80];
          rw_sprintf (buf, "%{$FUNCALL!:@}",
                      "%{*Ac} %s %{@}",
                      1, " ", "foo", "%Lg", 9.0L);
      
          rw_printf ("%{$FUNCALL}\n");
      
          assert (0 == std::strcmp (buf, "\" \" foo 9"));
      }
      CC -c -D_RWSTDDEBUG   -mt -I/amd/devco/sebor/stdcxx/include -I/build/sebor/stdcxx-suncc-5.8-j13-15S/include -I/amd/devco/sebor/stdcxx/tests/include  -library=%none -g  -xarch=amd64 +w -errtags -erroff=hidef   t.cpp
      CC t.o -o t -L/build/sebor/stdcxx-suncc-5.8-j13-15S/rwtest -lrwtest15S -library=%none  -mt  -xarch=amd64 -L/build/sebor/stdcxx-suncc-5.8-j13-15S/lib  -lstd15S  -lm 
      " " foo 1.69951e-4944
      Assertion failed: 0 == std::strcmp (buf, "\" \" foo 9"), file t.cpp, line 14
      Abort (core dumped)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebor Martin Sebor

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h Original Estimate - 2h
                  2h
                  Remaining:
                  Time Spent - 4h Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - 4h Remaining Estimate - 2h
                  4h

                  Slack

                    Issue deployment