platform/core/system/crash-worker.git
5 years agoCopy /proc/<pid>/maps file to temporary directory 81/184381/3
Mateusz Moscicki [Tue, 17 Jul 2018 08:30:31 +0000 (10:30 +0200)]
Copy /proc/<pid>/maps file to temporary directory

To save as much time as possible, we can parse maps file when coredump
is already saved and process is probably cleaned up.

Change-Id: I136d1c462fe2fe9c204deea09b1d0269cee32530

5 years agoAdd checking if CRASH_ROOT_PATH exists 18/183918/4
Mateusz Moscicki [Thu, 14 Jun 2018 11:18:22 +0000 (13:18 +0200)]
Add checking if CRASH_ROOT_PATH exists

When system booting, /opt may not be mounted yet. In this case if any
program will crash, the crash-manager will wait about 60 seconds for
/opt. After this time the the crash report will be lost.

Change-Id: I97e9541262d1a0f9844aa260ac23972f70e27638

5 years agoReturn exit code of the program invoked by run_command_write_fd_timeout() 17/183917/1
Mateusz Moscicki [Mon, 2 Jul 2018 07:02:31 +0000 (09:02 +0200)]
Return exit code of the program invoked by run_command_write_fd_timeout()

Change-Id: Ib7f046aed8ca352463d6ba7559f947e487ad85b8

6 years agoFix reading /proc/<pid>/maps file 95/182995/2 accepted/tizen/unified/20180703.163701 submit/tizen/20180629.144736
Mateusz Moscicki [Fri, 29 Jun 2018 11:31:38 +0000 (13:31 +0200)]
Fix reading /proc/<pid>/maps file

Macro is expanded by preprocessor, but sizeof() is evaluated at compile time.

Change-Id: I4ca20ff703cf89fba2137ec3eb24550d1013fdff

6 years agopackaging: Fix minicoredumper path 92/181892/1 accepted/tizen/unified/20180619.141919 accepted/tizen/unified/20180622.122638 submit/tizen/20180618.153418 submit/tizen/20180621.090427
Karol Lewandowski [Mon, 18 Jun 2018 14:44:01 +0000 (16:44 +0200)]
packaging: Fix minicoredumper path

Change-Id: I5a57f9a3c0272ebed534aee7edd88d2c2f362b89

6 years agoRelease crash-worker with minicoredumper 87/181887/1 submit/tizen/20180618.131239
Karol Lewandowski [Mon, 18 Jun 2018 13:06:06 +0000 (15:06 +0200)]
Release crash-worker with minicoredumper

Change-Id: Ie72ab3379f50174e1c76c79da5af56cb8aaed5ad

6 years agocrash-manager: add minicoredumper 75/170975/13
Mateusz Moscicki [Thu, 22 Feb 2018 09:45:37 +0000 (10:45 +0100)]
crash-manager: add minicoredumper

minicoredumper strips unnecessary data from coredump
and makes use of sparse file mechanism, to quickly save
core files on disc.

Change-Id: Ic8e968b5e7a011f9a06794876c372063e968a354

6 years agoAdd *.so_info file to the report 32/173332/15
Mateusz Moscicki [Tue, 20 Mar 2018 07:43:10 +0000 (08:43 +0100)]
Add *.so_info file to the report

*.so_info file contains paths, rpm package info (name, version, release,
architecture) and build IDs of mapped files that have a execute flag in
/proc/<pid>/maps.

Change-Id: I087a8d25efeb1f51a5e25d95cce5c60a8f2a607b

6 years agoMerge "Add timeout to run_command_write_fd and replace popen by execvpe" into tizen
Karol Lewandowski [Fri, 15 Jun 2018 13:51:28 +0000 (13:51 +0000)]
Merge "Add timeout to run_command_write_fd and replace popen by execvpe" into tizen

6 years agoFix stack-buffer-overflow error 29/181529/1
Mateusz Moscicki [Thu, 14 Jun 2018 10:37:56 +0000 (12:37 +0200)]
Fix stack-buffer-overflow error

Lenghts in sscanf format string refer to actually read bytes, without
including space for null byte, E.g.:

  ...
  char buff[5+1];
  sscanf(other_buff, "%5s", buff);
  ...

Change-Id: I203e1bc04ba1e352029849e5bd29a7a6ca8a5763

6 years agoFix vulnerabilities 28/181528/1
Sunmin Lee [Mon, 18 Sep 2017 04:27:50 +0000 (13:27 +0900)]
Fix vulnerabilities

Change-Id: Ia7d8565ef86cfef9d8b61e2e11020b6f1b49ed1d
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoAdd timeout to run_command_write_fd and replace popen by execvpe 58/179558/6
Mateusz Moscicki [Wed, 16 May 2018 06:23:00 +0000 (08:23 +0200)]
Add timeout to run_command_write_fd and replace popen by execvpe

dump_systemstate runs many external commands. When one hungs,
dump_systemstate will block the crash-worker.

execvpe replaced popen because popen passes command to /bin/sh, and this
can potentially allow to run the malicious command if attacker can
modify the fragment of cmd, e.g:

  void read_file(char *filename)
  {
      ...
      sprintf(buff, "cat %s", filename);
      popen(buff, "r");
      ...
  }

  main()
  {
      char filename[] = "/etc/passwd;rm -rf /";
      read_file(filename);
  }

Change-Id: Id7b37c058869c27d3c4d282d9d2dd30d5b9ec80c

6 years agocrash-pipe: Fix write the coredump to the file 37/180537/1 accepted/tizen/unified/20180614.150754 submit/tizen/20180613.110142
Mateusz Moscicki [Wed, 30 May 2018 11:33:20 +0000 (13:33 +0200)]
crash-pipe: Fix write the coredump to the file

