Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th November 2008, 17:38   #1  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,775
x264 r1041 - Segmentation Fault

I just compiled x264 r1041 as a DLL to use it with Avidemux. Did everything as I do it all the time.

But the build will crash right after the encoding process starts:

Code:
Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 4236.0xf7c]
0x67619a45 in block_residual_write_cabac (h=<value optimized out>,
    cb=0xb83d380, i_ctxBlockCat=<value optimized out>, i_idx=1, l=0x5d28ec0,
    i_count=16) at ./common/bs.h:232
232             return x264_ue_size_tab[(val+1)>>8] + 16;
(gdb) bt
#0  0x67619a45 in block_residual_write_cabac (h=<value optimized out>,
    cb=0xb83d380, i_ctxBlockCat=<value optimized out>, i_idx=1, l=0x5d28ec0,
    i_count=16) at ./common/bs.h:232
#1  0x67629d50 in x264_rd_cost_part (h=0x5d272c0, i_lambda2=9289, i4=1,
    i_pixel=6) at encoder/cabac.c:1109
#2  0x67635761 in x264_me_refine_qpel_rd (h=0x5d272c0, m=0xb83e2f0,
    i_lambda2=9289, i4=1, i_list=0) at encoder/me.c:1000
#3  0x6762f9e6 in x264_macroblock_analyse (h=0x5d272c0)
    at encoder/analyse.c:2415
#4  0x676573d5 in x264_slice_write (h=0x5d272c0) at encoder/encoder.c:1177
#5  0x6766e5a4 in x264_stack_align () from d:\Avidemux 2.4\libx264-65.dll
#6  0x676530cd in x264_slices_write (h=0x5d272c0) at encoder/encoder.c:1326
#7  0x611812fa in ptw32_threadStart@4 () from d:\Avidemux 2.4\pthreadGC2.dll
#8  0x77bcb530 in msvcrt!_endthreadex () from C:\WINDOWS\syswow64\msvcrt.dll
#9  0x7d4dfe21 in KERNEL32!GetConsoleOutputCP ()
   from C:\WINDOWS\syswow64\kernel32.dll
#10 0x09301230 in ?? ()
#11 0x00000000 in ?? ()
(gdb)
Compiler is GCC 4.3.2-tdm-1, which used to work fine up to (including) r1038. I did not use any custom CFLAGS for the debug build.

No patches applied, except for the alignment fix (as required to get a working DLL). Any ideas?
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 28th November 2008 at 17:44.
LoRd_MuldeR is offline   Reply With Quote
Old 28th November 2008, 18:23   #2  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 959
I am also experiencing a crash, but not with a debug build, that runs just fine. Using: x264 --crf 18 -b3 -m9 -r5 --me umh -8 -t1 -A all --mixed-refs -w --b-pyramid --direct auto --no-fast-pskip D:/Avisynth/fam-guy-ptv.y4m --progress -o NUL
causes a crash on the 5th frame. It happens with subme 8 or 9. Is it the same for you LoRd_MuldeR?

I will post more when I have more. I am also waiting for a reply from Dark Shikari or pengvado on the IRC channel.

[EDIT] --no-cabac seems to make it all better
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.

Last edited by J_Darnley; 28th November 2008 at 18:29.
J_Darnley is offline   Reply With Quote
Old 28th November 2008, 18:56   #3  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,122
Since the build on www.x264.nl isn't updated to 1041 yet, I used the 1041 build from techouse (www.x264.tk). It crashed almost straight away for me as well, it did get to the 40th frame though.

On testing, --no-cabac works, and with cabac its only subme 8 and 9 that don't work.

Last edited by burfadel; 28th November 2008 at 19:12.
burfadel is offline   Reply With Quote
Old 28th November 2008, 19:18   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,775
So I assume the current git version is borked...
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.


LoRd_MuldeR is offline   Reply With Quote
Old 28th November 2008, 19:21   #5  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
seems so. stick with r1040 until devs fix it.
Sharktooth is offline   Reply With Quote
Old 28th November 2008, 19:22   #6  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,775
Quote:
Originally Posted by Sharktooth View Post
seems so. stick with r1040 until it gets fixed.
Aye aye, Sir
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.


LoRd_MuldeR is offline   Reply With Quote
Old 28th November 2008, 19:35   #7  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
i was playing around with the config settings, since i was able to get a debug build working just fine (so it's not just the code but how it's compiled as well).

I nailed it down to:
w/ -fomit-frame-pointer = crash
w/o = fine
__________________
custom x264 builds & patches | F@H | My Specs

Last edited by kemuri-_9; 28th November 2008 at 19:46. Reason: small rewording
kemuri-_9 is offline   Reply With Quote
Old 28th November 2008, 20:25   #8  |  Link
ACoolie
Registered User
 
Join Date: Mar 2008
Posts: 30
Quote:
Originally Posted by kemuri-_9 View Post
i was playing around with the config settings, since i was able to get a debug build working just fine (so it's not just the code but how it's compiled as well).

