Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv_createsample: free(): invalid next size (normal):

Hello there,

Not sure how to get around this. I'm trying to use opencv_create sample, but seems like it tries to free an already fred pointer. I'm using self-compiled opencv 4.0.0-pre (got this using opencv_version). This is the complete output:

*** Error in `opencv_createsamples': free(): invalid next size (normal): 0x0000000000821460 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f9ccfe897e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f9ccfe9237a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9ccfe9653c]
/lib/x86_64-linux-gnu/libc.so.6(+0x6dd5d)[0x7f9ccfe7fd5d]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(+0x4c86d)[0x7f9cd42bb86d]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(+0x4d2a1)[0x7f9cd42bc2a1]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(_ZN2cv6imreadERKNS_6StringEi+0xb3)[0x7f9cd42bdfb3]
opencv_createsamples[0x40448a]
opencv_createsamples[0x40ba9c]
opencv_createsamples[0x402040]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f9ccfe32830]
opencv_createsamples[0x4026c9]
======= Memory map: ========
....
....
....
Aborted

Using GDB:

Program received signal SIGABRT, Aborted.
0x00007ffff2e2c428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff2e2c428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff2e2e02a in __GI_abort () at abort.c:89
#2  0x00007ffff2e6e7ea in __libc_message (do_abort=do_abort@entry=2, 
    fmt=fmt@entry=0x7ffff2f87ed8 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff2e7737a in malloc_printerr (ar_ptr=<optimized out>, 
    ptr=<optimized out>, str=0x7ffff2f88030 "free(): invalid next size (normal)", 
    action=3) at malloc.c:5006
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3867
#5  0x00007ffff2e7b53c in __GI___libc_free (mem=<optimized out>) at malloc.c:2968
#6  0x00007ffff2e64d5d in __fopen_internal (filename=0x63e484 "neg/2014.jpg\r", 
    mode=0x7ffff75ac9c8 "rb", is32=1) at iofopen.c:90
#7  0x00007ffff72a086d in cv::findDecoder(cv::String const&) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#8  0x00007ffff72a12a1 in cv::imread_(cv::String const&, int, int, cv::Mat*) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#9  0x00007ffff72a2fb3 in cv::imread(cv::String const&, int) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#10 0x000000000040448a in icvGetNextFromBackgroundData(CvBackgroundData*, CvBackgroundReader*) ()
#11 0x000000000040ba9c in cvCreateTestSamples(char const*, char const*, int, int, char---Type <return> to continue, or q <return> to quit---

Any suggestion on how to get around this?

opencv_createsample: free(): invalid next size (normal):

Hello there,

Not sure how to get around this. I'm trying to use opencv_create sample, but seems like it tries to free an already fred pointer. pointer.

I'm using self-compiled opencv 4.0.0-pre (got this using opencv_version). opencv_version).

This is the complete output:

*** Error in `opencv_createsamples': free(): invalid next size (normal): 0x0000000000821460 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f9ccfe897e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f9ccfe9237a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9ccfe9653c]
/lib/x86_64-linux-gnu/libc.so.6(+0x6dd5d)[0x7f9ccfe7fd5d]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(+0x4c86d)[0x7f9cd42bb86d]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(+0x4d2a1)[0x7f9cd42bc2a1]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(_ZN2cv6imreadERKNS_6StringEi+0xb3)[0x7f9cd42bdfb3]
opencv_createsamples[0x40448a]
opencv_createsamples[0x40ba9c]
opencv_createsamples[0x402040]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f9ccfe32830]
opencv_createsamples[0x4026c9]
======= Memory map: ========
....
....
....
Aborted

Using GDB:

Program received signal SIGABRT, Aborted.
0x00007ffff2e2c428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff2e2c428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff2e2e02a in __GI_abort () at abort.c:89
#2  0x00007ffff2e6e7ea in __libc_message (do_abort=do_abort@entry=2, 
    fmt=fmt@entry=0x7ffff2f87ed8 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff2e7737a in malloc_printerr (ar_ptr=<optimized out>, 
    ptr=<optimized out>, str=0x7ffff2f88030 "free(): invalid next size (normal)", 
    action=3) at malloc.c:5006
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3867
#5  0x00007ffff2e7b53c in __GI___libc_free (mem=<optimized out>) at malloc.c:2968
#6  0x00007ffff2e64d5d in __fopen_internal (filename=0x63e484 "neg/2014.jpg\r", 
    mode=0x7ffff75ac9c8 "rb", is32=1) at iofopen.c:90
#7  0x00007ffff72a086d in cv::findDecoder(cv::String const&) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#8  0x00007ffff72a12a1 in cv::imread_(cv::String const&, int, int, cv::Mat*) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#9  0x00007ffff72a2fb3 in cv::imread(cv::String const&, int) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#10 0x000000000040448a in icvGetNextFromBackgroundData(CvBackgroundData*, CvBackgroundReader*) ()
#11 0x000000000040ba9c in cvCreateTestSamples(char const*, char const*, int, int, char---Type <return> to continue, or q <return> to quit---

Any suggestion on how to get around this?

opencv_createsample: free(): invalid next size (normal):

Hello there,

Not sure how to get around this. I'm trying to use opencv_create sample, but seems like it tries to free an already fred pointer.

