platform/core/system/crash-worker.git
4 years agodump_scripts: move_dump.sh: set PATH exactly as security team requires 52/212452/3 accepted/tizen/unified/20190822.045421 submit/tizen/20190821.171906
Karol Lewandowski [Wed, 21 Aug 2019 13:45:32 +0000 (15:45 +0200)]
dump_scripts: move_dump.sh: set PATH exactly as security team requires

Change-Id: I8750d45b43ebb090e9cf31b8c1814eb1550fdce7

4 years agoRelease 5.5.19 68/211868/2 accepted/tizen/unified/20190812.235604 submit/tizen/20190809.125447
Karol Lewandowski [Fri, 9 Aug 2019 11:36:49 +0000 (13:36 +0200)]
Release 5.5.19

This release brings:

 - lowering priority of crash-worker sysctl file to allow
   easy overwriting of sysctls by local files

 - few fixes for reliability

 - minor system tests refactoring

Change-Id: If12efeb3c59c68ed642c32d83e789592520a18af

4 years agoshared: Simplify get_exe_path 21/211721/2
Karol Lewandowski [Thu, 8 Aug 2019 08:49:27 +0000 (10:49 +0200)]
shared: Simplify get_exe_path

Change-Id: I26839430a4836454f96c1f273a1500899dc6b607

4 years agocrash-manager: fix potential cinfo->cmdline double free 20/211720/2
Karol Lewandowski [Thu, 8 Aug 2019 08:13:04 +0000 (10:13 +0200)]
crash-manager: fix potential cinfo->cmdline double free

Change-Id: I1ea39c92f076834defe4dfc0e7f4a6d0f798f066

4 years agoLower the number (and priority) of crash-worker sysctl config file 09/211409/2
Karol Lewandowski [Thu, 1 Aug 2019 14:38:12 +0000 (16:38 +0200)]
Lower the number (and priority) of crash-worker sysctl config file

Install sysctl file with 70 prefix instead of 99.  This will allow
overriding variables by creating eg. 99-local.conf file with appropriate
vars.

Change-Id: I88e25839a59a66896ab540d0836776b2d64225e5

4 years agosystem tests: Simplify exit helper functions 58/211258/1
Karol Lewandowski [Thu, 25 Jul 2019 11:13:09 +0000 (13:13 +0200)]
system tests: Simplify exit helper functions

Change-Id: Iecafa3632ac0c81454c2692037de34b486dfa2e2

4 years agoRelease 5.5.18 79/210679/2 accepted/tizen/unified/20190725.112358 submit/tizen/20190724.102627
Karol Lewandowski [Tue, 23 Jul 2019 15:25:00 +0000 (17:25 +0200)]
Release 5.5.18

This release introduces following features:

  - Addition of signal that caused crash and thread name to
    dbus signal (in sys.signal and sys.tid.comm fields, respectively)

    Additionally, report path is appended properly to the signal
    (bugfix)

  - Livecoredump reports are saved in livedump/ subdirectory
    from this release

  - Executable name is passed to minicoredumper allowing per-app
    recipes to be specified

  - All executables are rebuild as PIE as needed for ASLR to work

Change-Id: I91b2222c603d1d75b5e3df501f3d57eed5d7ff4e

4 years agoPass the executable name to the minicoredumper 97/210397/5
Mateusz Moscicki [Thu, 18 Jul 2019 15:58:38 +0000 (17:58 +0200)]
Pass the executable name to the minicoredumper

Change-Id: Iccd4abead0a87873d05e05333630bd859d34ef46

4 years agoSave livedumper reports in the livedump/ subdirectory 92/210392/6
Mateusz Moscicki [Tue, 16 Jul 2019 06:16:04 +0000 (08:16 +0200)]
Save livedumper reports in the livedump/ subdirectory

This change makes possible to distinguish the report created by
the application crash from that created on the request.

Change-Id: Iaafb82522cad40e12366ee06eb6313027937b5b2

4 years agocrash-manager: dbus: Add /proc/tid/comm info to signal 90/210490/3
Karol Lewandowski [Fri, 19 Jul 2019 13:23:42 +0000 (15:23 +0200)]
crash-manager: dbus: Add /proc/tid/comm info to signal

Change-Id: Ibfbc159204b54a9c4a2eaacc491c56a950e246b5

4 years agoshared: Generalize function to read any /proc/pid entry 89/210489/3
Karol Lewandowski [Fri, 19 Jul 2019 13:22:54 +0000 (15:22 +0200)]
shared: Generalize function to read any /proc/pid entry

Change-Id: Ide42d323a2ce6f3901d7a5c26baa9ff5153a512f

5 years agodefs: Make comm size public 88/210488/1
Karol Lewandowski [Fri, 19 Jul 2019 13:20:15 +0000 (15:20 +0200)]
defs: Make comm size public

It will be used by multiple clients.

Change-Id: Ifa86c14a0b1cf3b0c1cf7693c1f3c836c95a0d2d

