|
Description
|
dbx bug 6225579 describes how when an application runs under dbx
on S10 (but not older S's) it hangs in a cond_wait() and/or the
cond_wait returns bogus data.
The symptoms vanish if mutex tracking is turned off via
(dbx) dbxenv mt_sync_tracking off
which corresponds to thread db's td_ta_sync_tracking_enable().
xxxxx@xxxxx.com 2005-2-05 00:27:33 GMT
From the evaluation:
When [sync tracking is enabled], the inline function gethrtime()
is called. gethrtime() is not called unless sync tracking is enabled.
The gethrtime() function is an inline function, declared to be:
extern hrtime_t gethrtime(void);
where 'hrtime_t' is uint64_t. gethrtime() is defined in the sparcv9.il file:
.inline gethrtime, 0
ta 0x24
sllx %o0, 32, %o0
or %o1, %o0, %o0
.end
When the compiler gets through with it, the disassembled code is:
cond_wait_common+0x2f0: 9f2a3020 sllx %o0, 32, %o7
cond_wait_common+0x2f4: 91d02024 ta %icc, %g0 + 36
cond_wait_common+0x2f8: 9a12400f or %o1, %o7, %o5
The compiler reordered the instructions!
Adding .volatile ... .nonvolatile around the body of gethrtime fixed it.
|