If VG_(unimplemented)() is called early during the main initialization, before the threads are created, Valgrind dumps core in show_sched_status_wrk(). That's because VG_(threads) is still NULL and it is dereferenced via VG_(threads)[i].os_state... This happens for example on Solaris when VG_(unimplemented)() is called from VG_(load_ELF)() which is used during client image initialization. Fix attached, regression testing went fine.
Created attachment 98481 [details] proposed patch The patch consists mainly of whitespace changes due to different indentation.
If show sched status is called before the threads are implemented, then nothing will be visible. Maybe it would be better to do something like: if (VG_(threads) == NULL) { VG_(printf) ("cannot show sched status : scheduler not yet initialised\"); return; } ... here the old code ... rather than report nothing ?
Created attachment 98489 [details] proposed patch v2 Addresses Philippe's comment.
You are right, Philippe, that's very good remark. I have attached new patch.
Fixed in SVN r15867.