5 years agocrash-manager: dbus: Add information about signal that caused crash 68/210368/2
Karol Lewandowski [Thu, 18 Jul 2019 11:32:48 +0000 (13:32 +0200)]
crash-manager: dbus: Add information about signal that caused crash

Signal number is going to be available under "sys.signal" key in
broadcasted signal.

Change-Id: I1c1e57e9229ca0d896ce095782d3c510ab5fe96e

5 years agotests: Add crash-manager dbus notify system test 75/210275/2
Karol Lewandowski [Wed, 17 Jul 2019 11:29:15 +0000 (13:29 +0200)]
tests: Add crash-manager dbus notify system test

Change-Id: I3e3c4669df4dd36edecd02c2fb245f455b76b4c5

5 years agocrash-manager: notify: Add missing report path to D-Bus signal 74/210274/1
Karol Lewandowski [Wed, 17 Jul 2019 11:28:04 +0000 (13:28 +0200)]
crash-manager: notify: Add missing report path to D-Bus signal

Change-Id: I39d992d49b48f00f11103b47eec2027e655fe6c7

5 years agodefs.h: Fix crash-notify path 73/210273/1
Karol Lewandowski [Wed, 17 Jul 2019 11:27:08 +0000 (13:27 +0200)]
defs.h: Fix crash-notify path

Change-Id: I4e7cc3e516239d6642dc7214bc35472d8918cc3e

5 years agoBuild all programs as PIE - needed for ASLR to work 95/210195/2
Karol Lewandowski [Tue, 16 Jul 2019 11:46:29 +0000 (13:46 +0200)]
Build all programs as PIE - needed for ASLR to work

Change-Id: If965bb4ef9008bf280d211feeebe1a5a95de7252

5 years agoRelease 5.5.17 78/210078/2 submit/tizen/20190716.094555
Mateusz Moscicki [Mon, 15 Jul 2019 13:15:19 +0000 (15:15 +0200)]
Release 5.5.17
- Fix format specifier in livedumper
- crash-manager executes livedumper with -m option

Change-Id: I1031fce26edd993612d1d0190fb31775488ff29e

5 years agocrash-manager executes livedumper with -m option 77/210077/2
Mateusz Moscicki [Mon, 15 Jul 2019 13:11:54 +0000 (15:11 +0200)]
crash-manager executes livedumper with -m option

Change-Id: If36b60500d18fe43065a4b9322446e9309e18564

5 years agoSkip test if livedumper doesn't exist 76/210076/2
Mateusz Moscicki [Mon, 15 Jul 2019 12:46:50 +0000 (14:46 +0200)]
Skip test if livedumper doesn't exist

Change-Id: Ibe22df39b4c8e572c29efec0f338cae0bef1bc9f

5 years agoFix format specifier 75/210075/2
Mateusz Moscicki [Mon, 15 Jul 2019 09:09:11 +0000 (11:09 +0200)]
Fix format specifier

Change-Id: I5378d23401594aae9adf42ce595d6fad43c847ce

5 years agoRelease 5.5.16 50/209650/1 submit/tizen/20190709.135841
Mateusz Moscicki [Tue, 9 Jul 2019 13:54:55 +0000 (15:54 +0200)]
Release 5.5.16

- Fix Coverity issues

Change-Id: Ic94d6570135a93575b793447c1fc5ea365c6a5f3

5 years agoFix a bunch of minor issues found by Coverity. 42/209642/1
Michal Bloch [Mon, 8 Jul 2019 14:49:34 +0000 (16:49 +0200)]
Fix a bunch of minor issues found by Coverity.

Change-Id: I6dc3f56f1d590a6a49800d28ba78d3185555a837
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoMerge changes I0a2bc0e4,I9056c6e6 into tizen
Mateusz Mościcki [Fri, 5 Jul 2019 14:15:34 +0000 (14:15 +0000)]
Merge changes I0a2bc0e4,I9056c6e6 into tizen

* changes:
  Release 5.5.15
  Add ability to dump minicore

5 years agoRelease 5.5.15 11/209411/1 submit/tizen/20190705.142120
Mateusz Moscicki [Fri, 5 Jul 2019 14:07:35 +0000 (16:07 +0200)]
Release 5.5.15

- livedumper is able to create mini coredumps (-m option)

Change-Id: I0a2bc0e42757e3fe9378cca8b671448804abdcca

5 years agoAdd ability to dump minicore 24/208624/5
Mateusz Moscicki [Wed, 26 Jun 2019 08:49:48 +0000 (10:49 +0200)]
Add ability to dump minicore

Change-Id: I9056c6e630e11a9990933832906302e45905dea2

5 years agoChange the config value of the "RemainAfterExit=" ("true" -> "yes") 38/208538/1
INSUN PYO [Wed, 26 Jun 2019 00:23:41 +0000 (09:23 +0900)]
Change the config value of the "RemainAfterExit=" ("true" -> "yes")

Change-Id: I8456f7ebfbbf1679092ff2a9e92745574e482766

5 years agoRelease 5.5.14 27/208127/3 accepted/tizen/unified/20190628.035304 submit/tizen/20190626.084119
Karol Lewandowski [Tue, 18 Jun 2019 14:01:39 +0000 (16:01 +0200)]
Release 5.5.14