splice returns EINVAL if (loff_t)(len + out.pos) is negative number.
This was the case on aarch64 and x86_64.

Change-Id: Ic52d08efce3fca555a83319c8161c3656b553cc1

6 years agoRevert "crash-pipe: Fix write the coredump to the file" 35/180535/1
Mateusz Moscicki [Wed, 30 May 2018 11:31:21 +0000 (13:31 +0200)]
Revert "crash-pipe: Fix write the coredump to the file"

This reverts commit 70c1372b5a85a64d5ea7c5bb20b99429213942be.

Change-Id: I553b4c6ef2e5aa9cdc80e4d58ecd318dc0a2d532

6 years agoStop setting the PR_SET_DUMPABLE flag for crash-manager processes 97/176597/2
Mateusz Moscicki [Fri, 20 Apr 2018 06:35:39 +0000 (08:35 +0200)]
Stop setting the PR_SET_DUMPABLE flag for crash-manager processes

prctl(PR_SET_DUMPABLE, 0) is not neccessary. Kernel runs the
crash-manager and sets RLIMIT_CORE to 1 for the process. This is special
value that prevents from running crash-manager recursively.

Change-Id: I33df7c28c6ce939f2903d02af673734d473b649e

6 years agoMerge "crash-pipe: Fix write the coredump to the file" into tizen
Karol Lewandowski [Tue, 29 May 2018 08:09:53 +0000 (08:09 +0000)]
Merge "crash-pipe: Fix write the coredump to the file" into tizen

6 years agocrash-pipe: Fix write the coredump to the file 99/180399/1
Mateusz Moscicki [Mon, 28 May 2018 10:46:32 +0000 (12:46 +0200)]
crash-pipe: Fix write the coredump to the file

splice len parameter is size_t type. On some architectures (eg. aarch64)
splice returned EINVAL when the parameter len was ssize_t variable and
was equal SSIZE_MAX

Change-Id: Id84038662dcd2969a33af1e276a3b4500a780f29

6 years agoSet the default DBus policy for send and own to deny 35/178735/2 submit/tizen/20180523.105903
Mateusz Moscicki [Fri, 11 May 2018 13:34:42 +0000 (15:34 +0200)]
Set the default DBus policy for send and own to deny

Change-Id: I49230b5c711cf7c4158f6de2fb448638035d750b

6 years agoFix potentially undefined behavior 09/178009/3 accepted/tizen/unified/20180518.120452 submit/tizen/20180510.103449
Sunmin Lee [Thu, 28 Sep 2017 10:05:07 +0000 (19:05 +0900)]
Fix potentially undefined behavior

The documentation does not describe the behavior of the access()
function for a NULL path argument, which can be returned by mkdtemp()

Change-Id: I9c5c08eb424f5e9bdab248682b00e9cb895c7afa
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
[ Cherry-picked from tizen_4.0 branch, extended commit message ]
Signed-off-by: Mateusz Moscicki <m.moscicki2@partner.samsung.com>
6 years agocrash-manager: don't store in zip archive files referred by symlinks 04/171104/7
Mateusz Moscicki [Mon, 26 Feb 2018 12:22:47 +0000 (13:22 +0100)]
crash-manager: don't store in zip archive files referred by symlinks

