Menu

#48 top3.8beta LWP corrupt on Solaris 10

v3.8beta
open
nobody
5
2010-03-08
2010-03-08
No

Solaris 10 has a 4-byte pr_filler field in the psinfo structure and its not double-aligned,
so using the percent_cpu macro to store a double in there actually overwrites the
first 8 bytes of pr_lwp, the latter 4 bytes containing the pr_lwpid!

I enclose a patch that works around this for Solaris 10 by using the larger (20 byte)
pr_filler field in the lwpsinfo struct, but this is will probably break
in a future Solaris release; something better should be done here
to store "extra" data properly and portably.

This patch also includes the patch from

bug id #2965027 top-3.8beta1 improper use of free() on Solaris

and possibly renders the patch in

2815842 top-3.8beta1 will segfault with high thread ids

unecessary, unless thread-id's can have the top-bit set
(thread-id's without my patch would have as they
were garbage on Solaris 10)

Discussion

  • Ian Donaldson

    Ian Donaldson - 2010-03-08

    free() and LWP fix for Solaris

     
  • Ian Donaldson

    Ian Donaldson - 2010-03-08

    forgot to set category/group

     
  • Ian Donaldson

    Ian Donaldson - 2010-03-08
    • labels: --> Runtime Errors
    • milestone: --> 813658
     
  • Ian Donaldson

    Ian Donaldson - 2010-03-08

    fix group

     
  • Ian Donaldson

    Ian Donaldson - 2010-03-08
    • milestone: 813658 --> v3.8beta
     

Log in to post a comment.

MongoDB Logo MongoDB