PR# 14563 Routine `eif_mem_stat' may not be thread-safe

Problem Report Summary
Submitter: prestoat2000
Category: Runtime
Priority: Medium
Date: 2008/07/07
Class: Bug
Severity: Non-critical
Number: 14563
Release: 6.2.73753
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.9) Gecko/20071111 Firefox/2.0.0.9 Solaris 10 on SPARC
Synopsis: Routine `eif_mem_stat' may not be thread-safe

Description
Routine `eif_mem_stat' in memory.c may not be thread-safe.  It calls `meminfo'
in malloc.c, which says it is safe if caller holds `eif_free_list_mutex' or is 
under GC synchronization.  Neither of these is true for `eif_mem_stat'.

I don't believe the call to `memcpy' is guaranteed to be atomic and this seems 
to be confirmed by a Google search.  If that is true, then one could 
theoretically get Used, Free and Overhead numbers that do not add up to Total.

However, I have not been able to construct a test case that fails, at least not
on Solaris SPARC.

To Reproduce

										
Problem Report Interactions