minicoredump (will be introduced in next commit) has an option to save
/proc/<pid>/ files in report. As /proc/<pid>/fd/* contains symlinks, the
created archive will contain the contents of these fds. This is
undesirable as files might be quite big and contain private (sensitive)
data.

This commit adds -y option to zip, which will allow storing symlinks to
actual files instead of their contents (as it was available originally
under /proc/<pid>/)"

Change-Id: I0a7c9211eab1acd39da7db3930e967ddab5eceef

6 years agocrash-manager: fix get cmd_path 74/170974/10
Mateusz Moscicki [Thu, 22 Feb 2018 09:40:41 +0000 (10:40 +0100)]
crash-manager: fix get cmd_path

This commit fixes issue with report not being generated for processes
started using a relative path (e.g.: ./test-app).

In above case cmdline contained only './test-app' string and based on
that it was impossible to determine the full path to a binary.
Consequently, crash-manager assumed crashed program binary did not
exist and did not generate the report.

This commit changes the logic as follows:

  cinfo->cmd_name is read from /proc/<pid>/cmdline
  cinfo->cmd_path is read from /proc/<pid>/exe

Change-Id: If1b7557b53417d2703a81644939692fee5c801ee

6 years agoFixed code style 03/171103/2
Mateusz Moscicki [Mon, 26 Feb 2018 07:17:53 +0000 (08:17 +0100)]
Fixed code style

Code has been changed to avoid messages:

  (CODE_SMELL/Warning) Remove this unused "ret" local variable.
  (CODE_SMELL/Warning) Remove this unused "command" local variable.

In addition, the code has been modified to remove unnecessary bracket.

Change-Id: I5bf9820d16f7b7947844e078eba9a1bab11ddd6c

6 years agocrash-stack: fixed copying data from bufferfile to outputfile 73/170973/1
Mateusz Moscicki [Wed, 14 Feb 2018 07:17:02 +0000 (08:17 +0100)]
crash-stack: fixed copying data from bufferfile to outputfile

Reading the last chunk of data sets the feof indicator.

Change-Id: I396a3d6e1c398c7201ef8bc7dfa1ec9c1b7ddb8a

6 years agoImprove error handling 16/153516/5
Michal Bloch [Thu, 28 Sep 2017 14:38:52 +0000 (16:38 +0200)]
Improve error handling

 * handle reallocation failures in scan dump.
 * generate a log if unlinking a failed dump file also fails
 * fix a memory leak when passing duplicate `--save-core` parameter to crash-pipe; generate a log in that case
 * explicitly free a resource on exit

Change-Id: I71b22b3375c6c9ab9a43dab41e80eadc3fa599f6
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "svace fixes: insufficient error handling" into tizen
Karol Lewandowski [Thu, 28 Sep 2017 14:59:53 +0000 (14:59 +0000)]
Merge "svace fixes: insufficient error handling" into tizen

6 years agosvace fixes: insufficient error handling 02/152602/3
Karol Lewandowski [Tue, 26 Sep 2017 11:29:32 +0000 (13:29 +0200)]
svace fixes: insufficient error handling

This commit brings fixes for folowing SVACE-reported issues:

    * UNCHECKED_FUNC_RES.FREAD: Return value of fread function was compared to zero at crash-stack.c:836, but ferror/feof wasn't called.
      Result was compared with zero at /home/abuild/rpmbuild/BUILD/crash-worker-1.0.1/src/crash-stack/crash-stack.c:836

    * HANDLE_LEAK: The handle 'fd' was created at crash-manager.c:508 by calling function 'open' and lost at crash-manager.c:515.
      [acquire] Call of open at /home/abuild/rpmbuild/BUILD/crash-worker-1.0.1/src/crash-manager/crash-manager.c:508
      [leaked] leaked at /home/abuild/rpmbuild/BUILD/crash-worker-1.0.1/src/crash-manager/crash-manager.c:515

    * DEREF_OF_NULL.CONST: Pointer '&tail->next', which was assigned NULL value at crash-stack.c:642, is dereferenced at crash-stack.c:692.
      [dereference] Variable '&tail->next' is dereferenced at /home/abuild/rpmbuild/BUILD/crash-worker-1.0.1/src/crash-stack/crash-stack.c:692
      [null] Assign null at /home/abuild/rpmbuild/BUILD/crash-worker-1.0.1/src/crash-stack/crash-stack.c:642

    * RACE.NO_UMASK: Function 'umask(077)' needs to be called before 'mkstemp' at crash-stack.c:964, to prevent a potential race condition vulnerability.
      function call at /home/abuild/rpmbuild/BUILD/crash-worker-1.0.1/src/crash-stack/crash-stack.c:964

Change-Id: Ief6dd93ec8d795fccffbc2d823a6af8fcf63c965

6 years agodump_systemstate : add journal log 71/153071/3 accepted/tizen/unified/20170928.072303 submit/tizen/20170928.020903
Kichan Kwon [Thu, 28 Sep 2017 01:46:21 +0000 (10:46 +0900)]
dump_systemstate : add journal log

- Log only latest 1024 logs from last boot

Change-Id: I535402a6807d2c4a21fb08a2ba874473f49045f6
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoFix bugs 77/149777/1
Sunmin Lee [Wed, 13 Sep 2017 05:36:18 +0000 (14:36 +0900)]
Fix bugs

- Fix misspelling for m4 condition
- Do not install unused services: tizen-debug-on/off

Change-Id: I09296e1365407c93ebb6dd9897ccc5b9e346bddd
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agoRemove unused file 98/149398/2
Sunmin Lee [Tue, 12 Sep 2017 07:28:52 +0000 (16:28 +0900)]
Remove unused file

Remove unused file

Change-Id: Iabe9ee9e49cf9f4272c3a3691f48f3c75ff0a281
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agolog_dump: assign CAP_SYS_PTRACE capability 84/146884/1
ByungSoo Kim [Mon, 21 Aug 2017 14:24:00 +0000 (23:24 +0900)]
log_dump: assign CAP_SYS_PTRACE capability

When log_dump has system_fw permission,
memps which is forked from /usr/bin/dump_systemstate can't read
/proc/self/maps and /proc/self/smaps.
It requires CAP_SYS_PTRACE capability.
So, it should have CAP_SYS_PTRACE capability and inheritance attribute.

Change-Id: If2bd16964dba8e616e4a4fcc5cd489feb4c40b21
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
6 years agocrash-worker: add dump_systemstate memps 37/146337/2
minsoo kim [Mon, 21 Aug 2017 05:49:32 +0000 (14:49 +0900)]
crash-worker: add dump_systemstate memps

Change-Id: I50fbdc296a0ab8dfab96cfde29b0c3afa94eb1e7
Signed-off-by: minsoo kim <ms203.kim@samsung.com>
6 years agocrash-worker: add supplementarygroups log systemd-journal 88/146488/1
minsoo kim [Mon, 3 Jul 2017 05:04:22 +0000 (14:04 +0900)]
crash-worker: add supplementarygroups log systemd-journal

To gather dlog, journal log, add supplementarygroups to service
But dbus activation not applied suppplementarygroup,
So rearrange service role

org.tizen.system.crash.service : dbus activation
log_dump.service : log_dump daemon

Change-Id: I93e2bb5142a83f6dfa9ad56197916855988501ee
Signed-off-by: minsoo kim <ms203.kim@samsung.com>
6 years agocrash-worker: change permission to none root process 97/139897/5
minsoo kim [Wed, 10 May 2017 02:09:09 +0000 (11:09 +0900)]
crash-worker: change permission to none root process

for reduce root permission, change to system_fw

Change-Id: I04fafa89d2a4e0a1e3bc5a6e0019b2aebb428235
Signed-off-by: minsoo kim <ms203.kim@samsung.com>
6 years agoApply ASLR to executables: crash-pipe, crash-stack 57/143357/2 accepted/tizen/4.0/unified/20170829.020423 accepted/tizen/unified/20170818.083111 submit/tizen/20170815.230002 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004
Sunmin Lee [Wed, 9 Aug 2017 10:38:41 +0000 (19:38 +0900)]
Apply ASLR to executables: crash-pipe, crash-stack

Change-Id: Ia4a0452832a705f6fbac8034d7da93297883e4bc
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
6 years agopackaging: Disable sys-assert 49/130949/2 accepted/tizen/4.0/unified/20170816.011029 accepted/tizen/unified/20170728.195604 submit/tizen/20170727.104559 submit/tizen_4.0/20170811.094300
Karol Lewandowski [Tue, 23 May 2017 13:01:36 +0000 (15:01 +0200)]
packaging: Disable sys-assert

Ptrace-based mechanism (crash-stack) should be used as default
and only mechanism for crash-report generation.

Change-Id: I102fc02e5538dcf9f21d7b72ff8892e1b3500265

7 years agoPreparation of debug & release package 76/135876/3 accepted/tizen/unified/20170629.090140 submit/tizen/20170629.013438
Kunhoon Baik [Tue, 27 Jun 2017 07:07:40 +0000 (16:07 +0900)]
Preparation of debug & release package

Some vendor would like to have different crash management policy for debug and release image.
Thus, Tizen will provide crash-manager debug and release package.
This patch is the preparation for the package separation.

In case of crash-manager debug, following CFLAGS will be enabled.

export CFLAGS+=" -DTIZEN_ENGINEER_MODE"
export CFLAGS+=" -DTIZEN_ENABLE_COREDUMP"

In the future, export CFLAGS+=" -DTIZEN_DEBUG_ENABLE" may be added.

Basically, default Tizen image will include crash management policy for debug mode.

cf) .debugmode file will be used for just crash-popup control for 3.0 compatibility.

Change-Id: I892d1f0d5de65da0abb3e002fa235989f43def56

7 years agolog_dump: selective mode for dbus activation 86/134486/1
minsoo kim [Fri, 26 May 2017 09:58:35 +0000 (18:58 +0900)]
log_dump: selective mode for dbus activation

log_dump running root in debug mode, and none_root with normal mode.
Simplify org.tizen.system.crash.service conditional compile by using m4

Change-Id: I04b734f722266264434b27e9fe7b17cdc73263f1
Signed-off-by: minsoo kim <ms203.kim@samsung.com>
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoAdjust buffer size for address 46/134046/1 submit/tizen/20170616.010939
Sunmin Lee [Fri, 9 Jun 2017 03:58:48 +0000 (12:58 +0900)]
Adjust buffer size for address

The addr gets string of address consisting of begin/end
address and '-', null character.
So the length of addrees buffer should be set to:
 ADDR_LEN * 2 + 2 (at least)

Change-Id: I6cdb8530be50c4c29fbb51a5dcb5fa8e094e5352
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoFix sscanf vulnerability 69/133069/2
Sunmin Lee [Thu, 8 Jun 2017 05:05:57 +0000 (14:05 +0900)]
Fix sscanf vulnerability

Specify a limit on the input string length
and keep the last byte for null character.

Change-Id: I717ac2ae565f2627e5de26426ec24c6ccf772c5e
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agocrash-stack: Fix Tizen Coding Style violations 80/129480/2 accepted/tizen/unified/20170517.014336 submit/tizen/20170517.000458 tizen_4.0.m1_release
Karol Lewandowski [Tue, 16 May 2017 13:25:06 +0000 (15:25 +0200)]
crash-stack: Fix Tizen Coding Style violations

Rules at: https://wiki.tizen.org/wiki/Native_Platform_Coding_Idiom_and_Style_Guide

This commit brings no functional changes.

Change-Id: Ic95fd2d1e5508d602fa24ea33933448c52ce625d

7 years agocrash-stack: Change "ThreadID" heuristic to work on aarch64 37/128837/1
Karol Lewandowski [Thu, 11 May 2017 13:47:18 +0000 (15:47 +0200)]
crash-stack: Change "ThreadID" heuristic to work on aarch64

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

7 years agocrash-worker: Generate core only if /opt/etc/.debugmode file is present 10/128110/1
Karol Lewandowski [Fri, 5 May 2017 13:03:20 +0000 (15:03 +0200)]
crash-worker: Generate core only if /opt/etc/.debugmode file is present

Additionally, this patch moves actual path definition to one place.

Change-Id: I984ac2c67d8a22ed749f2b1945a1cef237b88ace

7 years agoMerge "Removing dependency of tizen-debug-on/off service from sys-assert" into tizen
Karol Lewandowski [Tue, 25 Apr 2017 06:48:19 +0000 (06:48 +0000)]
Merge "Removing dependency of tizen-debug-on/off service from sys-assert" into tizen

7 years agoRemoving dependency of tizen-debug-on/off service from sys-assert 28/123228/2 accepted/tizen/unified/20170426.061702 submit/tizen/20170425.080615
Karol Lewandowski [Mon, 24 Apr 2017 15:34:18 +0000 (17:34 +0200)]
Removing dependency of tizen-debug-on/off service from sys-assert

Tizen-debug-on/off service should control enabling/disabling coredump generation.
When Tizen-debug-off service is executed, only callstack should be generated.

Thus, although disabling sys-assert, the services should be remained.

TODO : For disabling sys-assert, the services should be changed properly.

Change-Id: I617356cd31b51dbe4f103cb3118fefe454e717db

7 years agoMerge "spec: change group(system -> root) on tizen-debug-off.[service|socket]" into...
Karol Lewandowski [Sat, 22 Apr 2017 10:47:35 +0000 (10:47 +0000)]
Merge "spec: change group(system -> root) on tizen-debug-off.[service|socket]" into tizen

7 years agospec: change group(system -> root) on tizen-debug-off.[service|socket] 76/126076/1
INSUN PYO [Thu, 20 Apr 2017 05:09:37 +0000 (14:09 +0900)]
spec: change group(system -> root) on tizen-debug-off.[service|socket]

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I32605d431b3ff16cce61ae2dde7be262a1eac56f

7 years agocrash-pipe: Drop all reporting functionality 48/125748/1
Karol Lewandowski [Wed, 15 Mar 2017 15:43:03 +0000 (16:43 +0100)]
crash-pipe: Drop all reporting functionality

Reporting is handled by crash-stack.

Change-Id: I6066c5a414fd2e98efbcc0ddc57f2f967cbfb859

7 years agocrash-pipe: Introduce option to copy core using splice(2) 47/125747/1
Karol Lewandowski [Wed, 15 Mar 2017 15:39:51 +0000 (16:39 +0100)]
crash-pipe: Introduce option to copy core using splice(2)

Linux splice(2) avoids user-space copy and is effectively faster than
regular read(2) + write(2).

According to (ftrace) test below splice is about 20% faster.

  sysctl -w kernel.core_pattern='|/usr/libexec/core-pipe --save-core /opt/usr/share/temp/core.%p'
  cd /sys/fs/kernel/tracing/
  echo do_coredump > set_ftrace_filter
  echo function_graph > current_tracer
  cat trace_pipe

/* splice */

 2) $ 2183078 us |  } /* do_coredump */
 4) $ 2127946 us |  } /* do_coredump */
 1) $ 2377004 us |  } /* do_coredump */
 1) $ 2088114 us |  } /* do_coredump */