This release brings:

 - ExtraScript= crash-worker's option, allowing to call arbitrary
   script which can add files to report

 - assorted fixes

Change-Id: I2828135b2bef5118453c4e3356dfc4f96bc59755

5 years agosystem-tests: packaging: Sort files 26/208126/3
Karol Lewandowski [Tue, 18 Jun 2019 14:01:08 +0000 (16:01 +0200)]
system-tests: packaging: Sort files

Change-Id: Ic61351ecef500221afe2876582a2ae034f905761

5 years agocrash-manager: Add ExtraScript to config 25/208125/3
Karol Lewandowski [Tue, 18 Jun 2019 10:57:48 +0000 (12:57 +0200)]
crash-manager: Add ExtraScript to config

ExtraScript will be called for report types >= FULL.  This will allow
attaching arbitrary data to crash report.  Script is called with report's
temporary directory as first and only argument, ie.

   exec("$ExtraScript", "/path/to/report/temp/dir", PID)

Change-Id: Icc38b92daae7a39b13063b2c45bffc1b863e72d6

5 years agosystem-tests: Fix incorrect variable usage 24/208124/1
Karol Lewandowski [Tue, 18 Jun 2019 13:45:10 +0000 (15:45 +0200)]
system-tests: Fix incorrect variable usage

Change-Id: Ifafc9ff3c62f760b96188c4a51471a219e66cee0

5 years agoRemove logging to error output 47/206647/3
Mateusz Moscicki [Wed, 22 May 2019 10:37:09 +0000 (12:37 +0200)]
Remove logging to error output

Change-Id: I7abce9958153729ed7ae91d582970211ad0e004f

5 years agoFix SVACE warnings 83/206883/1
Mateusz Moscicki [Tue, 28 May 2019 12:16:31 +0000 (14:16 +0200)]
Fix SVACE warnings

Change-Id: I8c1c88cb34637b9c6a341d59134e9bb1c9f1cfea

5 years agoRelease 5.5.13 21/206721/1 submit/tizen/20190523.190019
Michal Bloch [Thu, 23 May 2019 16:57:24 +0000 (18:57 +0200)]
Release 5.5.13

Quickfix for a compilation issue on aarch64.

Change-Id: I390dfaffba12ebe5692cf5d821abb56168d24a0c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoRelease 5.5.12 50/206650/4 submit/tizen/20190523.142501
Karol Lewandowski [Wed, 22 May 2019 13:54:17 +0000 (15:54 +0200)]
Release 5.5.12

This release brings following improvements:

 - livedumper - the utility to create coredumps from live processes
   and its integration

 - dump_systemstate is able to add additional extra output from both
   specified files and programs

 - dbus dependencies are moved from crash-manger core program to separate
   helper programs to improve reliability

Change-Id: Ic78880739209e4d4d320c09ba77ba9acc3533490

5 years agoMove hardcoded paths back to .spec file 41/205941/5
Karol Lewandowski [Wed, 22 May 2019 09:27:17 +0000 (11:27 +0200)]
Move hardcoded paths back to .spec file

Change-Id: I50a83ba1a19088608200f1ef9ce83649cc53af68

5 years agoFix system tests 22/206422/9
Mateusz Moscicki [Fri, 17 May 2019 07:13:33 +0000 (09:13 +0200)]
Fix system tests

* Skip critical process system test for emulator
* Add a delay after a process terminating. In some cases crash-worker
  finished job, but the report appeared after a while
* Define variables for exit codes
* Unify variable name for the system tests path

Change-Id: I6b380ba3252d2b654ecfd8e9ecde575d959c0602

5 years agoAdd livedumper and integrate it with the crash-manager 52/203752/23
Mateusz Moscicki [Tue, 16 Apr 2019 10:05:26 +0000 (12:05 +0200)]
Add livedumper and integrate it with the crash-manager

Livedumper is an application that can save coredump of a running process.

crash-manager got three new switches:

   -l - run livedumper instead of minicoredumper and don't send notify
   -k - kill process after saving the report
   -r - print report path to stdout

Change-Id: If4fe21b250ae5e939d7b63ea5c4bf75bec6123a4

5 years agoUse getopt to parse command line arguments 42/205842/6
Mateusz Moscicki [Wed, 8 May 2019 10:27:18 +0000 (12:27 +0200)]
Use getopt to parse command line arguments

Change-Id: If8fcb875d19f4547348b72341e342251cb8b7fb2

5 years agoRedirect command's output to not pollute standard output 02/206402/2
Karol Lewandowski [Fri, 17 May 2019 09:53:46 +0000 (11:53 +0200)]
Redirect command's output to not pollute standard output

This alters default redirections of following commands:

 - zip - all descriptors redirected to /dev/null
 - minicoredumper, dump_systemstate - standard output redirected to stderr

Change-Id: I723ddb78baca6d58decbc1b1219f7cd5b8d5c9ae

