Opened 3 years ago

Closed 22 months ago

Last modified 19 months ago

#17415 closed bug (fixed)

MediaConverting WAV to OGG audio (Flac)) crashes in av_frame_unref

Reported by: humdinger Owned by: stippi
Priority: normal Milestone: R1/beta5
Component: Applications/MediaConverter Version: R1/Development
Keywords: r1beta4-fixes Cc:
Blocked By: Blocking: #16831, #17153
Platform: All

Description

This is hrev55650.

When trying to convert a WAV to OGG audio it

  • creates a 0 byte file when choosing Dolby Digital (AC-3) as encoder
  • crashes MediaConverter when choosing FLAC as encoder:
    thread 2650: converter thread 
    state: Exception (Segment violation)
    
    Frame		IP			Function Name
    -----------------------------------------------
    0x7f201b56ec70	0xc92b985cca	__mutex_lock + 0xa 
    	Disassembly:
    		__mutex_lock:
    		0x000000c92b985cc0:               55  push %rbp
    		0x000000c92b985cc1:           4889e5  mov %rsp, %rbp
    		0x000000c92b985cc4:             4154  push %r12
    		0x000000c92b985cc6:           4989fc  mov %rdi, %r12
    		0x000000c92b985cc9:               53  push %rbx
    		0x000000c92b985cca:           8b470c  mov 0xc(%rdi), %eax <--
    
    	Frame memory:
    		[0x7f201b56ec50]  .........@M.)...   00 00 00 00 00 00 00 00 00 40 4d b0 29 11 00 00
    		[0x7f201b56ec60]  ..V. ......+....   a0 ec 56 1b 20 7f 00 00 d2 10 a1 2b c9 00 00 00
    0x7f201b56ecb0	0xc92ba110cd	BPrivate::processHeap::free(void*) + 0xbd 
    0x7f201b56ecd0	0xc92ba121dd	free + 0x3d 
    0x7f201b56eea0	0x129cebd75cd	av_frame_unref + 0x7d 
    0x7f201b56eef0	0xc92ba0f31a	BPrivate::hoardSbrk(long) + 0xfa 
    0x7f201b56ef30	0xc92ba1145a	BPrivate::superblock::makeSuperblock(int, BPrivate::processHeap*) + 0xea 
    0x7f201b56ef90	0xc92ba115e8	BPrivate::threadHeap::malloc(unsigned long) + 0xa8 
    0x7f201b56efb0	0xc92ba11dfb	malloc + 0x9b 
    
    

Full report attached.

Attachments (1)

MediaConverter-2625-debug-22-11-2021-12-39-17.report (27.9 KB ) - added by humdinger 3 years ago.
encoding with FLAC

Download all attachments as: .zip

Change History (10)

by humdinger, 3 years ago

encoding with FLAC

comment:1 by diver, 3 years ago

Summary: MediaConverting WAV to OGG audio (Flac)) crashesMediaConverting WAV to OGG audio (Flac)) crashes in av_frame_unref

This is with LD_PRELOAD=libroot_debug.so MediaConverter

		state: Exception (Segment violation)

		Frame		IP			Function Name
		-----------------------------------------------
		0x7f5b0ac5a450	0x55cb6cc587	av_frame_unref + 0x37 
			Disassembly:
				av_frame_unref:
				0x00000055cb6cc550:           4885ff  test %rdi, %rdi
				0x00000055cb6cc553:     0f84d7010000  jz 0x55cb6cc730
				0x00000055cb6cc559:             4155  push %r13
				0x00000055cb6cc55b:             4154  push %r12
				0x00000055cb6cc55d:               55  push %rbp
				0x00000055cb6cc55e:               53  push %rbx
				0x00000055cb6cc55f:           4889fb  mov %rdi, %rbx
				0x00000055cb6cc562:         4883ec08  sub $0x8, %rsp
				0x00000055cb6cc566:     8b9778010000  mov 0x178(%rdi), %edx
				0x00000055cb6cc56c:             85d2  test %edx, %edx
				0x00000055cb6cc56e:             7e3e  jle 0xcb6cc5ae
				0x00000055cb6cc570:           4531e4  xor %r12d, %r12d
				0x00000055cb6cc573:       0f1f440000  nop (%rax,%rax)
				0x00000055cb6cc578:   488b8370010000  mov 0x170(%rbx), %rax
				0x00000055cb6cc57f:         4e8d2ce0  lea (%rax,%r12,8), %r13
				0x00000055cb6cc583:         4983c401  add $0x1, %r12
				0x00000055cb6cc587:         498b6d00  mov (%r13), %rbp <--

			Frame memory:
				[0x7f5b0ac5a420]  ............[...   02 00 00 00 02 00 00 00 d0 a4 c5 0a 5b 7f 00 00
				[0x7f5b0ac5a430]   ...[...p...[...   20 a7 c5 0a 5b 7f 00 00 70 a4 c5 0a 5b 7f 00 00
				[0x7f5b0ac5a440]  ....[.......J...   80 a7 c5 0a 5b 7f 00 00 d1 89 90 7f 4a 01 00 00
		0x7f5b0ac5a730	0x14a7f9089cc	AVCodecEncoder::_EncodeAudio(unsigned char const*, unsigned long, long, media_encode_info*) + 0x6c 
		0x7f5b0ac5a780	0x14a7f908c6e	AVCodecEncoder::_EncodeAudio(void const*, long, media_encode_info*) + 0xfe 
		0x7f5b0ac5a850	0xdc6235d5a1	BMediaTrack::WriteFrames(void const*, int, int) + 0x41 
		0x7f5b0ac5ac60	0x17e204a11ac	MediaConverterApp::_ConvertFile(BMediaFile*, BMediaFile*, media_codec_info*, media_codec_info*, int, int, long, long) + 0x8ec 
		0x7f5b0ac5af10	0x17e204a1d05	MediaConverterApp::_RunConvert() + 0x255 
		0x7f5b0ac5af20	0x17e204a2184	MediaConverterApp::_RunConvertEntry(void*) + 0x4 
		0x7f5b0ac5af40	0x1b906c69337	thread_entry + 0x17 
		00000000	0x7ffecfa45260	commpage_thread_exit + 0

comment:2 by LianBg, 3 years ago

Can confirm, happens on my machine as well. I have attached my crash report here:

Debug information for team /boot/system/apps/MediaConverter (36891):
CPU(s): 2x Intel Core 2
Memory: 3.99 GiB total, 1.01 GiB used
Haiku revision: hrev55181+62 Nov 18 2021 08:15: (x86_64)

Active Threads:
	thread 36891: MediaConverter (main)
	thread 36896: w>MediaConverter 
	thread 36963: media extractor thread 
	thread 36974: team 36891 debug task 
	thread 36973: converter thread 
		state: Exception (Segment violation)

comment:4 by humdinger, 22 months ago

Confirmed. Doesn't crash any more, produces a 0 byte file like AC-3 now. Step-by-step... :)

comment:5 by pulkomandy, 22 months ago

Yes, I created #18233 for the next problem (I tested with mkv, but I suspect the fix will also help for other formats).

comment:6 by pulkomandy, 22 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: newclosed

Fixed in hrev56725

comment:7 by pulkomandy, 21 months ago

Blocking: 17153 added

comment:8 by pulkomandy, 21 months ago

Blocking: 16831 added

comment:9 by pulkomandy, 19 months ago

Keywords: r1beta4-fixes added
Note: See TracTickets for help on using tickets.