/* read/write */
 1) $ 3088297 us |  } /* do_coredump */
 1) $ 2953330 us |  } /* do_coredump */
 1) $ 2647784 us |  } /* do_coredump */
 3) $ 2271315 us |  }

Change-Id: Id2c681a364ce96d98c70329abdf4a64f6d0b405d

7 years agoMerge branch 'tizen_3.0' 46/125746/1
Karol Lewandowski [Tue, 18 Apr 2017 13:00:30 +0000 (15:00 +0200)]
Merge branch 'tizen_3.0'

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

7 years agocrash-stack: Eliminate now-deprecated readdir_r 31/125231/1
Karol Lewandowski [Fri, 14 Apr 2017 07:36:14 +0000 (09:36 +0200)]
crash-stack: Eliminate now-deprecated readdir_r

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

7 years agosys-assert: Fix handle leak of mmap 47/123347/1 accepted/tizen/unified/20170406.055541 submit/tizen/20170405.094846
Sunmin Lee [Wed, 5 Apr 2017 07:53:29 +0000 (16:53 +0900)]
sys-assert: Fix handle leak of mmap

Unmap the memory after using it if it was mmaped.

Change-Id: Ia567c165ac09308a57ae8bb5eac4a9a2a524ec15
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoRevert "Separate logdump from crash-worker" 14/122514/1
Sunmin Lee [Mon, 3 Apr 2017 01:27:39 +0000 (10:27 +0900)]
Revert "Separate logdump from crash-worker"