5 years agospawn: Allow executing list of handlers 26/206326/3
Karol Lewandowski [Wed, 15 May 2019 12:02:27 +0000 (14:02 +0200)]
spawn: Allow executing list of handlers

This functionality is needed for non-trivial child initialization.

Change-Id: Iac1d5221fc44dc2d65c2acc260e8b9e2b1a01a17

5 years agoSilence zip command output 25/206325/1
Karol Lewandowski [Wed, 15 May 2019 12:01:44 +0000 (14:01 +0200)]
Silence zip command output

zip, as any other process, should not pollute our standard output
unless explicitly asked to do so.

Change-Id: Ied5d31e453c528fffd9662aa5b324e0b7a743dbc

5 years agosystem tests: add `dump_systemstate -e' test 24/204824/3
Karol Lewandowski [Fri, 26 Apr 2019 13:48:32 +0000 (15:48 +0200)]
system tests: add `dump_systemstate -e' test

Change-Id: I4fa93d87bffaf2178b213eda2861a2522ce531ad

5 years agodump_systemstate reads extra tasks from config 96/203096/9
Michal Bloch [Wed, 3 Apr 2019 09:46:47 +0000 (11:46 +0200)]
dump_systemstate reads extra tasks from config

Change-Id: I0cf2f0411218e0ce6d0b7c0e940ea5e84f48fdf2
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoSplit dbus-notify-send from crash-manager 79/204679/4
Karol Lewandowski [Thu, 25 Apr 2019 11:31:43 +0000 (13:31 +0200)]
Split dbus-notify-send from crash-manager

Change-Id: I12b9a6b513fba53335eee71bf10c5c2b83ca3349

5 years agoSplit crash-popup-launch from crash manager 78/204678/3
Karol Lewandowski [Thu, 25 Apr 2019 08:39:09 +0000 (10:39 +0200)]
Split crash-popup-launch from crash manager

Crash manager should not have any dbus depenency to increase its reliability.

Change-Id: I576d3730f47e6562dea71b9399c08cddf3280521

5 years agospawn: Introduce helper to open /dev/null on all standard fds 77/204677/2
Karol Lewandowski [Thu, 25 Apr 2019 10:03:05 +0000 (12:03 +0200)]
spawn: Introduce helper to open /dev/null on all standard fds

This will be used in crash-manager to invoke processes in
"non-blocking" way.

Change-Id: Ic70eda38c7cba8628e635ba206f1fe81edb944eb

5 years agoRelease 5.5.11 76/204676/2 accepted/tizen/unified/20190426.054201 submit/tizen/20190425.132450
Karol Lewandowski [Thu, 25 Apr 2019 11:24:56 +0000 (13:24 +0200)]
Release 5.5.11

This release brings following changes:
 - log_dump honours CrashRootPath from config
 - dump_systemstate also dumps installed package list

Change-Id: I433dcbbca07df388c981113c89a054f5f1a40ec9

5 years agoFix missing includes 27/204027/2
Michal Bloch [Thu, 18 Apr 2019 13:30:21 +0000 (15:30 +0200)]
Fix missing includes

Required for `bool`, `off_t` and `pid_t`.

Change-Id: I245b9aa5f5fd3e7b01b2d44d502762b57f9065f7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoMerge "shared utils: add a string suffix checker" into tizen
Karol Lewandowski [Thu, 18 Apr 2019 13:24:59 +0000 (13:24 +0000)]
Merge "shared utils: add a string suffix checker" into tizen

5 years agoMerge changes I738e241a,Idade13c1,Ic4b2732b into tizen
Karol Lewandowski [Thu, 18 Apr 2019 13:19:49 +0000 (13:19 +0000)]
Merge changes I738e241a,Idade13c1,Ic4b2732b into tizen

* changes:
  log_dump: Honour CrashRootPath from config
  log_dump: Create temp dir if nonexistent
  Move crash-manager config handling to shared/

5 years agolog_dump: Honour CrashRootPath from config 43/203443/6
Karol Lewandowski [Wed, 17 Apr 2019 14:06:55 +0000 (16:06 +0200)]
log_dump: Honour CrashRootPath from config

Change-Id: I738e241a1fbb12447f32fcc7f963a8185eec0f12

5 years agolog_dump: Create temp dir if nonexistent 71/203771/2
Karol Lewandowski [Wed, 17 Apr 2019 12:59:36 +0000 (14:59 +0200)]
log_dump: Create temp dir if nonexistent

Other directories are created already (log, debug).

Change-Id: Idade13c1bf10df09ef36dd71a449c216eb27a6dc

5 years agoMove crash-manager config handling to shared/ 29/203429/6
Karol Lewandowski [Fri, 12 Apr 2019 10:25:31 +0000 (12:25 +0200)]
Move crash-manager config handling to shared/

Certain configuration variables are needed by (at least) log_dump.

Change-Id: Ic4b2732b261c1d03215cf0ac14db5264c9b517fb

5 years agoshared utils: add a string suffix checker 53/203753/2
Michal Bloch [Wed, 17 Apr 2019 10:26:23 +0000 (12:26 +0200)]
shared utils: add a string suffix checker

