Latest updates to Run-Time Checking dbx feature.
By Maxim Kartashev on июн 29, 2006
Run-Time Checking (RTC) feature of dbx, the Sun Studio debugger, seem to attract much attention. So I thought it is worth mentioning two important RTC-related bugfixes made in latest dbx patch.
String FunctionsOne problem can be seen by virtually everyone using RTC on Solaris 10. If your program uses libc.so string functions, such as
strchr(), for example, dbx reports "read from unallocated" like this:
Read from unallocated (rua):
Attempting to read 1 byte at address 0x24f6b
which is just past heap block of size 19 bytes at 0x24f58
This block was allocated from:
 _strdup() at 0xebd60fa0
 main() at line 9 in "strdup-test.c"
Location of error:
=> strchr(0x24f68, 0x2c2c2c2c, 0x545e0144, 0x80808080, 0x1010101, 0x80808080), at 0xebd2e34c
 main(argc = 1, argv = 0xffbff824), line 11 in "strdup-test.c"
What is happening is that
strchr(), as well as other string functions, have been optimized to work with whole words at a time which sometimes doesn't end on an even boundary and thus can overrun some memories by a small amount. See strchr implementation for an example. Dbx was made aware of that and does not report rua errors any more, but only if they are related to usage of the above algorithms. True errors are not hidden.
RTC error suppressionSecond important fix is related to suppress command, which is handy when you need to focus on one RTC error and set aside the others. Under certain circumstances (when target loadobject was instrumented with traps), it didn't actually suppress anything and dbx output was flooded with RTC error reports, making it hard to debug the application.
With this patch, the error is gone and suppress should work as expected.