This reverts commit c7826eefdccc5776eb0665cb0feb5d060e69fe96.

Change-Id: I398cf722d445b037d32d8116cc9c18a3a326b673

7 years agoFallback to ptrace call-stack unwinder if sys-assert failed 89/118089/1
Karol Lewandowski [Tue, 7 Mar 2017 15:13:18 +0000 (16:13 +0100)]
Fallback to ptrace call-stack unwinder if sys-assert failed

This commit enables ptrace-based call stack unwinder
(TIZEN_FEATURE_PTRACE_CALLSTACK).

When both SYS_ASSERT and PTRACE flavors are enabled
crash-manager will default to SYS_ASSERT, and fallback
to PTRACE only if former failed to generate the report
(eg. client application overwriten libsysassert's
signal handlers).

Change-Id: Ifc3626b7b46f47c3fd68efcb18d3900908ce3884

7 years agolibunwind: Fix off by one in _create_crash_stack 88/118088/1
Karol Lewandowski [Wed, 8 Mar 2017 15:23:52 +0000 (16:23 +0100)]
libunwind: Fix off by one in _create_crash_stack

This fixes call stack missing last element (usually _start,
in the case of invalid PC - the PC itself).

Change-Id: Ib1dae12bd06f1a4dfa1339fa6ea704bff05926c9

7 years agoSeparate logdump from crash-worker 51/116751/1
Sunmin Lee [Tue, 28 Feb 2017 06:02:25 +0000 (15:02 +0900)]
Separate logdump from crash-worker

In Tizen 4.0, the log_dump tool is supposed to be managed
in separate package.

Change-Id: Ie45cfdd9ee0530ef2e520ac781e9971120c87aeb
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoMerge branch 'tizen_3.0' into tizen 50/116750/1
Sunmin Lee [Fri, 24 Feb 2017 02:27:58 +0000 (11:27 +0900)]
Merge branch 'tizen_3.0' into tizen

Change-Id: I56715923d0ac0257736598e711d2c113548372cb

7 years agoFix vulnerability 77/115677/1 accepted/tizen/3.0/common/20170222.125537 accepted/tizen/3.0/ivi/20170222.082717 accepted/tizen/3.0/mobile/20170222.082645 accepted/tizen/3.0/tv/20170222.082659 accepted/tizen/3.0/wearable/20170222.082710 submit/tizen_3.0/20170221.053734
Sunmin Lee [Tue, 21 Feb 2017 05:02:20 +0000 (14:02 +0900)]
Fix vulnerability

- 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>
7 years agoExecute dump_systemstate in parallel 34/115634/2
Sunmin Lee [Tue, 21 Feb 2017 01:07:11 +0000 (10:07 +0900)]
Execute dump_systemstate in parallel

