Android TV Core Dump analysis

Source: Internet
Author: User

Test a bug, the operation of the DTMB channel when the system restarts, because the core dump file generated, so first look at the core dump.

One. To debug a core dump, you first generate a core dump, which generally requires the following settings only if the binaries generated by the C + + compiler crashes before the core dump is generated.

1)

Run Ulimit-c Unlimited

----> To be unlimited, this represents the core dump file size, which is 0 by default, i.e. no core dump is generated

2) Set the core dump file path and file name format,

Run

echo '%e.core.%p ' >/proc/sys/kernel/core_pattern

Where%e represents the program name,%p represents the process number

3) Some people say that to shut down the Android watch dog (which I'm not sure is affected), we're shutting down in Factory mode, and other Android TVs or mobile phones don't know where to turn off.

Command 1) is run every time the boot, if it is troublesome, you can write the command to the Initrc file. Because it is in the boot.img, the version needs to be re-burned.



Two. Preparatory work

To debug core dump you need to meet two points first

1th) need to know which program crashed the resulting core dump

Method One, run file coredump.gz

Results

Coredump.gz:ELF 32-bit LSB Core file ARM, version 1 (SYSV), Svr4-style, from '/applications/bin/tvos'

See, is the tvOS program, the path in the TV Falsh/applications/bin/under

Method Two

Run

Arm-none-linux-gnueabi-gdb/bin/ls ~/coredump.gz

The results are as follows

.............

[New LWP 3129]
[New LWP 3956]
[New LWP 1724]
[New LWP 1746]
Core is generated by '/applications/bin/tvos'.
Program terminated with signal 6, aborted.
#0 0x4120d976 in?? ()
(GDB)

Also shown is the tvos program .

i) Here we used a little trick, the first random write a path to the program, for example, we wrote above is/bin/ls, then GDB opens, will tell us, this core dump file is/applications/bin/tvos generated.

II)ARM-NONE-LINUX-GNUEABI-GDB is the program to debug the core, this is provided to us by the manufacturer. From the name can be seen, our board with the CPU is arm.


2nd)

The binary program that we need is tvOS with debug information, which is published without the symbol table, because the symbol table increases the size of the program volume. I used to debug the binary program without the symbol table, so dead or alive can not play out the stack.

Generally to find binary programs are in the symbol directory,

Like what

[Email protected]:~/a71s/e6700_a71s_update_gridui_svn2261_20150318/trunk/supernova$ find-name tvOS
./develop/include/tvos
./core/muf/tvos
./target/europe_dtv.edison/tmp_image/tvservice/applications/bin/tvos
./projects/symbols/applications/bin/tvos
./projects/tvos
./projects/tvos/main/bin.edison/tvos

See,./projects/symbols/applications/bin/tvos This is the symbol table with debug information, in the symbols directory.

If you do not rest assured, you can run the command by command Readelf-s tvOS (S is uppercase)

Results

BSS nobits 007af000 79eeac 06b374 0 0 4096
[25]. Arm.attributes Arm_attributes 00000000 79eeac 000031 00 0 0 1
[+]. mmodule_version Progbits 00000000 79eedd 0008b2 00 0 0 1
Comment Progbits 00000000 79f78f 00002a MS 0 0 1
[Debug_aranges]. Progbits 00000000 79f7c0 020608 00 0 0 8
[]. debug_pubnames Progbits 00000000 7bfdc8 159e85 00 0 0 1
[Debug_info]. Progbits 00000000 919c4d c359c7 00 0 0 1
[+]. Debug_abbrev Progbits 00000000 154f614 0aef1e 00 0 0 1
[+]. Debug_line Progbits 00000000 15fe532 1e159f 00 0 0 1
[Debug_frame Progbits 00000000 17dfad4 0ad6c4 00 0 0 4
Debug_str Progbits 00000000 188d198 38d683 MS 0 0 1
[]. debug_loc Progbits 00000000 1c1a81b 44c65c 00 0 0 1
[+]. Debug_pubtypes Progbits 00000000 2066e77 05984d 00 0 0 1
[PNS]. debug_ranges Progbits 00000000 20c06c4 10bf38 00 0 0 1
[Shstrtab]. Strtab 00000000 21CC5FC 000198 00 0 0 1
[Symtab]. Symtab 00000000 21CCDFC 17a820 10 40 61050 4
[Strtab]. Strtab 00000000 234761c 1ce257 00 0 0 1
Key to Flags:

See those. Dbug_ the beginning of the paragraph, this is the Debugging Information section.

Three Debug Core Dump

Run command

1) cd/home/pengpai/a71s/e6700_a71s_update_gridui_svn2261_20150318/trunk/supernova/projects/symbols/ Applications/bin ---> Under the path to the tvOS program

2) arm-none-linux-gnueabi-gdb./tvos ~/coredump.gz

3) After entering GDB, run btto view the stack at that time

Results

(GDB) bt
#0 0x4120d976 in?? ()
#1 0x4121d0d2 in?? ()
BackTrace Stopped:frame did not save the PC


4) Set solib-absolute-prefix/home/pengpai/a71s/e6700_a71s_update_gridui_svn2261_20150318/trunk/supernova/ projects/symbols/

