Modify

Opened 6 years ago

#1383 new defect

CarpetLib's prolongate_3d_rf2 contains non thread safe self-test

Reported by: Roland Haas Owned by: Erik Schnetter
Priority: optional Milestone:
Component: Carpet Version: development version
Keywords: Cc:

Description

the prolongate_3d_rf2 template in prolongate_3d_rf2.cc line 502ff:

  template <typename T, int ORDER>
  void
  prolongate_3d_rf2 (T const * restrict const src,
                     ivect3 const & restrict srcpadext,
                     ivect3 const & restrict srcext,
                     T * restrict const dst,
                     ivect3 const & restrict dstpadext,
                     ivect3 const & restrict dstext,
                     ibbox3 const & restrict srcbbox,
                     ibbox3 const & restrict dstbbox,
                     ibbox3 const & restrict,
                     ibbox3 const & restrict regbbox,
                     void * extraargs)
  {
    assert (not extraargs);
    
    static_assert (ORDER>=0 and ORDER % 2 == 1,
                   "ORDER must be non-negative and odd");
    
    typedef typename typeprops<T>::real RT;
    coeffs1d<RT,ORDER>::test();

contain a call to the self-test routine test() which is not thread safe (since it uses a static variable without protection).

As far as I can tell one can simply remove the test from this location since it is already explicitly triggered in the scheduled routine CarpetLib_test_prolongate_3d_rf2 above so would not ever actually execute anyway since the static has long been set to true by the time of the first "real" call to the operator. Similar code might exist for the other operators.

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Erik Schnetter.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from Erik Schnetter to the specified user.
Next status will be 'confirmed'.
The owner will be changed from Erik Schnetter to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.