Since rearrange the order of crash modules, coredump had made
too late. It has caused several issues such as missing coredump
when something happened during dump_systemstate.
Therefore, execute dump_systemstate in parallel.

In addition, to avoid confusing launch crash-popup right after
whole crash works are finished.

Change-Id: I73c10c7d60f04d218f313b760c0381d0b8d95de7
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agocrash-stack: Get executable name from cmdline 61/115561/1
Sunmin Lee [Mon, 20 Feb 2017 09:46:44 +0000 (18:46 +0900)]
crash-stack: Get executable name from cmdline

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>
7 years agoPrint pre-ptrace info to buffer file 14/108814/2
Sunmin Lee [Wed, 28 Dec 2016 08:03:36 +0000 (17:03 +0900)]
Print pre-ptrace info to buffer file

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>
7 years agocrash-stack: Find crashed tid by wchan 03/107503/4
Sunmin Lee [Fri, 6 Jan 2017 00:37:33 +0000 (09:37 +0900)]
crash-stack: Find crashed tid by wchan

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>
7 years agocrash-manager: Utilize cmdline instead of core_pattern 90/109190/5
Sunmin Lee [Mon, 9 Jan 2017 05:03:34 +0000 (14:03 +0900)]
crash-manager: Utilize cmdline instead of core_pattern

There are limitations on using core_pattern variables to get command info.
 %e: *its length is limited (up to 16 byte)
 %E: in case of some applications, it returns not actual app binary path
     (it returns launchpad-loader)
Because of these reasons, use cmdline of /proc instead to get command info.
(It also makes a consensus with sys-assert)

* Refer to: http://lxr.free-electrons.com/source/include/linux/sched.h#L1663

Change-Id: Ie486785485e4bcee2c62fb1e4fa98329d0f01170
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoSet suid_dumpable to debug (1) 22/114822/1
Sunmin Lee [Wed, 15 Feb 2017 07:27:57 +0000 (16:27 +0900)]
Set suid_dumpable to debug (1)

As a platform policy, Tizen offers core dumping for
all process by default. However, until now some process
has got cleared dump flag by the system.
We modify it to these processes also could be dumpable.

Change-Id: I2f8fb6a76b891f4ce6af97349ab963ef5c8183fc
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agocrash-stack: Make output match sys-assert report 82/112582/3
Łukasz Stelmach [Wed, 1 Feb 2017 13:58:04 +0000 (14:58 +0100)]
crash-stack: Make output match sys-assert report

Change-Id: I7ecc9b045cc9b83d328d1d97bb08d4174c9d72ba

7 years agocrash-stack: remove the core dump handling remains 60/108060/3
Adrian Szyndela [Mon, 2 Jan 2017 14:03:58 +0000 (15:03 +0100)]
crash-stack: remove the core dump handling remains

Hopefully, there is no more rotting flesh.

Change-Id: I59003e8a38dd2817f78d23319848273615a0a5be

7 years agocrash-stack: add file offset to output 56/108056/3
Adrian Szyndela [Mon, 2 Jan 2017 13:37:54 +0000 (14:37 +0100)]
crash-stack: add file offset to output

Change-Id: Ib9f77b61d98a60e192877fad965a30ad8730af2f

7 years agocrash-stack: disable unw_get_proc_name prediction 80/107880/6
Rafal Pietruch [Fri, 30 Dec 2016 07:38:29 +0000 (08:38 +0100)]
crash-stack: disable unw_get_proc_name prediction

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

7 years agocrash-stack: integration test added 02/107302/9
Rafal Pietruch [Wed, 21 Dec 2016 16:39:01 +0000 (17:39 +0100)]
crash-stack: integration test added

Change-Id: Iaac051671b89018dda37c212bb1c9da756879ed4

7 years ago(Modified) Deal with Toolchain upgrade 14/110814/1 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170118.174031 accepted/tizen/ivi/20170118.223040 accepted/tizen/mobile/20170118.222949 accepted/tizen/tv/20170118.223006 accepted/tizen/unified/20170309.033723 accepted/tizen/wearable/20170118.223022 submit/tizen/20170118.071648 submit/tizen_unified/20170308.100409
Sunmin Lee [Wed, 18 Jan 2017 05:23:37 +0000 (14:23 +0900)]
(Modified) Deal with Toolchain upgrade

