sigsegv or sigabrt corrupted double linked list

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Posts: 1
Joined: 2016-06-17T10:13:50-07:00
Authentication code: 1151

sigsegv or sigabrt corrupted double linked list

Post by dabicho » 2016-06-17T13:08:01-07:00

I am writing a program to control a photo camera remotely.
In this program I use ImageMagick-c++- to do some processing of images (jpgs), mainly scaling.
Not sure if I am doing something wrong.

Things go like this:

Client requests preview
Server acquires preview image from camera (jpg) and uses Magick++ to scale it with a Blob and an Image

This is repeated every predefined time and all seems to go ok. The preview images are relatively small.
Then the client request the server to shoot the camera.
The server shoots the camera and gets a larger image, scales it down and sends it to the client.
Then the client can ask the server to start prevewing again.
At this point the crash occurs.
The code for handling this operations is on the same function, and the function exits after each request.

The error is sometimes sigsegv and others sigabrt with corrupted double linked list

I am getting this backtrace from gdb

Code: Select all

#0  0x00007ffff1e423ea in malloc_consolidate () from /usr/lib64/
#1  0x00007ffff1e43f49 in _int_malloc () from /usr/lib64/
#2  0x00007ffff1e4600c in malloc () from /usr/lib64/
#3  0x00007ffff7bbf9ee in Magick::Options::Options() () from /usr/lib64/
#4  0x00007ffff7bbebf5 in Magick::ImageRef::ImageRef() () from /usr/lib64/
#5  0x00007ffff7bb3ecc in Magick::Image::Image() () from /usr/lib64/
#6  0x000000000040b90e in callback_camera_control (wsi=0x7fffe0052730, reason=LWS_CALLBACK_RECEIVE, user=0x7fffe00528d0, in=0x7fffe00e2450, len=34)
    at websocket_camera_control_protocol.cxx:68
#7  0x00007ffff29b13e7 in user_callback_handle_rxflow () from /usr/lib64/
#8  0x00007ffff29b4c23 in lws_rx_sm () from /usr/lib64/
#9  0x00007ffff29bc25c in lws_interpret_incoming_packet () from /usr/lib64/
#10 0x00007ffff29aff0e in lws_read () from /usr/lib64/
#11 0x00007ffff29b1e6f in lws_service_fd_tsi () from /usr/lib64/
#12 0x00007ffff29ba463 in lws_plat_service_tsi () from /usr/lib64/
#13 0x000000000040aa61 in websocket_server_manager (data=0x678ab0) at websocket_server.cxx:165
#14 0x00007ffff2e38a45 in g_thread_proxy () from /usr/lib64/
#15 0x00007ffff1bb0f33 in start_thread () from /usr/lib64/
#16 0x00007ffff1ebaead in clone () from /usr/lib64/

Code: Select all

*** Error in `/media/sf_rpmbuild/DEVEL/siirfe_gphoto_server-1.0_test/src/siirfe_gphoto_server': corrupted double-linked list: 0x00007fffe003f410 ***
======= Backtrace: =========
What may I be doing wrong?
The crash occurs with the objects declarations.

Code: Select all

  Magick::Blob dato_previo;
  Magick::Image imagen_previo; <-- This is line 68 for websocket_camera_control_protocol.cxx
  Magick::Blob dato_foto;
  Magick::Image imagen_foto; 
  Magick::Image imagen_recorte_foto;
  Magick::Geometry preview_geometry;
At I do

Code mixes C and C++

Any idea if I am doing something wrong?

Post Reply