Server crash when calling getCurrentContextIndex() repeatedly

pschwed's Avatar

pschwed

28 Mar, 2012 02:02 PM

ok, this works flawlessly:

const double width_pixel = ViewportWidth[display->getCurrentContextIndex()];
double requested_size = (dot_size / display_width) * width_pixel;
GLfloat maximum_size;
glPointSize(requested_size);
glGetFloatv(GL_POINT_SIZE_MAX,&maximum_size);
if (requested_size > maximum_size)
    mwarning(M_DISPLAY_MESSAGE_DOMAIN,"RDP on Display %d: requested point size %f is larger than maximum point size of %f\n"
           ,display->getCurrentContextIndex(),requested_size,maximum_size);

if ( type.compare(0,1,"3D",0,1) != 0 ) {
    glVertexPointer(verticesPerDot, GL_DOUBLE, 0, &(dots[0]));
    glDrawArrays(GL_POINTS, 0, ndots);
}
else {
    const GLint velements = ndots*verticesPerDot;
    for (int i=0;i<velements;i+=verticesPerDot) {
        glPointSize(ddots_size[i] * width_pixel);
        glVertexPointer(verticesPerDot, GL_DOUBLE, 0, &(ddots[i]));
        glDrawArrays(GL_POINTS, 0, 1);
        glVertexPointer(verticesPerDot, GL_DOUBLE, 0, &(ddots[velements+i]));
        glDrawArrays(GL_POINTS, 0, 1);
    }
}

and this crashes after a couple of updates (it doesn't happen immediately, but within 60 seconds or so)

double requested_size = (dot_size / display_width) * ViewportWidth[display->getCurrentContextIndex()];
GLfloat maximum_size;
glPointSize(requested_size);
glGetFloatv(GL_POINT_SIZE_MAX,&maximum_size);
if (requested_size > maximum_size)
    mwarning(M_DISPLAY_MESSAGE_DOMAIN,"RDP on Display %d: requested point size %f is larger than maximum point size of %f\n"
           ,display->getCurrentContextIndex(),requested_size,maximum_size);

if ( type.compare(0,1,"3D",0,1) != 0 ) {
    glVertexPointer(verticesPerDot, GL_DOUBLE, 0, &(dots[0]));
    glDrawArrays(GL_POINTS, 0, ndots);
}
else {
    const GLint velements = ndots*verticesPerDot;
    for (int i=0;i<velements;i+=verticesPerDot) {
        glPointSize(ddots_size[i] * ViewportWidth[display->getCurrentContextIndex()]);
        glVertexPointer(verticesPerDot, GL_DOUBLE, 0, &(ddots[i]));
        glDrawArrays(GL_POINTS, 0, 1);
        glVertexPointer(verticesPerDot, GL_DOUBLE, 0, &(ddots[velements+i]));
        glDrawArrays(GL_POINTS, 0, 1);
    }
}

It's weird, I know. This is why I ask. The only thing I've changed is that I am not calling ´getCurrentContextIndex´ from within the loop.

  1. Support Staff 1 Posted by Christopher Sta... on 28 Mar, 2012 02:07 PM

    Christopher Stawarz's Avatar

    Hi Philipp,

    (I moved this issue to a new discussion.)

    I don't see any problems with your code, which makes me worry that there is some underlying issue in MWorks. Do you think you could induce the crash again and send me the resulting CrashReporter log? That might provide some clues about what's happening.

    Thanks,
    Chris

  2. 2 Posted by pschwed on 29 Mar, 2012 08:42 AM

    pschwed's Avatar

    Hi Chris,

    I've been going over and over this issue some time now and I think I've found another error in the code. The ddots_size initialization was going a bit wrong, but this was the case for both versions.
    Maybe some weird coincidences prevent the server from crashing in the first example, I don't really know. I'll try to do a test run with 'getCurrentContextIndex()' within the loop, so we can see if my initial hunch was wrong.

    I'll report back,
    Philipp

  3. 3 Posted by pschwed on 29 May, 2012 12:36 PM

    pschwed's Avatar

    Hi Chris,

    yep, my fault. I haven't seen the issues for a while (after fixing this other bug).

    I'll close this discussion.

    Cheers,
    Philipp

  4. pschwed closed this discussion on 29 May, 2012 12:36 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

17 May, 2022 02:12 PM
16 May, 2022 03:12 PM
04 May, 2022 06:02 PM
03 May, 2022 01:30 PM
02 May, 2022 10:47 PM