PR# 14521 Deep_equal not thread-safe
Problem Report Summary
Submitter: prestoat2000
Category: Runtime
Priority: Medium
Date: 2008/06/24
Class: Bug
Severity: Serious
Number: 14521
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: Deep_equal not thread-safe
Description
Based on code inspection (and confirmed by a test case), it appears that deep_equal is not thread-safe. It calls `ediso' in equal.c, which turns off GC, calls `rdeepiso' and then turns GC back on. Presumably, different threads can interfere with each other, turning GC back on when it is expected to be off and thus causing havoc.
To Reproduce
Finalize with attached classes and config file. Execute system with arguments "10 1000000 20" (10 worker threads, 1000000 iterations per worker, creating strings of size 20 to be filled with blanks and see if they are deep_equal to themselves). System often crashes with a panic or with: ------------------------------------------------------------------------------- Class / Object Routine Nature of exception Effect ------------------------------------------------------------------------------- EIF_EXCEPTION is_deep_equal Segmentation violation: <0000000000141F08> (From ANY) Operating system signal. Exit -------------------------------------------------------------------------------
Problem Report Interactions
I think this should be left open. I'm not sure why `deep_equal' would disable the GC though. I would expect `deep_twin' to do that.
I can't reproduce the problem any more with 7.1.88986. I cannot see that anything has been changed to fix it, so I'm a bit reluctant to close this without some reassurance that it has actually been fixed.