Modify

Opened 15 years ago

Last modified 15 years ago

#211 new defect

Wrong transformation (or insufficient error checking) for collective, exclusive, and shared synchronization

Reported by: hauma Owned by: hauma
Priority: normal Milestone: 2.0
Component: jpc Version: 1.09b
Severity: minor Keywords:
Cc:

Description (last modified by hauma)

Assume, one has "forgotten" the replicated modifier in the following class definition (Even with the replicated modifier, this program is nonsense, because there is only one thread performing a collective synchronization on the replicated class. Therefore, this program should hang unless executed in a distributed environment with only one virtual machine.):

import jp.lang.DistributedRuntime;

class A {
    static int[] x = 
        new int[DistributedRuntime.getMachineCnt()];

    public static void main(String[] args) {
        int rank = DistributedRuntime.getMachineID();
        collective synchronized (A.class) {
            x[rank] = rank;
        }
    }
}

This program is "illegal", because there is an attributed (collective) synchronization on a class object that does not represent a replicated class.

This mistake should either be detected at compile time, or the program should compile silently, but throw an exception at runtime. Instead, the compiler accepts the program, starts the transformation, produces an illegal transformation result, and then prints an error message containing details about the (wrong) transformation.

The error message is:

A.java:11: method __collectiveUpdate() not found in class java.lang.Class

Attachments (0)

Change History (1)

comment:1 Changed 15 years ago by hauma

  • Description modified (diff)

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain hauma.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from hauma to the specified user. Next status will be 'new'.
The owner will be changed from hauma to anonymous. Next status will be 'assigned'.
Author


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

 
Note: See TracTickets for help on using tickets.