Change-Id: I8c7a5e78c7d407a983c967a6b105c31e3beff3a7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoFix get application name from path 57/203657/1
Mateusz Moscicki [Tue, 16 Apr 2019 14:32:31 +0000 (16:32 +0200)]
Fix get application name from path

Change-Id: Icaa926c23ebc52af502ccb94e35090008281be95

5 years agoIntroduce defs.h with all cmake variables 28/203428/1
Karol Lewandowski [Tue, 26 Mar 2019 14:00:42 +0000 (15:00 +0100)]
Introduce defs.h with all cmake variables

Change-Id: Ic3fb4f3d6074b896f7601d07a7a93cb96f9e8727

5 years agodump_systemstate: dump installed package list
Sunmin Lee [Mon, 25 Feb 2019 01:55:42 +0000 (10:55 +0900)]
dump_systemstate: dump installed package list

Some package information is required to debug crash.
Add it as an option of dump_systemstate.

Change-Id: I140e2d00b35157c7f463426483dea074d739b73e
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
[ Backported from different repository ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
5 years agoRelease 5.5.10 50/200750/2 submit/tizen/20190301.163056
Karol Lewandowski [Fri, 1 Mar 2019 15:27:00 +0000 (16:27 +0100)]
Release 5.5.10

Fix compilation on 64-bit architectures.

Change-Id: Ib8110ed71300d4b0dde5b7fe0775c94cd720dfa5

5 years agoutil: Fix spawn API to work properly on 64-bit architectures 49/200749/2
Karol Lewandowski [Fri, 1 Mar 2019 15:13:58 +0000 (16:13 +0100)]
util: Fix spawn API to work properly on 64-bit architectures

Introducing spawn_param_u has the purpose of avoiding
casting arch-dependent pointers to various data types.

Change-Id: I81c4c292ac9f0d9506f3ad3cac1676e9c99cc090

5 years agoRelease 5.5.9 30/200730/1 submit/tizen/20190301.131043
Karol Lewandowski [Fri, 1 Mar 2019 12:57:31 +0000 (13:57 +0100)]
Release 5.5.9

This release brings:

  - rewrite of subprocess execution API and associated updates

  - rewrite of log_dump for correctness and readability

  - addition of log_dump and basic crash report system tests

Change-Id: If157537a971537ab4c7f2d3f67605a277db96964

5 years agoRewrite and re-enable log_dump 12/189812/23
Karol Lewandowski [Fri, 21 Sep 2018 07:48:21 +0000 (09:48 +0200)]
Rewrite and re-enable log_dump

This is major change which brings following changes:

 - port log_dump to spawn() API

 - fix: allow creating multiple log_dump reports at once
   (by using separate/unique temporary directory)

   NOTE: There is no guarantee that dump scripts are able to handle parallell
         invocation!

 - fix: always broadcast the signal about finished dump - even in case of
   error (client should not wait indifinitely for status)

 - move logic of moving crash-dump reports to separate script

Change-Id: I78585b9c3c6bfb9e12950985b389c0edf0eac7f0

5 years agoReplace system_command_* and run_command_* APIs with simpler spawn() 09/189809/26
Karol Lewandowski [Wed, 7 Nov 2018 11:04:34 +0000 (12:04 +0100)]
Replace system_command_* and run_command_* APIs with simpler spawn()

This commit introduces following utility functions to handle
external process execution:

 - spawn() - forks parent and executes specified command via execve(),
   establishes pipe between child and parent to monitor child lifetime.

   Ability to customize child environment is provided by the means of
   callbacks - spawn_{setstdout{,err},chdir,umask} are provided to set
   fds, chdir, and umask respectively.

 - wait_for_pid() - waitpid() for child, returning its exit code

 - spawn_wait() - combines both of above and adds ability to optionally
   specify timeout after which child is killed. Returns childs exit
   code (as wait_for_pid()), or -1 when timed out.

Change-Id: I55d1e4ae8f547be3883c43132a0e083b91f730e3

5 years agoDisable log_dump 08/189808/20
Karol Lewandowski [Tue, 19 Feb 2019 16:15:56 +0000 (17:15 +0100)]
Disable log_dump

Disable log_dump for the period of spawn API introduction to
avoid rewriting this utility twice.

Change-Id: I7f5589d9e3eadb4343314d5509c6dc8cf4e62177

5 years agosystem tests: report_basic: do not assume empty crash dump directory 58/200658/2
Karol Lewandowski [Wed, 27 Feb 2019 15:05:39 +0000 (16:05 +0100)]
system tests: report_basic: do not assume empty crash dump directory

Other programs can create crash report at the same time
this system test is run, so we can not assume our crash
report will be only one in the dump dir.

Change-Id: I8688312b11cbaee4cad56205ae0486b4f99e4a5f

5 years agoSimplify CMakeFile.txt 56/200656/1
Mateusz Moscicki [Wed, 27 Feb 2019 12:13:48 +0000 (13:13 +0100)]
Simplify CMakeFile.txt

Change-Id: I1d07b518a88c057c726f5a110a53620e3941741e

5 years agosystem tests: ensure core pattern is always restored 47/200647/3
Karol Lewandowski [Wed, 27 Feb 2019 10:52:23 +0000 (11:52 +0100)]
system tests: ensure core pattern is always restored

Change-Id: Id8cd30af058da8cbc23844ec7314d8a488644807

5 years agosystem tests: ensure needed variables are always available 61/200561/3
Karol Lewandowski [Tue, 26 Feb 2019 15:34:22 +0000 (16:34 +0100)]
system tests: ensure needed variables are always available

Change-Id: Ia4700100cfc849976dd7fa6c84b92b66f393d7d9

5 years agosystem tests: add basic crash report sanity test 60/200560/2
Karol Lewandowski [Tue, 26 Feb 2019 13:18:38 +0000 (14:18 +0100)]
system tests: add basic crash report sanity test

Change-Id: I2fbe5f35a7a1cb7d93a3bf895ffd4cec1f6d0c6f

5 years agosystem tests: log_dump: fix multiple issues 59/200559/2
Karol Lewandowski [Tue, 26 Feb 2019 15:19:03 +0000 (16:19 +0100)]
system tests: log_dump: fix multiple issues

Fixes:
 - invalid crash report existence tests
 - lack of bash dependency in one test
 - non-unique test file used

Change-Id: Iee9c7c9592054008c5e3bfd23e90e0c09f6e849b

5 years agoFill the list of tests in the run.sh 21/200621/1
Mateusz Moscicki [Wed, 27 Feb 2019 08:00:12 +0000 (09:00 +0100)]
Fill the list of tests in the run.sh

Change-Id: Ic97f82a710a89b11ef5a7f33049bb160fc6152c0

5 years agoFix after change of default coredump format 83/200383/4
Mateusz Moscicki [Wed, 27 Feb 2019 09:45:45 +0000 (10:45 +0100)]
Fix after change of default coredump format

* Update system tests
* Fix remove coredump if DumpCore is set to 0

Change-Id: Ic0254f8592b1951b72866ae588fe83954646c0b7

5 years agoutil: Add make_dir 84/200384/4
Karol Lewandowski [Fri, 22 Feb 2019 14:22:42 +0000 (15:22 +0100)]
util: Add make_dir

There is no need to call mkdir(1) for simple cases.

Change-Id: Iae4aeff8d78420f5093d946fbfe0daeb7a339b13

5 years agosystem tests: add basic log_dump tests 87/200387/5
Karol Lewandowski [Thu, 21 Feb 2019 15:36:45 +0000 (16:36 +0100)]
system tests: add basic log_dump tests

Change-Id: Ibcbf680ba2b4c105d66c9f0c93acf6aaababe375

5 years agosystem tests: rationalize naming 86/200386/5
Karol Lewandowski [Thu, 21 Feb 2019 15:34:57 +0000 (16:34 +0100)]
system tests: rationalize naming

Change-Id: I21d22e7cba27ce4ede716573056946bf3cd3ddd6

5 years agosystem tests: scripts depend on bash extensions 85/200385/5
Karol Lewandowski [Thu, 21 Feb 2019 14:55:19 +0000 (15:55 +0100)]
system tests: scripts depend on bash extensions

Even if given script does not explicitly use bash extensions it
sources minicore-utils.sh, which do require bash.

Change-Id: I1689531bf9f9a60f0e2c607dad504d92c5419fba

5 years agoRelease 5.5.8 53/200153/1 accepted/tizen/unified/20190220.071628 submit/tizen/20190219.142715
Karol Lewandowski [Tue, 19 Feb 2019 12:23:59 +0000 (13:23 +0100)]
Release 5.5.8

This change brings on Coverity fix.

Change-Id: I8da5e50276189c609a70712d3d652f44237346d5

5 years agocrash-manager: Fix error checking for pkgmgrinfo*() invocation 40/200140/3
Karol Lewandowski [Tue, 19 Feb 2019 12:04:34 +0000 (13:04 +0100)]
crash-manager: Fix error checking for pkgmgrinfo*() invocation

This commit fixes 'unchecked return value' as reported by coverity.

Change-Id: I8c31504fd03826862f85df5ff24d7752a12262e9

5 years agoRelease 5.5.7 12/199812/1 accepted/tizen/unified/20190218.063827 submit/tizen/20190214.144730
Karol Lewandowski [Thu, 14 Feb 2019 14:41:44 +0000 (15:41 +0100)]
Release 5.5.7

This release brings following changes:
 - Fix allocation size mismatch (SVACE fix)
 - log_dump: change permission of service file

Change-Id: I8ca897471a727b811d62baa323c7a166ff40412a

5 years agoFix allocation size mismatch 33/199533/4
Mateusz Moscicki [Tue, 12 Feb 2019 13:48:10 +0000 (14:48 +0100)]
Fix allocation size mismatch

Change-Id: Iee761aafd7f7cb63d12acc48345519faba821536

5 years agolog_dump: change permission of service file 66/199066/1
Sunmin Lee [Fri, 1 Feb 2019 08:22:58 +0000 (17:22 +0900)]
log_dump: change permission of service file

The systemd service file should be set to root ownership.

Change-Id: I27978116c0b6f1c782285a604e30ee093999166b
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
5 years agoRelease 5.5.6 10/198010/1 accepted/tizen/unified/20190128.061511 submit/tizen/20190117.152408 submit/tizen/20190122.114956
Karol Lewandowski [Thu, 17 Jan 2019 15:20:23 +0000 (16:20 +0100)]
Release 5.5.6

This release adds information about crashed application (.tpk)
to .so_info file.

Additionally, one svace issue is fixed.

Change-Id: I0ce18e1c47906df26bc996960681685a33f88c89

5 years agoMerge "svace: fix closing potentially negative fd" into tizen
Karol Lewandowski [Thu, 17 Jan 2019 15:19:16 +0000 (15:19 +0000)]
Merge "svace: fix closing potentially negative fd" into tizen

5 years agoAdd support for tpk packages 32/197632/5
Mateusz Moscicki [Mon, 14 Jan 2019 12:41:50 +0000 (13:41 +0100)]
Add support for tpk packages

Change-Id: Ic625678478e3dc888bea786bb203ef021c579228

5 years agosvace: fix closing potentially negative fd 89/197989/1
Karol Lewandowski [Thu, 17 Jan 2019 11:38:48 +0000 (12:38 +0100)]
svace: fix closing potentially negative fd

This commit fixes following issue reported by svace:

 "Variable 'cinfo.prstatus_fd', which may receive negative value at
  crash-manager.c:588 by calling function 'set_crash_info' at
  crash-manager.c:1267, is used at crash-manager.c:1332 by calling
  function 'close'."

Change-Id: Ie625bc8ac5eb16a84bb7b139b569c6189e1a5e25

5 years agoRelease 5.5.5 27/195827/2 accepted/tizen/unified/20181219.063407 submit/tizen/20181218.160613
Karol Lewandowski [Tue, 18 Dec 2018 11:25:56 +0000 (12:25 +0100)]
Release 5.5.5

This release brings one change - DLog format specifier fixes for 64-bit
architecures.

Change-Id: I443faa5a06afb9c272c953360e0f85cbf913f7db

5 years agoFix DLog format specifier for 64-bit architecures 26/195826/2
Karol Lewandowski [Tue, 18 Dec 2018 11:15:40 +0000 (12:15 +0100)]
Fix DLog format specifier for 64-bit architecures

Change-Id: I3f29eb0dc3e5081843f0c982dab92cd45aad1364

5 years agoRelease 5.5.4 97/195597/1 accepted/tizen/unified/20181217.142314 submit/tizen/20181214.153700
Karol Lewandowski [Fri, 14 Dec 2018 15:08:46 +0000 (16:08 +0100)]
Release 5.5.4

This release brings following fixes:

 - fix DLog format specifier (needed if DLog start enforcing valid
   printf-formats)

 - fix: Make disk-usage functions use off_t

 - relability fix: crash-manager: Do not force system to wait for
   crash-popup to complete

Change-Id: I733f09298c34c1c7824f57dfa156f23cf9196947

5 years agocrash-stack: Fix format specifier 38/194838/2
Karol Lewandowski [Fri, 7 Dec 2018 10:02:24 +0000 (11:02 +0100)]
crash-stack: Fix format specifier

Change-Id: Ifdc4a229275b866f5718f0779b1a9cba01d7b1ea

5 years agoMake disk-usage functions use off_t 37/194837/2
Karol Lewandowski [Fri, 7 Dec 2018 10:02:06 +0000 (11:02 +0100)]
Make disk-usage functions use off_t

The off_t is the same type that stat(2) uses and it's widest type
that can actually hold information real disk usage.

Change-Id: Id4b5d1160bdecafb065cf6792274c255619817fc

5 years agocrash-manager: Do not force system to wait for crash-popup to complete 46/193646/5
Karol Lewandowski [Thu, 22 Nov 2018 19:34:17 +0000 (20:34 +0100)]
crash-manager: Do not force system to wait for crash-popup to complete

Calling crash-popup is synchronous, meaning that call has to complete
for crash-manager to complete, releasing core pipe descriptor - which
allows another crash to be handled.

This commit releases the core pipe descriptor allowing another crash
to be handled before popup is shown.

Change-Id: Iea08efc6318960ee43bb5494eaff42636529ec17

5 years agoRelease 5.5.3 27/193727/1 submit/tizen/20181123.160941
Karol Lewandowski [Fri, 23 Nov 2018 16:04:11 +0000 (17:04 +0100)]
Release 5.5.3

This release brings full suite of system tests, verified on TM1, Odroid,
32-bit emulator.

Addtionaly, this commit sets fs.suid_dumpable=2 sysctl to ensure all
processes are subject to core dumping.

Change-Id: I0d7142a42ef580ce1cb11c9d246c267438fb299c

5 years agoMerge "Add system tests" into tizen
Karol Lewandowski [Fri, 23 Nov 2018 16:01:27 +0000 (16:01 +0000)]
Merge "Add system tests" into tizen

5 years agoDrop unused service files 44/193644/2
Karol Lewandowski [Thu, 22 Nov 2018 17:49:36 +0000 (18:49 +0100)]
Drop unused service files

This commit removes unused service files originally disabled in
commit 9ef91ff21 ("Fix bugs [..] - Do not install unused services:
tizen-debug-on/off").

Change-Id: Icb41586586106a427524f1c8eddfdedc23d53f93

5 years agosysctl: Set fs.suid_dumpable=2 for release builds 43/193643/2
Karol Lewandowski [Thu, 22 Nov 2018 17:44:03 +0000 (18:44 +0100)]
sysctl: Set fs.suid_dumpable=2 for release builds

This commit enables dumping all processes - including those considered
by kernel as "suid".

Process is considered "suid" not only when it does (among other)
setuid/setgid but also when Capabilities are defined in systemd
unit.  With suid_dumpable=0 crash of such "suid" processes would
not trigger execution of crash-worker by the kernel.

Please see suid_dumpable description in proc(5) for full explanation
what kernel considers "suid".

Change-Id: I067355ba651507b35ef7c8d23245443184b670cf

5 years agoAdd system tests 09/193009/17
Mateusz Moscicki [Mon, 5 Nov 2018 12:46:03 +0000 (13:46 +0100)]
Add system tests

Change-Id: I9db485028d328bcc43e3bc4626c24a7f1a844f53

5 years agoRelease 5.5.2 67/193267/1 accepted/tizen/unified/20181119.153038 submit/tizen/20181116.154004
Karol Lewandowski [Fri, 16 Nov 2018 15:34:31 +0000 (16:34 +0100)]
Release 5.5.2

This version brings one major change - from now on buxton2ctl is used
instead of vconftool to dump the internal database (buxton is the
backend used by vconf anyway).  The reason for this change is
inefficency of vconftool utility, for details see commit 5991e4b
("dump_systemstate: Replace extremely inefficient vconftool with
buxton2ctl").

Minor improvements include:
 - util: Add fsync_path to selectively flush file buffer to disk
 - util: Fix and replace nullvec2str utility function with concatenate()
 - Define _GNU_SOURCE once for whole codebase
 - packaging: Drop unused variables from cmake invocation
 - util: Unify function calling convention to specify destination first
 - util: copy_bytes: Multiple changes

Change-Id: I260c34576783ee0dfa79c9b704939b943dfa0515

5 years agodump_systemstate: Replace extremely inefficient vconftool with buxton2ctl 11/189811/7
Karol Lewandowski [Thu, 20 Sep 2018 19:32:11 +0000 (21:32 +0200)]
dump_systemstate: Replace extremely inefficient vconftool with buxton2ctl

vconftool and buxton2ctl access the same data. vconftool is shell script
which under the hood uses buxton2ctl. However, it does so in very inefficient
manner - to get the keys it calls buxton2ctl once, but to get key values
it calls buxton2ctl for each key.  This causes it to fork

On TM1 target with 548 keys in "db/" this means 548 fork & buxton2ctl execs.
buxton2ctl gets the data from server via socket connection, meaning that
it needs to connect & write request and wait for response.

All of this together sums up to absurd - `buxton2ctl dump system` takes ~50ms,
while `vconftool get db/ -r` takes more than 12seconds - which is roughly
250 times slower!

  sh-3.2# time buxton2ctl dump system >/dev/null
  real    0m0.050s
  user    0m0.040s
  sys     0m0.000s

  sh-3.2# time vconftool get db/ -r >/dev/null
  real    0m12.344s
  user    0m0.560s
  sys     0m1.190s

With this change applied, dump_systemstate invocation time drops from
13seconds to 1.5-2sec (without logs), and from 13 seconds to 3-4secs (with
logs, ie. -k -d -j options).

Change-Id: I0cb042d18e5322d8246bf03ee142117217c83b4c

5 years agoutil: Add fsync_path to selectively flush file buffer to disk 68/192668/5
Karol Lewandowski [Wed, 7 Nov 2018 11:58:19 +0000 (12:58 +0100)]
util: Add fsync_path to selectively flush file buffer to disk

Change-Id: I3cd9169dafff33cdfbaf1c21955c37d38a524fae

5 years agoutil: Fix and replace nullvec2str utility function with concatenate() 47/190547/9
Karol Lewandowski [Tue, 6 Nov 2018 23:21:26 +0000 (00:21 +0100)]
util: Fix and replace nullvec2str utility function with concatenate()

Multiple issues were found and fixed in previously-unused nullvec2str
function, including major problem with possible stack corruption via
long parameters.

This commit completely rewrites the function to dynamically resize the
buffer while appending new parameters to avoid previous problems.

Additionally, name is changed to somewhat more developer friendly name.

Influenced-by: Mateusz Mościcki and Michał Bloch
Change-Id: Ia97e3851bb4b5779a14704098752e3644c487f0b