I'm using self-compiled opencv 4.0.0-pre (got this using opencv_version).

This is the complete output:

*** Error in `opencv_createsamples': free(): invalid next size (normal): 0x0000000000821460 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f9ccfe897e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f9ccfe9237a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9ccfe9653c]
/lib/x86_64-linux-gnu/libc.so.6(+0x6dd5d)[0x7f9ccfe7fd5d]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(+0x4c86d)[0x7f9cd42bb86d]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(+0x4d2a1)[0x7f9cd42bc2a1]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(_ZN2cv6imreadERKNS_6StringEi+0xb3)[0x7f9cd42bdfb3]
opencv_createsamples[0x40448a]
opencv_createsamples[0x40ba9c]
opencv_createsamples[0x402040]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f9ccfe32830]
opencv_createsamples[0x4026c9]
======= Memory map: ========
....
....
....
Aborted

Using GDB:

Program received signal SIGABRT, Aborted.
0x00007ffff2e2c428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff2e2c428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff2e2e02a in __GI_abort () at abort.c:89
#2  0x00007ffff2e6e7ea in __libc_message (do_abort=do_abort@entry=2, 
    fmt=fmt@entry=0x7ffff2f87ed8 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff2e7737a in malloc_printerr (ar_ptr=<optimized out>, 
    ptr=<optimized out>, str=0x7ffff2f88030 "free(): invalid next size (normal)", 
    action=3) at malloc.c:5006
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3867
#5  0x00007ffff2e7b53c in __GI___libc_free (mem=<optimized out>) at malloc.c:2968
#6  0x00007ffff2e64d5d in __fopen_internal (filename=0x63e484 "neg/2014.jpg\r", 
    mode=0x7ffff75ac9c8 "rb", is32=1) at iofopen.c:90
#7  0x00007ffff72a086d in cv::findDecoder(cv::String const&) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#8  0x00007ffff72a12a1 in cv::imread_(cv::String const&, int, int, cv::Mat*) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#9  0x00007ffff72a2fb3 in cv::imread(cv::String const&, int) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#10 0x000000000040448a in icvGetNextFromBackgroundData(CvBackgroundData*, CvBackgroundReader*) ()
#11 0x000000000040ba9c in cvCreateTestSamples(char const*, char const*, int, int, char---Type <return> to continue, or q <return> to quit---

This is the command I'm trying to run: opencv_createsamples -img watch5050.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950 (From: https://pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/).

Any suggestion on how to get around this?

opencv_createsample: free(): invalid next size (normal):

Hello there,

Not sure how to get around this. I'm trying to use opencv_create sample, but seems like it tries to free an already fred pointer.

I'm using self-compiled opencv 4.0.0-pre (got this using opencv_version).

This is the complete output:

*** Error in `opencv_createsamples': free(): invalid next size (normal): 0x0000000000821460 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f9ccfe897e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f9ccfe9237a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9ccfe9653c]
/lib/x86_64-linux-gnu/libc.so.6(+0x6dd5d)[0x7f9ccfe7fd5d]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(+0x4c86d)[0x7f9cd42bb86d]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(+0x4d2a1)[0x7f9cd42bc2a1]
/home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0(_ZN2cv6imreadERKNS_6StringEi+0xb3)[0x7f9cd42bdfb3]
opencv_createsamples[0x40448a]
opencv_createsamples[0x40ba9c]
opencv_createsamples[0x402040]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f9ccfe32830]
opencv_createsamples[0x4026c9]
======= Memory map: ========
....
....
....
Aborted

Using GDB:

Program received signal SIGABRT, Aborted.
0x00007ffff2e2c428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff2e2c428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff2e2e02a in __GI_abort () at abort.c:89
#2  0x00007ffff2e6e7ea in __libc_message (do_abort=do_abort@entry=2, 
    fmt=fmt@entry=0x7ffff2f87ed8 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff2e7737a in malloc_printerr (ar_ptr=<optimized out>, 
    ptr=<optimized out>, str=0x7ffff2f88030 "free(): invalid next size (normal)", 
    action=3) at malloc.c:5006
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3867
#5  0x00007ffff2e7b53c in __GI___libc_free (mem=<optimized out>) at malloc.c:2968
#6  0x00007ffff2e64d5d in __fopen_internal (filename=0x63e484 "neg/2014.jpg\r", 
    mode=0x7ffff75ac9c8 "rb", is32=1) at iofopen.c:90
#7  0x00007ffff72a086d in cv::findDecoder(cv::String const&) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#8  0x00007ffff72a12a1 in cv::imread_(cv::String const&, int, int, cv::Mat*) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#9  0x00007ffff72a2fb3 in cv::imread(cv::String const&, int) ()
   from /home/federico/.opencv/opencv/build/lib/libopencv_imgcodecs.so.4.0
#10 0x000000000040448a in icvGetNextFromBackgroundData(CvBackgroundData*, CvBackgroundReader*) ()
#11 0x000000000040ba9c in cvCreateTestSamples(char const*, char const*, int, int, char---Type <return> to continue, or q <return> to quit---

This is the The command I'm trying to run: run is: opencv_createsamples -img watch5050.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950 (From: https://pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/). (from: https://pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/ - so I'm using the dataset from the article)

Any suggestion on how to get around this?