5)Set solib-search-path/home/pengpai/a71s/e6700_a71s_update_gridui_svn2261_20150318/trunk/supernova/ Projects/dfbinfo/lib.edison
4) and 5) is the path to set the search so library, and GDB runs the info info sharedlibrary to see which so is not loaded in

6) bt

Results




#0 0x4120d976 in __libc_do_syscall ()
from/home/pengpai/a71s/e6700_a71s_update_gridui_svn2261_20150318/trunk/supernova/projects/symbols/lib/ Libc.so.6
#1 0x4121d0d2 in Raise () from/home/pengpai/a71s/e6700_a71s_update_gridui_svn2261_20150318/trunk/supernova/projects /symbols/lib/libc.so.6
#2 0x4121fff0 in Abort () from/home/pengpai/a71s/e6700_a71s_update_gridui_svn2261_20150318/trunk/supernova/projects /symbols/lib/libc.so.6
#3 0x0011a058 in Comparedvb (Stprograminfoa=<value optimized out>, Stprograminfob=<value optimized out>)
At./middleware/src/mw_dtv_program_dvb.cpp:600
#4 0x00108414 in std::__move_median_first<__gnu_cxx::__normal_iterator<_dvb_programinfo*, std::vector<_ Dvb_programinfo, std::allocator<_dvb_programinfo> >, unsigned char (*) (_dvb_programinfo const&, _DVB _programinfo const&) > (__a= ..., __b= ..., __c= ...,
__comp=0x119d5c <comparedvb (St_dvb_programinfo const&, St_dvb_programinfo const&) >)
at/opt/arm-2010.09/bin/. /LIB/GCC/ARM-NONE-LINUX-GNUEABI/4.5.1/. /.. /.. /.. /arm-none-linux-gnueabi/include/c++/4.5.1/bits/stl_algo.h:108
#5 0x00108564 in __unguarded_partition_pivot<__gnu_cxx::__normal_iterator<_dvb_programinfo*, std::vector< _dvb_programinfo, std::allocator<_dvb_programinfo> >, unsigned char (*) (_dvb_programinfo Const&, _ Dvb_programinfo const&) > (__first= ..., __last=<value optimized out>, __depth_limit=7,
__comp=0x119d5c <comparedvb (St_dvb_programinfo const&, St_dvb_programinfo const&) >)
at/opt/arm-2010.09/bin/. /LIB/GCC/ARM-NONE-LINUX-GNUEABI/4.5.1/. /.. /.. /.. /arm-none-linux-gnueabi/include/c++/4.5.1/bits/stl_algo.h:2260
#6 std::__introsort_loop<__gnu_cxx::__normal_iterator<_dvb_programinfo*, Std::vector<_dvb_programinfo, std::allocator<_dvb_programinfo> >, int, unsigned char (*) (_dvb_programinfo const&, _dvb_programinfo const&) > (__first= ..., __last=<value optimized out>, __depth_limit=7,
__comp=0x119d5c <comparedvb (St_dvb_programinfo const&, St_dvb_programinfo const&) >)
at/opt/arm-2010.09/bin/. /LIB/GCC/ARM-NONE-LINUX-GNUEABI/4.5.1/. /.. /.. /.. /arm-none-linux-gnueabi/include/c++/4.5.1/bits/stl_algo.h:2302
#7 0x0052ae68 in sort<__gnu_cxx::__normal_iterator<_dvb_programinfo*, Std::vector<_dvb_programinfo, std:: allocator<_dvb_programinfo> >, unsigned char (*) (_dvb_programinfo const&, _dvb_programinfo const &) > (this=0xf040b0)
at/opt/arm-2010.09/bin/. /LIB/GCC/ARM-NONE-LINUX-GNUEABI/4.5.1/. /.. /.. /.. /arm-none-linux-gnueabi/include/c++/4.5.1/bits/stl_algo.h:5250
#8 Mw_dtv_cm_db<_dvb_programinfo, _dvb_muxinfo, St_dvb_sat_info, St_dvb_network_info>::sort (this=0xf040b0)
At/home/pengpai/a71s/e6700_a71s_update_gridui_svn2261_20150318/trunk/supernova/projects/msrv/common/middleware /inc/mw_dtv_cm_db.h:2358
#9 0x005690b0 in Mw_dtv_cm_dvb::P rogrammove (this=0x67fbd0, U32progsourceindex=<value optimized out>, U32progtargetindex=<value optimized out>)
At./middleware/src/mw_dtv_cm_dvb.cpp:960
#10 0x000e521c in Msrv_dtv_player_dvb::D oprogmove (This=<value optimized out>, U32sourceprogindex=<value Optimized Out>
U32targetprogindex=<value optimized out>) at./src/msrv_dtv_player_dvb.cpp:2377


look at the 600 lines of/middleware/src/mw_dtv_program_dvb.cpp , where there is an assert. This is a vendor-owned file. We can't change it, and then we look at the commit record,

----------------------------------------
r2261 | jiang.t | 2015-01-26 09:53:10 +0800 (one, 2015-01-26) | 1 rows

Jiangt: Add Changzhou, Pizhou, Shanghai Custom City sorting function, from Tri Zhenyu
----------------------------------------

Found in January when someone submitted, also just modified this code, it seems to be the reason, first back, then ask the author of the reasons for the original submission.


Android TV Core Dump analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.