summaryrefslogtreecommitdiff
path: root/src/crash-stack
AgeCommit message (Collapse)AuthorFilesLines
2017-09-18Fix vulnerabilitiessubmit/tizen_4.0/20170918.052155accepted/tizen/4.0/unified/20170920.081345Sunmin Lee1-3/+3
Change-Id: Ia7d8565ef86cfef9d8b61e2e11020b6f1b49ed1d Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2017-08-11Apply ASLR to executables: crash-pipe, crash-stacksubmit/tizen_4.0/20170828.110004submit/tizen_4.0/20170828.100004submit/tizen/20170815.230002accepted/tizen/unified/20170818.083111accepted/tizen/4.0/unified/20170829.020423Sunmin Lee1-0/+3
Change-Id: Ia4a0452832a705f6fbac8034d7da93297883e4bc Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2017-05-16crash-stack: Fix Tizen Coding Style violationstizen_4.0.m1_releasesubmit/tizen/20170517.000458accepted/tizen/unified/20170517.014336Karol Lewandowski1-136/+146
Rules at: https://wiki.tizen.org/wiki/Native_Platform_Coding_Idiom_and_Style_Guide This commit brings no functional changes. Change-Id: Ic95fd2d1e5508d602fa24ea33933448c52ce625d
2017-05-11crash-stack: Change "ThreadID" heuristic to work on aarch64Karol Lewandowski1-1/+1
Commit 82e3caa86 ("crash-stack: Find crashed tid by wchan") introduced heuristic method of finding correct thread id, if it was not passed by the kernel as parameter to crash-manager. This commit modifies this heuristic to also consider "pipe_wait" function in kernel to signify crashed thread. This is what was observed to be true on aarch64. Change-Id: Iefa6d028f459ff9491f8e184433f913f39a096eb
2017-04-18Merge branch 'tizen_3.0'Karol Lewandowski1-2/+3
This commit brings followings fixes from tizen_3.0 branch: - Fallback to ptrace call-stack unwinder if sys-assert failed - libunwind: Fix off by one in _create_crash_stack - sys-assert: Fix handle leak of mmap Change-Id: I422c4ddff0fb4dfb72738d70a7170080304081dd
2017-04-14crash-stack: Eliminate now-deprecated readdir_rKarol Lewandowski1-6/+5
This commit fixes build break with new toolchain. Glibc 2.24 deprecated readdir_r() - readdir() now recommended even for multithreaded programs. This commit fixes following error: /home/abuild/rpmbuild/BUILD/crash-worker-1.0.0/src/crash-stack/crash-stack.c: In function 'find_crash_tid': /home/abuild/rpmbuild/BUILD/crash-worker-1.0.0/src/crash-stack/crash-stack.c:891:4: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations] while (readdir_r(dir, &entry, &dentry) == 0 && dentry) { ^~~~~ Change-Id: I99f22a0de87f2539988e1669ae2149dcac74a4df
2017-03-08libunwind: Fix off by one in _create_crash_stackKarol Lewandowski1-2/+3
This fixes call stack missing last element (usually _start, in the case of invalid PC - the PC itself). Change-Id: Ib1dae12bd06f1a4dfa1339fa6ea704bff05926c9
2017-02-24Merge branch 'tizen_3.0' into tizenSunmin Lee5-377/+188
Change-Id: I56715923d0ac0257736598e711d2c113548372cb
2017-02-21Fix vulnerabilitysubmit/tizen_3.0/20170221.053734accepted/tizen/3.0/wearable/20170222.082710accepted/tizen/3.0/tv/20170222.082659accepted/tizen/3.0/mobile/20170222.082645accepted/tizen/3.0/ivi/20170222.082717accepted/tizen/3.0/common/20170222.125537Sunmin Lee1-2/+5
- Enforce read size of read() less than buffer - Do null check about opened bufferfile Change-Id: Ie7d43eb1b04e68e03e97d5e9fed75aee669bfd0a Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2017-02-20crash-stack: Get executable name from cmdlineSunmin Lee1-3/+11
The executable name in crash-stack is different with sys-assert. In case of some applications, "exe" has indicated real path of app that makes it hard to know what the actual app name is. It's better to refer to "cmdline" instead. Change-Id: I4895dbce427d50cd20a593585f2640554a4268fc Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2017-02-17Print pre-ptrace info to buffer fileSunmin Lee1-32/+71
Some information had lost after ptrace. However, the order of info also should be preserved. To resolve this, that information are going to be printed to temporal space first and will be merged in result file. Change-Id: I523ded4ffc15b5edeac1944b62b5a42a5a44bc83 Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2017-02-17crash-stack: Find crashed tid by wchanSunmin Lee1-1/+80
If tid is not offered by kernel, crash-stack would find crashed tid by checking wchan value of each thread. Change-Id: Idfd6866fe17af4c7a266b3ae127e39087b0848f0 Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2017-02-02crash-stack: Make output match sys-assert reportŁukasz Stelmach1-1/+1
Change-Id: I7ecc9b045cc9b83d328d1d97bb08d4174c9d72ba
2017-02-02crash-stack: remove the core dump handling remainsAdrian Szyndela5-333/+14
Hopefully, there is no more rotting flesh. Change-Id: I59003e8a38dd2817f78d23319848273615a0a5be
2017-02-02crash-stack: add file offset to outputAdrian Szyndela2-1/+6
Change-Id: Ib9f77b61d98a60e192877fad965a30ad8730af2f
2017-02-02crash-stack: disable unw_get_proc_name predictionRafal Pietruch1-6/+2
libunwind unw_get_proc_name function may return the name of a label or a preceeding, nearby procedure; although the value of the returned name plus the returned offset will be equal to the instruction-pointer of the stack frame, developers can find a exact symbol with related code position in debug packages Change-Id: I2471c2a9483b577844110f25128a6d539d39e5ad
2017-01-18(Modified) Deal with Toolchain upgradesubmit/tizen_unified/20170308.100409submit/tizen/20170118.071648accepted/tizen/wearable/20170118.223022accepted/tizen/unified/20170309.033723accepted/tizen/tv/20170118.223006accepted/tizen/mobile/20170118.222949accepted/tizen/ivi/20170118.223040accepted/tizen/common/20170118.174031accepted/tizen_wearableaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_iviaccepted/tizen_commonSunmin Lee1-2/+1
(Revert "Deal with Toolchain upgrade") This patch substitutes deprecated function "readdir_r" with "readdir" rather than ignoring warning. Change-Id: I3b4d3f9c28cc60c851f30332aa88780078471085 Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2016-12-28Fix vulnerabilitysubmit/tizen_3.0/20161228.020839Sunmin Lee1-1/+6
Check range of signo before use it Change-Id: Icae63a7185a897ba6688b45715b208c2d92df1b7 Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2016-12-27crash-stack: libunwind used on aarch64Kunhoon Baik2-43/+11
Make use of "ptrace: Add support for GETREGSET" patch to libunwind https://lists.nongnu.org/archive/html/libunwind-devel/2016-07/msg00001.html Depends-On: I2e720e6697fbc1facf1d7547b398f5665b17731e Change-Id: I0ce3886d271c9b78d2a44b99a628ccc502e6e400
2016-12-27crash-stack: Simplify signal infoSunmin Lee1-31/+14
It is hard to get signal info which caused dump using ptrace. Therefore, crash-stack prints signal number only which came from core_pattern. Change-Id: I6cd865a89d3e2c5dd83cfe134bb8cddec4f7f81f Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2016-12-22Fix handle leaksubmit/tizen_3.0/20161222.232700submit/tizen_3.0/20161222.092901accepted/tizen/3.0/wearable/20161223.082240accepted/tizen/3.0/tv/20161223.082234accepted/tizen/3.0/mobile/20161223.082230accepted/tizen/3.0/ivi/20161223.082249accepted/tizen/3.0/common/20161223.110758Sunmin Lee1-1/+3
Fix handle leak of file pointer at crash-stack Change-Id: I2d68e04ad84ea7263e3c45cc91ef295557532bde Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
2016-12-20Merge "crash-stack: use libunwind for i686 and x86_64" into tizen_3.0Karol Lewandowski5-257/+30
2016-12-20Merge "crash-stack: fixed attaching to thread" into tizen_3.0Karol Lewandowski1-28/+23
2016-12-20crash-stack: use libunwind for i686 and x86_64Rafal Pietruch5-257/+30
Change-Id: I0022cc3ac772ba26ed67f7d64d45c3ab4e22db88
2016-12-20crash-stack: fixed attaching to threadAdrian Szyndela1-28/+23
It is not necessary to attach to parent process main thread to resolve stack in another thread. This commit also solves hanging up on 'D' (and 'Z') processes - main thread is not attachable, when a crash occurs in another thread. Change-Id: Ic3a085951acb4057fcdd4a476693954d1d3a522b
2016-12-20crash-stack: deprecate corefile optionSunmin Lee1-249/+10
crash-stack should be able to generate call stack using pid only. (Generating corefile causes sluggish issue) Change-Id: Ie9e74494b966838d1dd6548424d51bfd2df4c1e0
2016-12-15crash-stack: get registers from tid instead of pidAdrian Szyndela1-2/+2
Change-Id: Id4ea3f57808420ec6ac0941c2612a5af51136c96
2016-12-15crash-stack: work around hanging up on 'D' processesAdrian Szyndela1-0/+72
Processes in uninterruptible sleep state ('D' status in ps) cannot be ptraced until they leave the state. To prevent hanging up of crash-stack, we check the target process state. If it is 'D', then we give up ptracing it, and instead print the information from /proc/<pid>/wchan, /proc/<pid>/syscall and /proc/<pid>/stack. Change-Id: I82644051a5499c42db2a8e51a7af98693e8da363
2016-12-14crash-stack: Drop duplicate call stack footerKarol Lewandowski1-1/+0
Change-Id: I938f2ead95d312450edb853740cce47becf796fc
2016-12-14crash-stack: print memory informationŁukasz Stelmach1-1/+74
Print information from /proc/meminfo and /proc/PID/status Change-Id: I6c66e9ee6c8eca20a8925e9ecc23e09c0dabcb25
2016-12-14crash-stack: change error reporting file handleŁukasz Stelmach1-3/+3
Change-Id: I734b431f56f9e32c440839e1bd4e5b90112773ec
2016-12-14crash-stack: print maps informationŁukasz Stelmach1-18/+211
Print information about mapped memory regions. Add stub for printing system and process VM information. Change-Id: I47b2c5f837620f9d22b3270a75d8f5e663d44c78
2016-12-14crash-stack: print executable file pathŁukasz Stelmach1-1/+19
Change-Id: Ib5946bcfb5bbad8af7b7bbfc7c8568a3cb3ab207
2016-12-14crash-stack: support for resolving stack from threadsAdrian Szyndela1-7/+16
Change-Id: Ic80b6b83acb80b3c332b6b6674fbf662b1003586
2016-12-14crash-stack: put more effort into getting namesAdrian Szyndela1-104/+93
It seems libdwfl-0.153 sometimes can't get symbol names automatically. This commit adds fallback procedure, that takes module name and mapping provided by libdwfl, and - using libelf - looks for the symbol name, instead of relying only on libdwfl. Change-Id: I7e65f810b46dc43bea217b715852a5ae5c3d70c9
2016-12-14crash-stack: reformat callstack outputRafal Pietruch3-19/+32
Change-Id: Ica727d63de389d8a4a2f1ff7cfced2a463630282
2016-12-14crash-stack: resolving symbols extracted from printing functionRafal Pietruch5-61/+153
Change-Id: I0ae01bc7a2a9a0e6f084a9e275e1025058645c77
2016-12-14crash-stack: print information about threadsŁukasz Stelmach1-5/+59
Change-Id: Ib0e2d9c2bdbd5fd4eacc0608a8c5ecccdfd4f2a8
2016-12-14crash-manager: pass tid number to identify failing threadŁukasz Stelmach1-0/+6
Accept tid as second argument for crash-manager and pass it to crash-stack. Change-Id: Icfc0db6f5675eb781777ea7a7c5dc2d4cb581105
2016-12-13crash-stack: align output format with sys-assertŁukasz Stelmach5-111/+138
Make crash-stack print register information the very same way as sys-assert does it. Change output format slightly for 64 bit architectures to match hw requirements. Support both i686 and x86_64 in the same architecture specific file. Change-Id: Ica03360b61c1aa133b83c5622334cf4f375db3c2
2016-12-13Update authorship informationŁukasz Stelmach5-4/+9
Change-Id: I064948790ce22c0167ce6986a4d0a0e78fd974ab
2016-12-13crash-stack: separate libunw codeRafal Pietruch3-55/+81
Change-Id: I1f24781316a78439db862c3ab0d2492fea095c1c
2016-12-13crash-stack: add symbol resolution for armRafal Pietruch3-25/+59
Change-Id: Iabb556a96907156a9b8775cdb25281dea560ce69
2016-12-13use libunwind for ARM in case of McTernan unwinderRafal Pietruch23-5417/+42
Change-Id: I6fb6f95df6f09a1b4c7e38489606aaab1e452e59
2016-12-13Resolve crash-stack build issue in emulatorsubmit/tizen_3.0/20161213.043921accepted/tizen/3.0/wearable/20161213.064912accepted/tizen/3.0/tv/20161213.064858accepted/tizen/3.0/mobile/20161213.064846accepted/tizen/3.0/ivi/20161213.064926accepted/tizen/3.0/common/20161213.164254Kunhoon Baik2-3/+9
32 bit: Add stub function for _crash_stack_print_regs 64 bit: correct output format specifier Change-Id: I4d95ab2ebee9c86a4fa05015f6ca5b3ccc8ea151
2016-12-08crash-stack: report on siginfo_tŁukasz Stelmach1-3/+3
Change-Id: I86e8058eded47f23c51d213fffb56f2f078931bc
2016-12-08crash-stack: Print signal informationŁukasz Stelmach1-0/+49
Change-Id: Ia6d535d1d229dbc55aafd6b50529062e63b411ff
2016-12-08crash-stack: link against libebl conditionallyŁukasz Stelmach1-1/+2
Link against libebl only if crash-stack is built with support for core dump files. Rewrite conditional building of sys_assert to use %bcond_with. Change-Id: I50edbd417a5426a43da3b9c0e912933a7db95f4b
2016-12-08crash-stack: Print register valuesŁukasz Stelmach6-1/+91
Change-Id: If8d82aa32eb524ffb23715af6016f0fec12bd144
2016-12-08Fixed coding style & added doxygen docsAdrian Szyndela10-157/+2995
This fixes and adds again commit 11c142a267540ee070db0c8c1dc47c022edd02a6. Thus, this reverts commit 7ec36fc1820b0b3622f0c1d941439e906a4603ff which reverted commit 11c142a267540ee070db0c8c1dc47c022edd02a6. Change-Id: I944d1e9a664cbc38e84853f9a67b093ecb68754b