Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#1940 closed defect (invalid)

segfault on av_malloc()

Reported by: leandrosansilva Owned by:
Priority: normal Component: avutil
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


I'm using ffmpeg in a c++ project and at a point at my code I try to call av_malloc() bu it results in a segfault. As I'm using ubuntu amd64 arch, I don't think I don't have enough memory. It's also strange it happens only in one point of my code, where I create a new pointer and just assign the return of av_malloc() (here the size is 460800) as parameter. It causes a segfault before return. It makes me think if libav keeps a internal state of general memory alocation system...

The ffmpeg version I'm using is the commit e94f4294746d50ef7b25993fa59a9be32023d3bb checked out today (21th November) from master branch.

The backtrace related to this problem is:

Program received signal SIGSEGV, Segmentation fault.
_int_malloc (av=0x7ffff6b63720, bytes=460880) at malloc.c:3868
3868    malloc.c: Arquivo ou diretório não encontrado.
(gdb) bt full
#0  _int_malloc (av=0x7ffff6b63720, bytes=460880) at malloc.c:3868
        p = <optimized out>
        iters = <optimized out>
        nb = 460896
        idx = <optimized out>
        bin = <optimized out>
        victim = 0x1d6fae0
        size = 7740398493674188424
        victim_index = <optimized out>
        remainder = 0x1de0340
        remainder_size = <optimized out>
        block = 4
        bit = 1073741824
        map = <optimized out>
        fwd = <optimized out>
        bck = <optimized out>
        errstr = 0x0
        __func__ = "_int_malloc"
#1  0x00007ffff682c801 in _int_memalign (av=0x7ffff6b63720, alignment=32, bytes=<optimized out>) at malloc.c:4492
        nb = 460816
        m = <optimized out>
        p = <optimized out>
        brk = <optimized out>
        newp = <optimized out>
        newsize = <optimized out>
        leadsize = <optimized out>
        remainder = <optimized out>
        remainder_size = <optimized out>
        size = <optimized out>
        __func__ = "_int_memalign"
#2  0x00007ffff682eac6 in __GI___libc_memalign (alignment=32, bytes=460800) at malloc.c:3102
        ar_ptr = <optimized out>
        p = <optimized out>
        hook = <optimized out>
        __func__ = "__libc_memalign"
#3  0x00007ffff682fd09 in __posix_memalign (memptr=0x7fffffffdc88, alignment=<optimized out>, size=<optimized out>) at malloc.c:5038
        mem = <optimized out>
        hook = <optimized out>
#4  0x0000000000cfb22a in av_malloc (size=460800) at libavutil/mem.c:97
        ptr = 0x0
#5  av_mallocz (size=460800) at libavutil/mem.c:203

(...) my code bt (...)

Change History (4)

comment:1 Changed 8 years ago by cehoyos

  • Keywords crash SIGSEGV added
  • Priority changed from critical to normal

Please provide a source file that allows to reproduce the crash.

comment:2 Changed 7 years ago by cehoyos

  • Resolution set to needs_more_info
  • Status changed from new to closed

Please reopen if you can add source code that allows to reproduce the problem.

comment:3 Changed 7 years ago by leandrosansilva

I'm sorry for de delay. After investigating more I realized the problem was in my code, with some data been desalocated twice.

Thx for the support.

comment:4 Changed 7 years ago by cehoyos

  • Keywords crash SIGSEGV removed
  • Resolution changed from needs_more_info to invalid

Thank you for clarifying!

Note: See TracTickets for help on using tickets.