PR# 14520 Run-time routine `correct_object_mismatch' might not be thread-safe

Problem Report Summary
Submitter: prestoat2000
Category: Runtime
Priority: Medium
Date: 2008/06/24
Class: Bug
Severity: Serious
Number: 14520
Release: 6.2.73753
Confidential: No
Status: Analyzed
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.13) Gecko/20080328 Firefox/2.0.0.13 Solaris 10 on SPARC
Synopsis: Run-time routine `correct_object_mismatch' might not be thread-safe

Description
Based on code inspection only, I think `correct_object_mismatch' (in
retrieve.c) might not be thread-safe.  It has calls to `eif_gc_run'
and `eif_gc_stop' to turn the GC on and off.  If there is more than
one thread calling `correct_object_mismatch' it seems that GC may be
turned back on when it is intended to be off.  If the first thread
finished a call to `correct_object_mismatch' and turned GC back on, a
second thread that was in `egc_correct_mismatch' might call a routine
that checked for GC synchronization, so the GC could possibly be
invoked.

However, I can't figure out how `correct_object_mismatch' is called so
perhaps it is dead code.

I'm not at all sure about this and don't have time for further
analysis, but I wanted to get this possible bug recorded before I go
on vacation and forget about it.
To Reproduce

										
Problem Report Interactions
From:manus_eiffel    Date:2008/06/24    Status: Analyzed    Download   
At the moment, I think only one thread can perform a call to the retrieve routine, but some people have complained about that since it is pretty restrictive. So we definitely need to look into that. The easiest might be to disable the GC in the Eiffel code rather than in the C code for the callback.