(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>
7 years agoDeal with Toolchain upgrade 50/107950/1 accepted/tizen/common/20170102.152227 accepted/tizen/ivi/20170102.222935 accepted/tizen/mobile/20170102.222840 accepted/tizen/tv/20170102.222855 accepted/tizen/wearable/20170102.222917 submit/tizen/20170102.065224
Sunmin Lee [Mon, 2 Jan 2017 04:26:55 +0000 (13:26 +0900)]
Deal with Toolchain upgrade

According to Tizen toolchain will be upgraded in 4.0,
several build issues should be resolved.
This patch deals with "Language rules stricting".

Change-Id: I1993fb3b2a285c341f8b8b92ec32a428704ddc5a
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoMerge branch 'tizen_3.0' into tizen 13/107913/1
Sunmin Lee [Fri, 30 Dec 2016 00:59:56 +0000 (09:59 +0900)]
Merge branch 'tizen_3.0' into tizen

Change-Id: I62eb5bc520f06ea0daa13a7de4c3364d0a12695d

7 years agoChange internal modules work 35/107435/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170104.141409 accepted/tizen/3.0.m2/tv/20170104.142012 accepted/tizen/3.0.m2/wearable/20170104.142306 accepted/tizen/3.0/common/20161228.162501 accepted/tizen/3.0/ivi/20161228.095940 accepted/tizen/3.0/mobile/20161228.095844 accepted/tizen/3.0/tv/20161228.095905 accepted/tizen/3.0/wearable/20161228.095922 submit/tizen_3.0.m2/20170104.093751 submit/tizen_3.0/20161228.075358
Sunmin Lee [Wed, 28 Dec 2016 05:35:13 +0000 (14:35 +0900)]
Change internal modules work

- crash-pipe: create core file only
- crash-stack: create .info file (call-stack)

Change-Id: I71ba012f426e5d055f3acfc2b2820b5fcb2e17ec
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoFix vulnerability 89/107389/1 submit/tizen_3.0/20161228.020839
Sunmin Lee [Wed, 28 Dec 2016 01:20:32 +0000 (10:20 +0900)]
Fix vulnerability

Check range of signo before use it

Change-Id: Icae63a7185a897ba6688b45715b208c2d92df1b7
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agocrash-stack: libunwind used on aarch64 39/105839/6
Kunhoon Baik [Tue, 27 Dec 2016 13:00:35 +0000 (22:00 +0900)]
crash-stack: libunwind used on aarch64

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

7 years agocrash-stack: Simplify signal info 13/107313/1
Sunmin Lee [Tue, 27 Dec 2016 05:49:41 +0000 (14:49 +0900)]
crash-stack: Simplify signal info

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>
7 years agoRemove PD License 04/107304/1 accepted/tizen/3.0/common/20161228.071657 accepted/tizen/3.0/ivi/20161228.022249 accepted/tizen/3.0/mobile/20161228.022154 accepted/tizen/3.0/tv/20161228.022211 accepted/tizen/3.0/wearable/20161228.022229 submit/tizen_3.0/20161227.112255
Sunmin Lee [Tue, 27 Dec 2016 11:15:52 +0000 (20:15 +0900)]
Remove PD License

Change-Id: Iaa3daf6bf96c5ae59ad77515a0f942f4d4a71586
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoAdjust smack label 95/107295/2 submit/tizen_3.0/20161227.111028
Sunmin Lee [Tue, 27 Dec 2016 10:33:55 +0000 (19:33 +0900)]
Adjust smack label

In response to security issue, restrict smack label of crash-manager.
In addition, adjust crash directories label to accord with
work of crash-worker.

Change-Id: I97390d50337fd36a746e260f3f6ebc29c6990526
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoMerge "log_dump: Restrict dbus permission" into tizen_3.0
Sunmin Lee [Tue, 27 Dec 2016 10:48:51 +0000 (02:48 -0800)]
Merge "log_dump: Restrict dbus permission" into tizen_3.0

7 years agoSeparate package dependencies of crash-stack 30/107230/2 submit/tizen_3.0/20161227.102645
Sunmin Lee [Tue, 27 Dec 2016 07:44:49 +0000 (16:44 +0900)]
Separate package dependencies of crash-stack

According to experimental variable, exclude unused package
dependencies from crash-worker.spec.

+ Bug fix:
   "crash-stack: Make ptrace callstack feature selective"

Change-Id: If8746a74fb937f7929538a995d6f1cf392e19bd4
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agolog_dump: Restrict dbus permission 66/107166/1
Sunmin Lee [Tue, 27 Dec 2016 02:25:12 +0000 (11:25 +0900)]
log_dump: Restrict dbus permission

log_dump can be activated using dbus method call.
Because this feature should be used by administrator only,
restrict the dbus activation permission.

Change-Id: Ib63ea10fd5101af146e35cf9ef47e96f91a3229f
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agocrash-stack: Make ptrace callstack feature selective 00/107100/1 accepted/tizen/3.0/common/20161227.102347 accepted/tizen/3.0/ivi/20161227.011727 accepted/tizen/3.0/mobile/20161227.011714 accepted/tizen/3.0/tv/20161227.011720 accepted/tizen/3.0/wearable/20161227.011722 submit/tizen_3.0/20161226.231846
Sunmin Lee [Mon, 26 Dec 2016 11:31:43 +0000 (20:31 +0900)]
crash-stack: Make ptrace callstack feature selective

In Tizen 3.0, the crash-stack using ptrace to generate callstack
will be offered as a choice.
Developers can enable this feature through setting a variable as on:
TIZEN_FEATURE_PTRACE_CALLSTACK

Change-Id: I7dfbf563144174abcd5e50677eb8943cdb8d8ebe
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoRemove SIGSEGV handling 60/106760/1 submit/tizen_3.0/20161226.093327
Kunhoon Baik [Mon, 4 Jul 2016 11:01:31 +0000 (20:01 +0900)]
Remove SIGSEGV handling

SIGSEGV (signal number - 11) may occur double crash when sys-assert tries to unwind backtrace.
like that

If the double crash is generated, it causes useless backtrace of corefile (double crashed memory dump)
Thus, sys-assert does not handle SIGSEGV.

Change-Id: I826ee2bab796fc87b2b4a003683315514af96339

7 years agoFix handle leak 38/106638/1 accepted/tizen/3.0/common/20161223.110758 accepted/tizen/3.0/ivi/20161223.082249 accepted/tizen/3.0/mobile/20161223.082230 accepted/tizen/3.0/tv/20161223.082234 accepted/tizen/3.0/wearable/20161223.082240 submit/tizen_3.0/20161222.092901 submit/tizen_3.0/20161222.232700
Sunmin Lee [Thu, 22 Dec 2016 08:58:58 +0000 (17:58 +0900)]
Fix handle leak

Fix handle leak of file pointer at crash-stack

Change-Id: I2d68e04ad84ea7263e3c45cc91ef295557532bde
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoMerge "crash-stack: use libunwind for i686 and x86_64" into tizen_3.0
Karol Lewandowski [Tue, 20 Dec 2016 17:33:58 +0000 (09:33 -0800)]
Merge "crash-stack: use libunwind for i686 and x86_64" into tizen_3.0

7 years agoMerge "crash-stack: fixed attaching to thread" into tizen_3.0
Karol Lewandowski [Tue, 20 Dec 2016 16:23:33 +0000 (08:23 -0800)]
Merge "crash-stack: fixed attaching to thread" into tizen_3.0

7 years agocrash-stack: use libunwind for i686 and x86_64 52/105152/2
Rafal Pietruch [Thu, 15 Dec 2016 15:28:17 +0000 (16:28 +0100)]
crash-stack: use libunwind for i686 and x86_64

Change-Id: I0022cc3ac772ba26ed67f7d64d45c3ab4e22db88

7 years agocrash-stack: fixed attaching to thread 36/105436/2
Adrian Szyndela [Fri, 16 Dec 2016 12:27:35 +0000 (13:27 +0100)]
crash-stack: fixed attaching to thread

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

7 years agocrash-manager: consider backward compatibility for crash-stack 23/105623/4 accepted/tizen/3.0/common/20161221.181339 accepted/tizen/3.0/ivi/20161221.011328 accepted/tizen/3.0/mobile/20161221.011734 accepted/tizen/3.0/tv/20161221.011025 accepted/tizen/3.0/wearable/20161221.011357 submit/tizen_3.0/20161220.115150
Sunmin Lee [Mon, 19 Dec 2016 06:26:30 +0000 (15:26 +0900)]
crash-manager: consider backward compatibility for crash-stack

Though the crash-stack is available about tid option,
previous kernel has not supported this feature.
Therefore the crash-manager should call crash-stack
considering backward compatibility.

Change-Id: I779783ed46760b88a6d454a05710b29cd4418a44
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agocrash-stack: deprecate corefile option 80/106080/3
Sunmin Lee [Tue, 20 Dec 2016 09:41:00 +0000 (18:41 +0900)]
crash-stack: deprecate corefile option

crash-stack should be able to generate call stack
using pid only.
(Generating corefile causes sluggish issue)

Change-Id: Ie9e74494b966838d1dd6548424d51bfd2df4c1e0

7 years agoRevert "engineer mode: make .debugmode on engineer image" 56/104956/2
Sunmin Lee [Thu, 15 Dec 2016 02:26:38 +0000 (11:26 +0900)]
Revert "engineer mode: make .debugmode on engineer image"

.debugmode is moved to other package

This reverts commit b153665a12cda6a29f9ba9d12db7f2682ade9af5.

Change-Id: Idfe9cae63b8f4e4122c74abb144250eea45d9f07

7 years agocrash-stack: get registers from tid instead of pid 18/105118/1
Adrian Szyndela [Thu, 15 Dec 2016 12:03:21 +0000 (13:03 +0100)]
crash-stack: get registers from tid instead of pid

Change-Id: Id4ea3f57808420ec6ac0941c2612a5af51136c96

7 years agocrash-stack: work around hanging up on 'D' processes 64/104564/3
Adrian Szyndela [Tue, 13 Dec 2016 13:43:06 +0000 (14:43 +0100)]
crash-stack: work around hanging up on 'D' processes

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

7 years agocrash-stack: Drop duplicate call stack footer 15/104915/2
Karol Lewandowski [Wed, 14 Dec 2016 16:53:05 +0000 (17:53 +0100)]
crash-stack: Drop duplicate call stack footer

Change-Id: I938f2ead95d312450edb853740cce47becf796fc

7 years agocrash-stack: print memory information 14/104914/2
Łukasz Stelmach [Wed, 14 Dec 2016 16:30:54 +0000 (17:30 +0100)]
crash-stack: print memory information

Print information from /proc/meminfo and /proc/PID/status

Change-Id: I6c66e9ee6c8eca20a8925e9ecc23e09c0dabcb25

7 years agocrash-stack: change error reporting file handle 13/104913/1
Łukasz Stelmach [Wed, 14 Dec 2016 16:28:10 +0000 (17:28 +0100)]
crash-stack: change error reporting file handle

Change-Id: I734b431f56f9e32c440839e1bd4e5b90112773ec

7 years agocrash-stack: print maps information 12/104912/1
Łukasz Stelmach [Wed, 14 Dec 2016 14:06:43 +0000 (15:06 +0100)]
crash-stack: print maps information

Print information about mapped memory regions.

Add stub for printing system and process VM information.

Change-Id: I47b2c5f837620f9d22b3270a75d8f5e663d44c78

7 years agocrash-stack: print executable file path 11/104911/1
Łukasz Stelmach [Wed, 14 Dec 2016 15:26:54 +0000 (16:26 +0100)]
crash-stack: print executable file path

Change-Id: Ib5946bcfb5bbad8af7b7bbfc7c8568a3cb3ab207

7 years agocrash-stack: support for resolving stack from threads 98/104898/3
Adrian Szyndela [Wed, 14 Dec 2016 13:52:37 +0000 (14:52 +0100)]
crash-stack: support for resolving stack from threads

Change-Id: Ic80b6b83acb80b3c332b6b6674fbf662b1003586

7 years agocrash-stack: put more effort into getting names 25/104725/6
Adrian Szyndela [Wed, 14 Dec 2016 07:16:22 +0000 (08:16 +0100)]
crash-stack: put more effort into getting names

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

7 years agocrash-stack: reformat callstack output 70/104870/3
Rafal Pietruch [Wed, 14 Dec 2016 12:11:12 +0000 (13:11 +0100)]
crash-stack: reformat callstack output

Change-Id: Ica727d63de389d8a4a2f1ff7cfced2a463630282