xforms-development
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XForms] Intermittent crash I cant seem to fix.


From: jon
Subject: [XForms] Intermittent crash I cant seem to fix.
Date: Mon, 09 Apr 2018 17:13:33 +0100

Probably something I am doing, but just in case....

I will put the whole thing up on github when I have time.  Its displays
jpegs at 10Hz ish, runs for 15 mins to an hour then .....




Program received signal SIGSEGV, Segmentation fault.
0x00007ffff72e8bbc in _int_malloc (address@hidden <main_arena>, address@hidden) 
at malloc.c:3353
3353    malloc.c: No such file or directory.
(gdb) backtrace
#0  0x00007ffff72e8bbc in _int_malloc (address@hidden <main_arena>, 
address@hidden) at malloc.c:3353
#1  0x00007ffff72eb184 in __GI___libc_malloc (bytes=44) at malloc.c:2913
#2  0x00007ffff67fc14c in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007ffff67f9ed1 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#4  0x00007ffff67fb617 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#5  0x00007ffff67fb721 in xcb_wait_for_reply () from 
/usr/lib/x86_64-linux-gnu/libxcb.so.1
#6  0x00007ffff6d58a47 in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#7  0x00007ffff6d3f517 in _XGetWindowAttributes () from 
/usr/lib/x86_64-linux-gnu/libX11.so.6
#8  0x00007ffff6d3f6a1 in XGetWindowAttributes () from 
/usr/lib/x86_64-linux-gnu/libX11.so.6
#9  0x00007ffff789b3fe in flimage_sdisplay () from 
/usr/local/lib/libflimage.so.2
#10 0x00007ffff789b7c2 in flimage_display () from /usr/local/lib/libflimage.so.2
#11 0x0000000000403928 in reload_image (jpg_buffer=0x70c890 <msgbuffer+80> 
"\377\330\377", <incomplete sequence \340>, jpg_size=35845)
    at jcamsysxviewer.c:247
#12 0x000000000040467e in jc_message_parser (msgtype=10, reqid=38666) at 
jcamsysxviewer.c:496
#13 0x0000000000404f40 in jc_events () at jcamsysxviewer.c:718
#14 0x0000000000403976 in dwell_event_poll (timeoutms=10) at 
jcamsysxviewer.c:261
#15 0x0000000000403a57 in do_image_request (img=0, cam=2, x=11) at 
jcamsysxviewer.c:290




void reload_image(unsigned char *jpg_buffer, int jpg_size)
{
        int ih=0, iw=0;
        int tout=0;
        int w,h;

        shm->donow=TRUE;                                                        
                // trigger slave to decode
        tout=1000;
        do
        {
                if (shm->donow==TRUE)
                        usleep(1000);

        } while (( shm->donow==TRUE) & (tout>0) );                              
                // wait for it to complete
        if ( (tout==0) | (shm->im.width==0) | (shm->im.height==0) )             
                // timed out, ignore image
                return;

        //printf("decoded jpeg, got %d x %d, %d bytes 
RGB\n",shm->im.width,shm->im.height,shm->im.cbytes); 
        //fflush(stdout);
        if (camimage==NULL)
                camimage = flimage_alloc();
        if (formsize==0)
        {
                w=shm->im.width;
                h=shm->im.height;
                scaleimage(0,(char*)shm->rgb,&w,&h,1);
                shm->im.height=h;
                shm->im.width=w;
        }

        camimage->type = FL_IMAGE_RGB;
        camimage->w = shm->im.width;
        camimage->h = shm->im.height;
        camimage->map_len = 1;
        flimage_getmem(camimage);

        // copy decoded jpeg into FL_IMAGE
        int p=0;
        for (ih=0;ih<shm->im.height;ih++)
        {
                for (iw=0;iw<shm->im.width;iw++)
                {
                        camimage->red  [ih][iw] = shm->rgb[p];
                        camimage->green[ih][iw] = shm->rgb[p+1];
                        camimage->blue [ih][iw] = shm->rgb[p+2];
                        p=p+3;
                }
        }
        camimage->modified=1;
        flimage_display( camimage, FL_ObjWin( fd_cameraview->largeviewcanvas ) 
);
        flimage_free(camimage);
        camimage=NULL;
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]