Skip to content
This repository

Crash when trying mandelbrot_tasks #379

Open
mattwalsh opened this Issue · 5 comments

3 participants

Matt Walsh Jean-Luc Duprat Matt Pharr
Matt Walsh

Pulled down the latest ispc today (9-13-2012); got this error when doing a make:

[ mandelbrot_tasks]$ make
/bin/mkdir -p objs/
ispc -O2 --arch=x86-64 --target=sse2,sse4-x2,avx-x2 mandelbrot.ispc -o objs/mandelbrot_ispc.o -h objs/mandelbrot_ispc.h
ispc: /usr/pic1/llvm/llvm-3.1.src/include/llvm/CodeGen/LiveInterval.h:130: llvm::LiveRange::LiveRange(llvm::SlotIndex, llvm::SlotIndex, llvm::VNInfo*): Assertion `S < E && "Cannot create empty or backwards range"' failed.
main.cpp(207): FATAL ERROR: Unhandled signal sent to process; terminating.


*** Please file a bug report at https://github.com/ispc/ispc/issues
*** (Including as much information as you can about how to reproduce this error).
*** You have apparently encountered a bug in the compiler that we'd like to fix!


make: *** [objs/mandelbrot_ispc.h] Aborted
make: *** Deleting file `objs/mandelbrot_ispc.h'

Jean-Luc Duprat
Matt Walsh

Linux
Linux-RedHat-5-Client-7.1.3-x86_64

Matt Walsh

Here's another reproducer. If you compile it with

ispc -DTASK_MODE torture.ispc -o blah.o

it fails.

Interestingly, if you omit the -o switch, it works.

It also seems to be sensitive to the kernel; if I for instance eliminate the switch statement altogether it works

#ifdef TASK_MODE
task
#endif
void
torture_ispc_task(
    uniform float _inp1[], uniform float _inp2[],
    uniform int _mode[],   uniform float _outp[],
    uniform int span,
    uniform int PTS) {

    #ifdef TASK_MODE
    uniform int start = taskIndex*span;
    uniform int end   = min((taskIndex+1)*span, PTS);
    #else
    uniform int start = 0;
    uniform int end   = PTS;
    #endif   

    foreach (i = start ... end) {
        float inp1 = _inp1[i];
        float inp2 = _inp2[i];
        int mode = _mode[i];
        float outp;

    outp = 0.0f;
    {
        float tmp = 0.0f;
        switch (mode) {
            case 0:
                for (int k = 0; k < 100; k++)
                {   tmp += .1f;
                    outp += pow(2.0f + tmp,(inp1 + inp2));
                }
                break;
            case 1:
                for (int k = 0; k < 90; k++)
                {   tmp += .2f;
                    outp += pow(2.2f + tmp,(inp1 - inp2 + tmp));
                }
                break;
       }

    }

        _outp[i] = outp;
    }
}

export void torture_ispc(
    uniform float _inp1[], uniform float _inp2[],
    uniform int _mode[],   uniform float _outp[],
    uniform int PTS) {

    #if defined TASK_MODE
    uniform int span = PTS/16;
    launch[PTS/span] torture_ispc_task(_inp1, _inp2, _mode, _outp, span, PTS);
    #else
    torture_ispc_task(
        _inp1, _inp2, _mode, _outp, PTS, PTS);
    #endif
}
Matt Walsh

I should add one thing; in my Makefile I have to eliminate the -static switch thing else it won't compile on my machine, that is...

LDFLAGS=
ifeq ($(ARCH_OS),Linux)
  # try to link everything statically under Linux (including libstdc++) so
  # that the binaries we generate will be portable across distributions...
#    LDFLAGS=-static
endif
Matt Pharr
Collaborator

I tried this on ubuntu 12.04 and couldn't reproduce there. (Will dig further, though.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.