View Issue Details

IDProjectCategoryView StatusLast Update
0000009Campy[All Projects] Generalpublic2018-04-04 09:59
ReporteradministratorAssigned Toadministrator 
PrioritynormalSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
Summary0000009: CIL code that contains a comparison (e.g., CEQ) followed by a new block results in a crash during JIT compilation.
DescriptionIn a compilation of (bad) Radix sort implementation, shown below, the compiler will crash. This is because of some bad code in JITing the CEQ instruction, where the result is not pushed on the stack.

public static void SortP(int[] e)
        {
            int[] tmp = new int[e.Length];
            for (int shift = 31; shift > -1; --shift)
            {
                int j = 0;
                Campy.Parallel.For(e.Length, i =>
                {
                    bool move = (e[i] << shift) >= 0;
                    if (shift == 0 ? !move : move) // shift the 0's to old's head
                        e[i - j] = e[i];
                    else // move the 1's to tmp
                        tmp[j++] = e[i]; // THIS IS UNSAFE CODE DUE TO J BEING INCREMENTED UNCONTROLLED AMONG VARIOUS THREADS.
                });
                Array.Copy(tmp, 0, e, e.Length - j, j);
            }
        }
Additional InformationI fixed the code, and it should be available with the next release.
TagsNo tags attached.

Activities

administrator

2018-04-04 09:59

administrator   ~0000013

Fixed in v0.0.7

Issue History

Date Modified Username Field Change
2018-03-27 20:22 administrator New Issue
2018-03-27 20:22 administrator Status new => assigned
2018-03-27 20:22 administrator Assigned To => administrator
2018-04-04 09:59 administrator Status assigned => closed
2018-04-04 09:59 administrator Resolution open => fixed
2018-04-04 09:59 administrator Note Added: 0000013