<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Måns Rullgård wrote:
<blockquote cite="mid:yw1xocwf7prc.fsf@thrashbarg.mansr.com" type="cite">
<pre wrap="">Zubair Ali Khan <a class="moz-txt-link-rfc2396E" href="mailto:zkhan@d2tech.com"><zkhan@d2tech.com></a> writes:
</pre>
<blockquote type="cite">
<pre wrap="">I recently compiled x264 to be run on ARM Cortex A8 processor.
However, when I run the encode, I get a bus error, that is program
receives SIGBUS.
[libx264 @ 0x8abfc0]using cpu capabilities: none!
[libx264 @ 0x8abfc0]profile Baseline, level 1.2
Bus Error
</pre>
</blockquote>
<pre wrap=""><!---->
You seem to be using x264 through FFmpeg. Does it work standalone?
Does the FFmpeg build work for other codecs?
</pre>
</blockquote>
Yes, running it from ffmpeg, I am using H.264 decoder from it, so I
decided to use its encoder interface as well. Please take a look at the
gdb output and let me know if I must run X264 outside ffmpeg.<br>
<blockquote cite="mid:yw1xocwf7prc.fsf@thrashbarg.mansr.com" type="cite">
<pre wrap=""></pre>
<blockquote type="cite">
<pre wrap="">Further debugging shows that bus error occurs in encoder/set.c at
bs_write_ue( s, sps->i_log2_max_poc_lsb - 4 );
Some alignment issue for data location sps->i_log2_max_poc_lsb - 4 ?
</pre>
</blockquote>
<pre wrap=""><!---->
The Cortex-A8 processor supports unaligned accesses for most
instructions. I don't see anything in the code that looks likely to
cause problems. Can you provide some gdb output from the crash?
Specifically, run these commands:
bt
info registers
disas $pc-64 $pc+64
</pre>
</blockquote>
<br>
Here it is using gdbserver:<br>
<a class="moz-txt-link-abbreviated" href="mailto:zkhan@halibut:~/Desktop/gdb-6.8/gdb$">zkhan@halibut:~/Desktop/gdb-6.8/gdb$</a> ./gdb<br>
GNU gdb 6.8<br>
Copyright (C) 2008 Free Software Foundation, Inc.<br>
License GPLv3+: GNU GPL version 3 or later
<a class="moz-txt-link-rfc2396E" href="http://gnu.org/licenses/gpl.html"><http://gnu.org/licenses/gpl.html></a><br>
This is free software: you are free to change and redistribute it.<br>
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"<br>
and "show warranty" for details.<br>
This GDB was configured as "--host=i686-pc-linux-gnu
--target=arm-eabi-linux-gnu".<br>
Setting up the environment for debugging gdb.<br>
<br>
No symbol table is loaded. Use the "file" command.<br>
(gdb) file /home/zkhan/workspace/vid/exe<br>
Reading symbols from /home/zkhan/workspace/vid/exe...done.<br>
(gdb) target remote 172.16.100.21:10000<br>
Remote debugging using 172.16.100.21:10000<br>
0x00008120 in _start ()<br>
(gdb) b main<br>
During symbol reading, DW_AT_name missing from DW_TAG_base_type.<br>
During symbol reading, unsupported tag: 'DW_TAG_const_type'.<br>
Breakpoint 1 at 0x8b14: file videncdec.c, line 35.<br>
(gdb) c<br>
Continuing.<br>
<br>
Breakpoint 1, main () at videncdec.c:35<br>
35 avcodec_init();<br>
(gdb) c<br>
Continuing.<br>
<br>
Program received signal SIGBUS, Bus error.<br>
0x003f6270 in x264_sps_write (s=<br>
During symbol reading, incomplete CFI data; unspecified registers
(e.g., r0) at 0x3f575c.<br>
0x8abb88, sps=0x8abbc8) at ./common/bs.h:123<br>
123 *(uint32_t*)s->p = endian_fix( s->cur_bits );<br>
(gdb) info registers<br>
r0 0x0 0<br>
r1 0xab0cc042 2869739586<br>
r2 0xc000 49152<br>
r3 0xc0000 786432<br>
r4 0x8abb88 9091976<br>
r5 0x3 3<br>
r6 0x8abbc8 9092040<br>
r7 0x3 3<br>
r8 0x5 5<br>
r9 0x4026b008 1076277256<br>
r10 0x0 0<br>
r11 0xbea439dc 3198433756<br>
r12 0x401251ff 1074942463<br>
sp 0xbea43870 0xbea43870<br>
lr 0x3 3<br>
pc 0x3f6270 0x3f6270 <x264_sps_write+2840><br>
fps 0x0 0<br>
cpsr 0x60000010 1610612752<br>
(gdb) bt<br>
#0 0x003f6270 in x264_sps_write (s=0x8abb88, sps=0x8abbc8)<br>
at ./common/bs.h:123<br>
During symbol reading, DW_AT_type missing from DW_TAG_subrange_type.<br>
#1 0x003a8504 in x264_encoder_encode (h=0x8ab6c0, pp_nal=0x8ab6c0, <br>
pi_nal=0x10, pic_in=<value optimized out>, pic_out=0xbea439f8)<br>
at encoder/encoder.c:1579<br>
#2 0x00283574 in X264_frame (ctx=<value optimized out>,
buf=0x4026b008 "", <br>
bufsize=202752, data=<value optimized out>) at
libavcodec/libx264.c:91<br>
#3 0x0000d8f0 in avcodec_encode_video (avctx=0x8aafc0, <br>
buf=0xab0cc042 <Address 0xab0cc042 out of bounds>,
buf_size=202752, <br>
pict=0x8dfba0) at libavcodec/utils.c:495<br>
#4 0x0000955c in H264_encode (obj_ptr=0xbea43a20, out_ptr=0x4026b008, <br>
in_ptr=0x40245008, len=202752) at h264.c:129<br>
#5 0x00008c54 in main () at videncdec.c:82<br>
(gdb) disas $pc-64 $pc+64<br>
Dump of assembler code from 0x3f6230 to 0x3f62b0:<br>
0x003f6230 <x264_sps_write+2776>: rsb r3, r0, r1<br>
0x003f6234 <x264_sps_write+2780>: str r3, [r4, #16]<br>
0x003f6238 <x264_sps_write+2784>: b 0x3f6668
<x264_sps_write+3856><br>
0x003f623c <x264_sps_write+2788>: rsb r0, r1, r0<br>
0x003f6240 <x264_sps_write+2792>: ldr r2, [r4, #12]<br>
0x003f6244 <x264_sps_write+2796>: lsl r2, r2, r1<br>
0x003f6248 <x264_sps_write+2800>: orr r2, r2, r7, lsr r0<br>
0x003f624c <x264_sps_write+2804>: ldr r12, [r4, #4]<br>
0x003f6250 <x264_sps_write+2808>: lsl r1, r2, #24<br>
0x003f6254 <x264_sps_write+2812>: add r1, r1, r2, lsr #24<br>
0x003f6258 <x264_sps_write+2816>: lsl r3, r2, #8<br>
0x003f625c <x264_sps_write+2820>: and r3, r3, #16711680
; 0xff0000<br>
0x003f6260 <x264_sps_write+2824>: add r1, r1, r3<br>
0x003f6264 <x264_sps_write+2828>: lsr r2, r2, #8<br>
0x003f6268 <x264_sps_write+2832>: and r2, r2, #65280 ;
0xff00<br>
0x003f626c <x264_sps_write+2836>: add r1, r1, r2<br>
0x003f6270 <x264_sps_write+2840>: str r1, [r12]<br>
0x003f6274 <x264_sps_write+2844>: ldr r3, [r4, #4]<br>
0x003f6278 <x264_sps_write+2848>: add r3, r3, #4 ; 0x4<br>
0x003f627c <x264_sps_write+2852>: str r3, [r4, #4]<br>
0x003f6280 <x264_sps_write+2856>: str r5, [r4, #12]<br>
<br>
Thanks<br>
Zubair Khan<br>
</body>
</html>