I nailed it down to:
w/ -fomit-frame-pointer = crash
w/o = fine
I'm getting no crashes with:
CFLAGS=-O4 -ffast-math -Wall -I. -falign-loops=16 -mdynamic-no-pic -DHAVE_MMX -DARCH_X86 -DSYS_MACOSX -DHAVE_PTHREAD -s -fomit-frame-pointer
ACoolie is offline   Reply With Quote
Old 28th November 2008, 20:32   #9  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
i tried with the -falign-loops=16 and it still crashes,
we don't have the -mdynamic-no-pic on windows.
so it might just be isolated to windows as well.

Edit:
Tried it on an available linux box, and it works there as well.
So it does seem to be isolated to windows.

Edit Edit:
Crashes when compiled with MSVC9 as well.
so this definitely seems to be a secluded windows problem.
__________________
custom x264 builds & patches | F@H | My Specs

Last edited by kemuri-_9; 28th November 2008 at 20:56.
kemuri-_9 is offline   Reply With Quote
Old 28th November 2008, 22:01   #10  |  Link
komisar
Registered User
 
komisar's Avatar
 
Join Date: Aug 2008
Location: Minsk, Belarus
Posts: 235
On my "patched" 1041-build no crashes.
Quote:
CFLAGS=-O4 -ffast-math -DNDEBUG -Wall -I. -march=xxx -mtune=xxx -mno-cygwin -mwin32 -m32 -fno-zero-initialized-in-bss -fno-strict-aliasing -Wno-array-bounds -Wno-uninitialized -Wno-unused-variable -DHAVE_MMX -DARCH_X86 -DSYS_MINGW -DPTW32_STATIC_LIB -DHAVE_PTHREAD -s -fomit-frame-pointer
gcc version 4.3.3 20081126 (prerelease) (GCC)
Clear profiled 1041 build (without patches) compiled with some CFLAGS: http://komisar.gin.by/test/x264.1041.test_crash.exe
On
Code:
x264 [info]: using cpu capabilities: MMX2 SSE2Slow
no crashes with any settings for me...
__________________
..::[I am live here]..::..[My x264 CLI/VFW builds and tools]::..

Last edited by komisar; 28th November 2008 at 23:00.
komisar is offline   Reply With Quote
Old 28th November 2008, 22:57   #11  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,122
Quote:
Originally Posted by komisar View Post
On my "patched" 1041-build no crashes.gcc version 4.3.3 20081126 (prerelease) (GCC)
Clear 1041 build (without patches) compiled with some CFLAGS: http://komisar.gin.by/test/x264.1041.test_crash.exe
Both your test build and your normal builds still crash for me with the same settings, 1040 and below work fine! I really think it is because the output has changed for CABAC due to the changes in the CABAC code, which is stated in the build release. The changes affect RDO, which make sense since subme 8 and 9 deal with RD refinement. RD mode decision 6 & 7 work fine.

At a guess I'd assume all platforms are affected, just that on non-windows platform instead of a crash there may something else that happens (momentary pause, quality degradation). I did notice fiddling with the settings that I could get to different frame numbers. It usually crashed at the 40th frame, but when the settings were changed at the 40th frame there was a pause, then it kept going for a short while until it crashed.
burfadel is offline   Reply With Quote
Old 28th November 2008, 23:13   #12  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,690
Oh joy, a Heisenbug!

I tested this patch heavily and I cannot replicate this crash.

Fortunately, I have my minions on #x264dev to help me find what the problem is.

Edit: Fixed and committed. That was fast, 20 minutes.

Last edited by Dark Shikari; 28th November 2008 at 23:33.
Dark Shikari is offline   Reply With Quote
Old 29th November 2008, 05:50   #13  |  Link
bob0r
Pain and suffering
 
bob0r's Avatar
 
Join Date: Jul 2002
Posts: 1,337
bob0r is offline   Reply With Quote
Old 29th November 2008, 06:26   #14  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,122
Thanks for the fix, works flawlessly now
burfadel is offline   Reply With Quote
Old 29th November 2008, 12:19   #15  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,775
Confirmed

By the way: What does "10L" stand for?
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 29th November 2008 at 13:48.
LoRd_MuldeR is offline   Reply With Quote
Old 29th November 2008, 14:20   #16  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,393
Quote:
Originally Posted by LoRd_MuldeR View Post
By the way: What does "10L" stand for?
10 liters of cola. This means:
(a) "I must have been asleep when I wrote that, need more caffeine."
(b) One of the MPlayer developers didn't like cola, and we joked about assigning him some as punishment after one time he committed a nasty bug that should have been easily spotted.
akupenguin is offline   Reply With Quote
Old 29th November 2008, 14:25   #17  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,775
Quote:
Originally Posted by akupenguin View Post
10 liters of cola. This means:
(a) "I must have been asleep when I wrote that, need more caffeine."
(b) One of the MPlayer developers didn't like cola, and we joked about assigning him some as punishment after one time he committed a nasty bug that should have been easily spotted.
I see
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.


LoRd_MuldeR is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:06.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.