read uninitialized (rui)

Hello,

I currenlty try to clean my code of rui/wui etc...

First thing I am wondering of: is the rui output in the sunstudio debuger always reliable ?

Or could it be theat I some times does not check that a variable has being initialized indirectly ?

currently I receive this complaint :

Read from uninitialized (rui) on thread 1:

Attempting to read 3 bytes at address 0xffbee799

which is 289 bytes above the current stack pointer

Location of error: IBAG_iniparser.cpp, line 0, std::istreambuf_iterator<char,std::char_traits><char> >::istreambuf_iterator()

[code]

typedef std::istreambuf_iterator<char> IsbIt;

.

.

.

class StreamToString

{

IsbIt p;

IsbIt end;

public:

StreamToString(std::istream &is ) : p(is), end(IsbIt()), iss(is)// the rui comes out here. My guess is end(IsbIt()) causes it.

{}

}

The caller passes an ifsream to the overloaded constructor.

since the rui comes out of istreambuf_iterator<char, std::char_traits><char> >::istreambuf_iterator(0xffbee954, 0xffbee794, 0xffbee9e8, 0x78, 0x0, 0x1) i cannot step onto this function.

Any Idea why this could be a rui ?

regards

fagery

[/code]

[1310 byte] By [fagery_codera] at [2007-11-27 2:51:45]
# 1

In general, RUIs can be false positives, as explained in the dbx documentation and dbx help. For example, you can get an RUI when copying padding bytes in a struct:

struct S {

char c;

int i;

};

On sparc, struct S will have 3 uninitialized bytes between members 'c' and 'i'. A struct copy will copy these bytes, leading to a false RUI report. We have been taking steps to reduce the number of false RUIs via additional compiler options.

But reading from above the stack pointer is not a false positive.

In this case, the problem appears to be due to a bug in either the library or in dbx. I was able to duplicate your problem using the latest patched Studio 11, but not with the Studio 12 Early Access compiler. I was not able to locate a specific bug report, however. I'll do some more checking, and let you know if I find an associated bug report.

clamage45a at 2007-7-12 3:25:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
thank you for the respones. I should maybe have mentioned that I use SS11 with the latest paches on Solaris 8 sparc (V240).I cannot upgrade to SS12 because I have to stay with Solaris 8.CheersFagery
fagery_codera at 2007-7-12 3:25:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

I was not able to locate a bug report for this problem, not for the C++ compiler or libraries, not for dbx runtime checking.

If you have a service contract with Sun, please file a bug report on Studio 11 via your support channel.

Otherwise, you can file a bug report at bugs.sun.com.

clamage45a at 2007-7-12 3:25:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...