From f5eb0ff33350a1f9bf3d2968851651a52764222a Mon Sep 17 00:00:00 2001 From: Kim Kibum Date: Sun, 29 Apr 2012 17:01:59 +0900 Subject: [PATCH] upload tizen1.0 source --- debian/changelog | 1255 +--------------------------------- debian/copyright | 29 +- lockupinfo/_util_log.h | 3 +- lockupinfo/lockupinfo.c | 3 +- packaging/sys-assert.spec | 50 +- sys-assert/src/_logic.c | 1092 ------------------------------ sys-assert/src/_logic.h | 23 - sys-assert/src/format | 22 - sys-assert/src/sys-assert.c | 2 +- sys-assert/src/sys-assert.h | 2 +- sys-assert/sys-assert.c | 1273 ----------------------------------- 11 files changed, 25 insertions(+), 3729 deletions(-) delete mode 100644 sys-assert/src/_logic.c delete mode 100644 sys-assert/src/_logic.h delete mode 100644 sys-assert/src/format delete mode 100755 sys-assert/sys-assert.c diff --git a/debian/changelog b/debian/changelog index 56fec67..9a9a062 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,1258 +1,7 @@ sys-assert (0.3.0-2) unstable; urgency=low - * modified package name. - * Git: 165.213.180.114:pkgs/s/sys-assert + * release. + * Git: pkgs/s/sys-assert * Tag: sys-assert_0.3.0-2 -- Jeesun Kim Thu, 22 Dec 2011 18:00:00 +0900 - -sys-assert (0.3.0-1) unstable; urgency=low - - * removed bluescreen, bluescreen-viewer. - * Git: 165.213.180.114:pkgs/s/sys-assert - * Tag: sys-assert_0.3.0-1 - - -- Jeesun Kim Fri, 16 Dec 2011 11:40:00 +0900 - -sys-assert (0.3.0-0) unstable; urgency=low - - * changed git - * Git: 165.213.180.114:pkgs/s/sys-assert - * Tag: sys-assert_0.3.0-0 - - -- Jeesun Kim Thu, 08 Dec 2011 11:40:00 +0900 - -sys-assert (0.2.113) unstable; urgency=low - - * modified backkey icon - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.113 - - -- Jeesun Kim Tue, 06 Dec 2011 11:40:00 +0900 - -sys-assert (0.2.112) unstable; urgency=low - - * modified boilerplate - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.112 - - -- Jeesun Kim Fri, 02 Dec 2011 11:40:00 +0900 - -sys-assert (0.2.111) unstable; urgency=low - - * added code in postinst for dbg package - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.111 - - -- Jeesun Kim Wed, 30 Nov 2011 11:40:00 +0900 - -sys-assert (0.2.110) unstable; urgency=low - - * modfied lockupinfo sh and code - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.110 - - -- Jeesun Kim Wed, 28 Nov 2011 11:40:00 +0900 - -sys-assert (0.2.109) unstable; urgency=low - - * modfied directory permission in lockupinfo - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.109 - - -- Jeesun Kim Wed, 28 Nov 2011 11:30:00 +0900 - -sys-assert (0.2.108) unstable; urgency=low - - * modified lockupinfo which is requested by windowteam - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.108 - - -- Jeesun Kim Wed, 23 Nov 2011 11:30:00 +0900 - -sys-assert (0.2.107) unstable; urgency=low - - * changed root directory from /opt/media to /opt/share/hidden_storage - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.107 - - -- Jeesun Kim Fri, 18 Nov 2011 11:30:00 +0900 - -sys-assert (0.2.106) unstable; urgency=low - - * modified controlbar - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.106 - - -- Jeesun Kim Wed, 16 Nov 2011 11:30:00 +0900 - -sys-assert (0.2.105) unstable; urgency=low - - * open controlbar at first view - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.105 - - -- Jeesun Kim Fri, 09 Nov 2011 11:30:00 +0900 - -sys-assert (0.2.104) unstable; urgency=low - - * added pthread cancel in terminate api - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.104 - - -- Jeesun Kim Fri, 28 Oct 2011 11:30:00 +0900 - -sys-assert (0.2.103) unstable; urgency=low - - * modified bluescreen viewer ui and function - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.103 - - -- Jeesun Kim Fri, 28 Oct 2011 11:00:00 +0900 - -sys-assert (0.2.102) unstable; urgency=low - - * deleted timeout while sending because of big size - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.102 - - -- Jeesun Kim Thu, 20 Oct 2011 11:00:00 +0900 - -sys-assert (0.2.101) unstable; urgency=low - - * modified printf format for wifi progress - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.101 - - -- Jeesun Kim Thu, 20 Oct 2011 10:00:00 +0900 - -sys-assert (0.2.100) unstable; urgency=low - - * added progress status while sending via wifi - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.100 - - -- Jeesun Kim Thu, 20 Oct 2011 09:00:00 +0900 - -sys-assert (0.2.99) unstable; urgency=low - - * fixed double touch send via, modified tar naming rule - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.99 - - -- Jeesun Kim Wed, 19 Oct 2011 09:00:00 +0900 - -sys-assert (0.2.98) unstable; urgency=low - - * modified timeout and added code from window team - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.98 - - -- Jeesun Kim Tue, 18 Oct 2011 09:00:00 +0900 - -sys-assert (0.2.97) unstable; urgency=low - - * modified url and progress ui - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.97 - - -- Jeesun Kim Mon, 17 Oct 2011 09:00:00 +0900 - -sys-assert (0.2.96) unstable; urgency=low - - * added build string in callstack - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.96 - - -- Jeesun Kim Wed, 12 Oct 2011 11:00:00 +0900 - -sys-assert (0.2.95) unstable; urgency=low - - * fixed: add flag between app create and app reset not to exit while threading - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.95 - - -- Jeesun Kim Wed, 12 Oct 2011 10:00:00 +0900 - -sys-assert (0.2.94) unstable; urgency=low - - * modified navi and indi relation - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.94 - - -- Jeesun Kim Wed, 12 Oct 2011 09:00:00 +0900 - -sys-assert (0.2.93) unstable; urgency=low - - * modified navi resolution - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.93 - - -- Jeesun Kim Tue, 11 Oct 2011 11:00:00 +0900 - -sys-assert (0.2.92) unstable; urgency=low - - * modified from navigationbar to naviframe - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.92 - - -- Jeesun Kim Mon, 10 Oct 2011 11:00:00 +0900 - -sys-assert (0.2.91) unstable; urgency=low - - * modified resolution 720 * 1280 - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.91 - - -- Jeesun Kim Mon, 10 Oct 2011 10:00:00 +0900 - -sys-assert (0.2.90) unstable; urgency=low - - * added files (/opt/etc/.debugmode, /etc/udev/rules.d/92-rb-dump.rules) - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.90 - - -- Jeesun Kim Thu, 22 Sep 2011 09:00:00 +0900 - -sys-assert (0.2.89) unstable; urgency=low - - * added modified code - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.89 - - -- Jeesun Kim Thu, 22 Sep 2011 09:00:00 +0900 - -sys-assert (0.2.88) unstable; urgency=low - - * delete network library - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.88 - - -- Jeesun Kim Thu, 16 Sep 2011 09:00:00 +0900 - -sys-assert (0.2.87) unstable; urgency=low - - * added code(make log) frome window team 3 - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.87 - - -- Jeesun Kim Thu, 16 Sep 2011 09:00:00 +0900 - -sys-assert (0.2.86) unstable; urgency=low - - * added code(make log) frome window team 2 - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.86 - - -- Jeesun Kim Thu, 16 Sep 2011 09:00:00 +0900 - -sys-assert (0.2.85) unstable; urgency=low - - * added code(make log) frome window team 1 - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.85 - - -- Jeesun Kim Thu, 16 Sep 2011 09:00:00 +0900 - -sys-assert (0.2.84) unstable; urgency=low - - * removed dnet library - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.84 - - -- Jeesun Kim Thu, 15 Sep 2011 09:00:00 +0900 - -sys-assert (0.2.83) unstable; urgency=low - - * added apache license - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.83 - - -- Jeesun Kim Mon, 5 Sep 2011 09:00:00 +0900 - -sys-assert (0.2.82) unstable; urgency=low - - * added license - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.82 - - -- Jeesun Kim Tue, 23 Aug 2011 18:15:17 +0900 - -sys-assert (0.2.81) unstable; urgency=low - - * added data(home directory) path - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.81 - - -- Jeesun Kim Mon, 22 Aug 2011 18:15:17 +0900 - -sys-assert (0.2.80) unstable; urgency=low - - * fixed back key error - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.80 - - -- Jeesun Kim Thu, 4 Jul 2011 18:15:17 +0900 - -sys-assert (0.2.79) unstable; urgency=low - - * added back sorfkey - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.79 - - -- Jeesun Kim Wed, 3 Jul 2011 18:15:17 +0900 - -sys-assert (0.2.78) unstable; urgency=low - - * applied code cleanup - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.78 - - -- Jeesun Kim Wed, 27 Jul 2011 18:15:17 +0900 - -sys-assert (0.2.77) unstable; urgency=low - - * modified genlist style name from 2line_textonly to 2text.2 - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.77 - - -- Jeesun Kim Thu, 23 Jun 2011 18:15:17 +0900 - -sys-assert (0.2.76) unstable; urgency=low - - * change pending_list to list_process due to cpu % - * add checking argv[1], argv[2] - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.76 - - -- Youngkyeong Yun Thu, 28 Apr 2011 23:15:17 +0900 - -sys-assert (0.2.75) unstable; urgency=low - - * package name modification - "deb." prefix removal - * remove white space in source code - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.75 - - -- Youngkyeong Yun Tue, 12 Apr 2011 14:34:28 +0900 - -sys-assert (0.2.74) unstable; urgency=low - - * fix problem occured when trying to send on not connected status - * add sqlite error message - * fix readlink problem in add_callstack_info - * add dlog - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.74 - - -- Youngkyeong Yun Thu, 07 Apr 2011 21:43:01 +0900 - -sys-assert (0.2.73) unstable; urgency=low - - * add pkgconfig file of gthread-2.0 to blue-screen/CMakefile - * save dlog above debug priority when crash occurs - * fix buf in add_callstack_info - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.73 - - -- Youngkyeong Yun Wed, 06 Apr 2011 16:28:33 +0900 - -sys-assert (0.2.72) unstable; urgency=low - - * fix path of /opt/var/log/dlog - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.72 - - -- Youngkyeong Yun Mon, 04 Apr 2011 20:39:52 +0900 - -sys-assert (0.2.71) unstable; urgency=low - - * copy /opt/var/log/dlog* to debug directory - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.71 - - -- root Mon, 28 Mar 2011 20:28:39 +0900 - -sys-assert (0.2.70) unstable; urgency=low - - * fix bug : crash when touch back button - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.70 - - -- Youngkyeong Yun Tue, 22 Mar 2011 00:41:59 +0900 - -sys-assert (0.2.69) unstable; urgency=low - - * remove setup_bs.sh. debug mode setting script runs in rc.sysinit - * fix bug : crash when try uploading even if file size is 0 - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.69 - - -- Youngkyeong Yun Fri, 11 Mar 2011 19:33:42 +0900 - -sys-assert (0.2.68) unstable; urgency=low - - * fix bug : crash when compressing popup ends - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.68 - - -- Youngkyeong Yun Thu, 10 Mar 2011 18:45:47 +0900 - -sys-assert (0.2.67) unstable; urgency=low - - * use pmapi to prevent sleep mode when making crash files - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.67 - - -- Youngkyeong Yun Wed, 09 Mar 2011 20:36:38 +0900 - -sys-assert (0.2.66) unstable; urgency=low - - * fix twice call of ecore_edler_del - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.66 - - -- Youngkyeong Yun Tue, 08 Mar 2011 23:17:00 +0900 - -sys-assert (0.2.65) unstable; urgency=low - - * add_package_info() add pakcage info to cs file - * set dumpable in sighandler to ensure generating core dump (0.2.64) - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.65 - - -- Youngkyeong Yun Tue, 08 Mar 2011 13:44:03 +0900 - -sys-assert (0.2.64) unstable; urgency=low - - * add thread for move files and compress files - * Add missing pkg-config files for gcc 4.5 - * fix end key popup - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.64 - - -- Youngkyeong Yun Mon, 07 Mar 2011 19:40:09 +0900 - -sys-assert (0.2.63) unstable; urgency=low - - * change to use FTP when crash upload - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.63 - - -- Youngkyeong Yun Thu, 03 Mar 2011 21:05:33 +0900 - -sys-assert (0.2.62) unstable; urgency=low - - * fix dli_fname which returned by dladdr when process is launched by launchpad - * remove unneeded stat and change sqlite3_open to sqlite3_open_v2 to open DB by read only mode - * change icon of bs-viewer and fix up path of bs-viewer - * add yk.yun to maintainer - * fix for prevent - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.62 - - -- Youngkyeong Yun Mon, 14 Feb 2011 20:56:59 +0900 - -sys-assert (0.2.61) unstable; urgency=low - - * change symbol DB path to /opt/share/symbol.db - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.61 - - -- Youngkyeong Yun Wed, 19 Jan 2011 14:43:32 +0900 - -sys-assert (0.2.60) unstable; urgency=low - - * use symbo DB for callstack ( add_callstack_info() ) - * remove elm_popup_rotation_set api - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.60 - - -- Youngkyeong Yun Wed, 12 Jan 2011 23:32:17 +0900 - -sys-assert (0.2.59) unstable; urgency=low - - * bug fix : show callstack even if there is no result from backtrace() - * add compress success popup - * fix structure of displaying popup - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.59 - - -- Youngkyeong Yun Mon, 20 Dec 2010 20:11:58 +0900 - -sys-assert (0.2.58) unstable; urgency=low - - * enable sending via 3g network - * fix CMakeList.txt - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.58 - - -- Youngkyeong Yun Thu, 16 Dec 2010 00:26:24 +0900 - -sys-assert (0.2.57) unstable; urgency=low - - * prepare code for sending via 3g network - * fix message of popup - * add depedency to vconf - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.57 - - -- Youngkyeong Yun Tue, 14 Dec 2010 21:11:59 +0900 - -sys-assert (0.2.56) unstable; urgency=low - - * remove wifi-ug dependency - * add crash_logger_send_by_dnet.c for send via 3g - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.56 - - -- Youngkyeong Yun Fri, 10 Dec 2010 20:12:33 +0900 - -sys-assert (0.2.55) unstable; urgency=low - - * make send_cb to work in thread - * add progressive bar - * add bundle for wifi show alarm when not connected - * hide indicator in bs-viewer - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.55 - - -- Youngkyeong Yun Tue, 07 Dec 2010 21:45:16 +0900 - -sys-assert (0.2.54) unstable; urgency=low - - * bug fix : remove SIGTERM detection - * apply pie option to lockupinfo and blue-screen - * use xinfo -xwd_topvwins displace of screenshot in lockupinfo - * Git: 165.213.180.234:slp/pkgs/s/sys-assert - * Tag: sys-assert_0.2.54 - - -- Youngkyeong Yun Mon, 06 Dec 2010 11:00:10 +0900 - -sys-assert (0.2.53) unstable; urgency=low - - * bug fix : problem with get_localtime. - * change text of send button to send via Wi-Fi - * change text of send button in wifi ug to start sending - * change time of displaying popup after send file to 4 sec - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.53 - - -- Youngkyeong Yun Wed, 01 Dec 2010 18:16:01 +0900 - -sys-assert (0.2.52) unstable; urgency=low - - * fix nil/nil. ensure pc and lr value in callstack - * add result popup message after sending log via WIFI - * apply pie option to bs-viewer - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.52 - - -- Youngkyeong Yun Fri, 26 Nov 2010 04:25:32 +0900 - -sys-assert (0.2.51) unstable; urgency=low - - * change pkg name blue-screen to deb.com.samsung.blue-screen - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.51 - - -- Youngkyeong Yun Wed, 24 Nov 2010 21:33:34 +0900 - -sys-assert (0.2.50) unstable; urgency=low - - * change debug directory to /opt/media/SLP_debug for support MTP - * disable send all button - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.50 - - -- Youngkyeong Yun Thu, 18 Nov 2010 21:14:09 +0900 - -sys-assert (0.2.49) unstable; urgency=low - - * change string of button displayed in wifi UG - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.49 - - -- Youngkyeong Yun Fri, 12 Nov 2010 14:38:22 +0900 - -sys-assert (0.2.48) unstable; urgency=low - - * add feature : send via wifi, use wifi UG - * create directory when launch lockup info - * disable print maps information on bluescreen for performance - * remove warnings - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.48 - - -- Youngkyeong Yun Thu, 11 Nov 2010 16:35:13 +0900 - -sys-assert (0.2.47) unstable; urgency=low - - * copy pre.Xorg* log when bluescreen occurs - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.47 - - -- Youngkyeong Yun Fri, 29 Oct 2010 16:42:33 +0900 - -sys-assert (0.2.46) unstable; urgency=low - - * fix rename core dump problem. change renmae to mv - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.46 - - -- Youngkyeong Yun Wed, 27 Oct 2010 22:18:04 +0900 - -sys-assert (0.2.45) unstable; urgency=low - - * change chown in libsys-assert-0.postinst - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.45 - - -- Youngkyeong Yun Wed, 27 Oct 2010 18:49:32 +0900 - -sys-assert (0.2.44) unstable; urgency=low - - * remove send_log and add save_crash - * remove send/send_all button - * chagne CRASHLOG_DIR crash/files to crash/send - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.44 - - -- Youngkyeong Yun Wed, 27 Oct 2010 15:43:22 +0900 - -sys-assert (0.2.43) unstable; urgency=low - - * change core_patter to /opt/bs/core/ - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.43 - - -- Youngkyeong Yun Tue, 26 Oct 2010 22:51:31 +0900 - -sys-assert (0.2.42) unstable; urgency=low - - * add showing timestamp when run dlogutl - * copy nand log - * change core_patter to /opt/bs/ - * create /opt/media/.tmp/debug - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.42 - - -- Youngkyeong Yun Tue, 26 Oct 2010 20:22:58 +0900 - -sys-assert (0.2.41) unstable; urgency=low - - * fix time value in lockupinfo - * add lockupinfo feature : copying kernel log, dlog etc - * bug fix : copy Xorg log - * enable showing lockupinfo in bs-viewer - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.41 - - -- Youngkyeong Yun Tue, 26 Oct 2010 17:41:17 +0900 - -sys-assert (0.2.40) unstable; urgency=low - - * bug fix : string sending popup - * create debug directory in postinst - * copy Xorg log when bluescreen launched - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.40 - - -- Youngkyeong Yun Fri, 22 Oct 2010 20:53:42 +0900 - -sys-assert (0.2.39) unstable; urgency=low - - * bug fix : remove doule closedir in bs-viewer - * enable end key - * displace fork/execute BS in bs-viewer with using curbs.log - * add popup which show "sending files bra bra" - * directory change ( /opt/system/debug/bs to /opt/bs, - /opt/system/debug/crash to /opt/media/.tmp/debug/crash) - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.39 - - -- Youngkyeong Yun Mon, 18 Oct 2010 20:09:52 +0900 - -sys-assert (0.2.38) unstable; urgency=low - - * make directory if /opt/media/.tmp is absent - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.38 - - -- Youngkyeong Yun Fri, 15 Oct 2010 15:47:20 +0900 - -sys-assert (0.2.37) unstable; urgency=low - - * change debug directory /opt/system/debug to /opt/media/.tmp/debug - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.37 - - -- Youngkyeong Yun Tue, 12 Oct 2010 17:18:15 +0900 - -sys-assert (0.2.36) unstable; urgency=low - - * enable end key - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.36 - - -- Youngkyeong Yun Thu, 07 Oct 2010 19:06:22 +0900 - -sys-assert (0.2.35) unstable; urgency=low - - * add no list text no bs-viewer if there is no crash files - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.35 - - -- Youngkyeong Yun Wed, 06 Oct 2010 15:26:08 +0900 - -sys-assert (0.2.34) unstable; urgency=low - - * chagne entry to label in bluescreen - * enable popup after touching send or send all - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.34 - - -- Youngkyeong Yun Mon, 04 Oct 2010 18:53:21 +0900 - -sys-assert (0.2.33) unstable; urgency=low - - * disable context popup - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.33 - - -- Youngkyeong Yun Fri, 01 Oct 2010 18:55:22 +0900 - -sys-assert (0.2.32) unstable; urgency=low - - * fix build error in new build system - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.32 - - -- Youngkyeong Yun Thu, 30 Sep 2010 11:06:26 +0900 - -sys-assert (0.2.31) unstable; urgency=low - - * fix error in handling unprintable value - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.31 - - -- Youngkyeong Yun Fri, 17 Sep 2010 21:31:11 +0900 - -sys-assert (0.2.30) unstable; urgency=low - - * add check routine for unprintable value in bluescreen - * if prctl(PR_GET_DUMPABLE) returns 0, print message in sighandler - * use duble fork to run send_log.sh - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.30 - - -- Youngkyeong Yun Fri, 17 Sep 2010 20:55:40 +0900 - -sys-assert (0.2.29) unstable; urgency=low - - * efl upgrade - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.29 - - -- Youngkyeong Yun Sat, 11 Sep 2010 18:53:24 +0900 - -sys-assert (0.2.28) unstable; urgency=low - - * remove legacy codes for avatar - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.28 - - -- Youngkyeong Yun Fri, 03 Sep 2010 15:09:02 +0900 - -sys-assert (0.2.27) unstable; urgency=low - - * remove libsys-assert-dev pkg - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.27 - - -- Youngkyeong Yun Fri, 27 Aug 2010 10:56:26 +0900 - -sys-assert (0.2.26) unstable; urgency=low - - * add extra errno - * fix up bs-viewer for launch properly - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.26 - - -- Youngkyeong Yun Tue, 24 Aug 2010 16:17:52 +0900 - -sys-assert (0.2.25) unstable; urgency=low - - * change umaks to assure of file permission - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.25 - - -- Youngkyeong Yun Tue, 17 Aug 2010 15:34:29 +0900 - -sys-assert (0.2.24) unstable; urgency=low - - * repackaging - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.24 - - -- Youngkyeong Yun Sun, 15 Aug 2010 19:55:19 +0900 - -sys-assert (0.2.23) unstable; urgency=low - - * fix to move executing send_file after drawing - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.23 - - -- Youngkyeong Yun Sun, 15 Aug 2010 19:35:36 +0900 - -sys-assert (0.2.22) unstable; urgency=low - - * modify file permission for creating crash directory - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.22 - - -- Youngkyeong Yun Fri, 13 Aug 2010 16:45:17 +0900 - -sys-assert (0.2.21) unstable; urgency=low - - * blue-screen: use beat theme instead of kessler - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.21 - - -- Wonguk Jeong Tue, 10 Aug 2010 22:24:11 +0900 - -sys-assert (0.2.20) unstable; urgency=low - - * Modify file permisstion - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.20 - - -- Sangjung Woo Mon, 09 Aug 2010 09:26:59 +0900 - -sys-assert (0.2.19) unstable; urgency=low - - * use new appcore - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.19 - - -- Wonguk Jeong Thu, 05 Aug 2010 09:26:59 +0900 - -sys-assert (0.2.18) unstable; urgency=low - - * fix the postinst script for security issue - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.18 - - -- Sangjung Woo Mon, 2 Aug 2010 17:00:59 +0900 - -sys-assert (0.2.17) unstable; urgency=low - - * fix the directory and file permission for security issue - * Git: 165.213.180.234:/git/slp/pkgs/sys-assert - * Tag: sys-assert_0.2.17 - - -- Sangjung Woo Mon, 2 Aug 2010 17:00:59 +0900 - -sys-assert (0.2.16) unstable; urgency=low - - * fix elm_object_disabled_set() to elm_entry_editable_set() in blue-screen/blue-screen.c - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.16 - - -- Youmin Ha Mon, 12 Jul 2010 10:20:59 +0900 - -sys-assert (0.2.15-16) unstable; urgency=low - - * change maintainer - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-16 - - -- Youmin Ha Thu, 08 Jul 2010 20:33:19 +0900 - -sys-assert (0.2.15-15) unstable; urgency=low - - * remove legacy dlog file dump - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-15 - - -- Youngkyeong Yun Wed, 16 Jun 2010 11:46:55 +0900 - -sys-assert (0.2.15-14) unstable; urgency=low - - * fix error : send in blue-screen is not working when bs is launched by bs-bewer - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-14 - - -- Youngkyeong Yun Fri, 11 Jun 2010 15:36:54 +0900 - -sys-assert (0.2.15-13) unstable; urgency=low - - * prevent app_terminate is called twice - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-13 - - -- Youngkyeong Yun Fri, 11 Jun 2010 13:14:22 +0900 - -sys-assert (0.2.15-12) unstable; urgency=low - - * fix error - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-12 - - -- Youngkyeong Yun Fri, 11 Jun 2010 12:09:06 +0900 - -sys-assert (0.2.15-11) unstable; urgency=low - - * repackaging - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-11 - - -- Youngkyeong Yun Mon, 07 Jun 2010 10:55:44 +0900 - -sys-assert (0.2.15-10) unstable; urgency=low - - * add theme to fix error - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-10 - - -- Youngkyeong Yun Mon, 07 Jun 2010 10:28:33 +0900 - -sys-assert (0.2.15-9) unstable; urgency=low - - * fix erro - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-9 - - -- Youngkyeong Yun Thu, 03 Jun 2010 23:34:00 +0900 - -sys-assert (0.2.15-8) unstable; urgency=low - - * remove deprecated api - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-8 - - -- Youngkyeong Yun Thu, 03 Jun 2010 20:27:10 +0900 - -sys-assert (0.2.15-7) unstable; urgency=low - - * repackaging - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-7 - - - -- Youngkyeong Yun Sun, 23 May 2010 17:39:12 +0900 - -sys-assert (0.2.15-6) unstable; urgency=low - - * make bs window always on top - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-6 - - -- Youngkyeong Yun Thu, 20 May 2010 14:20:22 +0900 - -sys-assert (0.2.15-5) unstable; urgency=low - - * fix postinst - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-5 - - -- Youngkyeong Yun Wed, 19 May 2010 15:50:55 +0900 - -sys-assert (0.2.15-4) unstable; urgency=low - - * BUG FIX : string in INOTIFY_BS is not correct. so add O_APPEND - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-4 - - -- Youngkyeong Yun Mon, 03 May 2010 14:37:35 +0900 - -sys-assert (0.2.15-3) unstable; urgency=low - - * BUG FIX : problem occurs when making ramdump file because of buffer overflow. so change PATH_LEN 128 to 256 - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-3 - - - -- Youngkyeong Yun Wed, 28 Apr 2010 15:16:52 +0900 - -sys-assert (0.2.15-2) unstable; urgency=low - - * add time infomation to ramdump file - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-2 - - - -- Youngkyeong Yun Mon, 26 Apr 2010 20:07:13 +0900 - -sys-assert (0.2.15-1) unstable; urgency=low - - * delete unneeded codes in trace_symbols() - * add sys-assert-0.postinst - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-1 - - -- Youngkyeong Yun Tue, 20 Apr 2010 11:38:26 +0900 - -sys-assert (0.2.15-0) unstable; urgency=low - - * add register info - * get callstack using libc backtrace function - * fix trace symbol function - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.15-0 - - -- Youngkyeong Yun Mon, 19 Apr 2010 15:01:51 +0900 - -sys-assert (0.2.14-5) unstable; urgency=low - - * add message when PURPLE screen displayed - * add dbg package - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.14-5 - - -- Youngkyeong Yun Wed, 14 Apr 2010 20:38:46 +0900 - -sys-assert (0.2.14-4) unstable; urgency=low - - * repacking - * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert_0.2.14-4 - - - -- Youngkyeong Yun Mon, 12 Apr 2010 22:16:33 +0900 - -sys-assert (0.2.14-3) unstable; urgency=low - - * repacking - * git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert-0_0.2.14-3 - - -- Youngkyeong Yun Mon, 12 Apr 2010 22:03:06 +0900 - -sys-assert (0.2.14-2) unstable; urgency=low - - * repacking - * git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-asser_0.2.14-2 - - - -- Youngkyeong Yun Mon, 12 Apr 2010 21:49:55 +0900 - -sys-assert (0.2.14-1) unstable; urgency=low - - * repacking - * git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-asser_0.2.14-1 - - - -- Youngkyeong Yun Mon, 12 Apr 2010 21:34:49 +0900 - -sys-assert (0.2.14-0) unstable; urgency=low - - * fix appname, exepath for avatar-factory - * git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-asser_0.2.14-0 - - -- Youngkyeong Yun Mon, 12 Apr 2010 20:18:42 +0900 - -sys-assert (0.2.13-0) unstable; urgency=low - - * add get_localtime to convert time_t value to struct tm - * fix for lockup ( remove fork/exec, system() call ) - * git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/sys-assert-0 - * Tag: sys-assert-0_0.2.13-0 - - -- Youngkyeong Yun Fri, 02 Apr 2010 14:45:00 +0900 - -sys-assert (0.2.12-6) unstable; urgency=low - - * add setup_bs.sh for profile - - -- Youngkyeong Yun Sat, 27 Mar 2010 16:20:31 +0900 - -sys-assert (0.2.12-5) unstable; urgency=low - - * toolchain upgrade - - -- Youngkyeong Yun Thu, 25 Mar 2010 16:54:59 +0900 - -sys-assert (0.2.12-4) unstable; urgency=low - - * EFL update - - -- Youngkyeong Yun Tue, 16 Mar 2010 11:49:44 +0900 - -sys-assert (0.2.12-3) unstable; urgency=low - - * fix lockupinfo.sh - - -- Youngkyeong Yun Thu, 11 Mar 2010 09:54:24 +0900 - -sys-assert (0.2.12-2) unstable; urgency=low - - * add lockupinfo.sh - - -- Youngkyeong Yun Wed, 10 Mar 2010 20:45:44 +0900 - -sys-assert (0.2.12-1) unstable; urgency=low - - * add evas_object_how(ad->win_main) in app_init() - - -- Youngkyeong Yun Wed, 10 Mar 2010 18:25:06 +0900 - -sys-assert (0.2.12-0) unstable; urgency=low - - * change theme to use kessler - - -- Youngkyeong Yun Fri, 05 Mar 2010 16:52:33 +0900 - -sys-assert (0.2.11-0) unstable; urgency=low - - * add windows ping info, dump topvwins to lockupinfo - - -- Youngkyeong Yun Thu, 04 Mar 2010 23:00:24 +0900 - -sys-assert (0.2.10-0) unstable; urgency=low - - * Feature add : add ramdump to lockup - - -- Youngkyeong Yun Wed, 03 Mar 2010 21:45:19 +0900 - -sys-assert (0.2.9-0) unstable; urgency=low - - * Feature add : add popup when send button touched - - -- Youngkyeong Yun Wed, 03 Mar 2010 15:18:48 +0900 - -sys-assert (0.2.8-0) unstable; urgency=low - - * feature add : move telephony log to bs directory - - -- Youngkyeong Yun Wed, 24 Feb 2010 21:09:20 +0900 - -sys-assert (0.2.7-0) unstable; urgency=low - - * lockupinfo is added, fix to do not show indicator when bs occurs - - -- Youngkyeong Yun Wed, 24 Feb 2010 15:32:17 +0900 - -sys-assert (0.2.6-6) unstable; urgency=low - - * purple screen is enabled - - -- Youngkyeong Yun Mon, 22 Feb 2010 11:28:53 +0900 - -sys-assert (0.2.6-5) unstable; urgency=low - - * BUG FIX : add clodedir for opened vip, permanent dir - - -- Youngkyeong Yun Wed, 17 Feb 2010 12:36:49 +0900 - -sys-assert (0.2.6-4) unstable; urgency=low - - * purple screen is disabled ( for MWC ) - - -- Youngkyeong Yun Wed, 10 Feb 2010 17:18:03 +0900 - -sys-assert (0.2.6-3) unstable; urgency=low - - * purple screen is enabled - - -- Youngkyeong Yun Tue, 09 Feb 2010 23:24:29 +0900 - -sys-assert (0.2.6-2) unstable; urgency=low - - * purple screen is temporary disabled - - -- Youngkyeong Yun Tue, 09 Feb 2010 12:34:03 +0900 - -sys-assert (0.2.6-1) unstable; urgency=low - - * delete libui-softkey-0, TW3-softkey - - -- Youngkyeong Yun Mon, 08 Feb 2010 22:54:22 +0900 - -sys-assert (0.2.6-0) unstable; urgency=low - - * ADD FEATURE : Red/purple screen - - -- Youngkyeong Yun Mon, 08 Feb 2010 12:28:07 +0900 - -sys-assert (0.2.5-0-1EFL+) unstable; urgency=low - - * Reversion for -1EFL+ - - -- Youngkyeong Yun Thu, 04 Feb 2010 14:58:07 +0900 - -sys-assert (0.2.5-0) unstable; urgency=low - - * change dbg directory to /opt/system/debug - - -- Youngkyeong Yun Tue, 02 Feb 2010 17:02:00 +0900 - -sys-assert (0.2.4-0) unstable; urgency=low - - * change winset API - - -- Youngkyeong Yun Sat, 30 Jan 2010 13:55:14 +0900 - -sys-assert (0.2.3-1) unstable; urgency=low - - * change path - - -- Youngkyeong Yun Fri, 29 Jan 2010 09:51:33 +0900 - -sys-assert (0.2.3-0) unstable; urgency=low - - * delete applog and change API using prefix "SLP_" - - -- Youngkyeong Yun Wed, 27 Jan 2010 09:59:42 +0900 - -sys-assert (0.2.2-1) unstable; urgency=low - - * rebuild for EFL upgrade - - -- Youngkyeong Yun Fri, 22 Jan 2010 14:57:33 +0900 - -sys-assert (0.2.2-0) unstable; urgency=low - - * sys-assert do not wait BS anymore, print FreeMem, Print package info, bug - fix : print last line repeated - - -- Youngkyeong Yun Thu, 21 Jan 2010 16:12:20 +0900 - -sys-assert (0.2.1-1) unstable; urgency=low - - * bug fix : support i686 build - - -- Youngkyeong Yun Wed, 20 Jan 2010 21:36:45 +0900 - -sys-assert (0.2.1-0) unstable; urgency=low - - * add bs-viewer , bug fix : segmentation error because of padding size - - -- Youngkyeong Yun Tue, 19 Jan 2010 12:12:57 +0900 - -sys-assert (0.2.0-2) unstable; urgency=low - - * bug fix : libsys-assert-dev missing files (/usr/lib/libsys-assert*.la) - - -- Youngkyeong Yun Wed, 06 Jan 2010 19:43:40 +0900 - -sys-assert (0.2.0-0) unstable; urgency=low - - * add blue screen pkg - - -- Youngkyeong Yun Wed, 06 Jan 2010 19:19:42 +0900 - -sys-assert (0.1.1-0) unstable; urgency=low - - * Add information - - -- Youngkyeong Yun Tue, 05 Jan 2010 16:32:16 +0900 - -sys-assert (0.1.0-0) unstable; urgency=low - - * Initial Release. - - -- Youngkyeong Yun Mon, 29 Dec 2009 16:38:38 +0900 diff --git a/debian/copyright b/debian/copyright index 61147ee..4f93c69 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,26 +1,7 @@ -This is sys-assert, written and maintained by unknown -on Wed, 06 Jan 2010 15:31:21 +0900. +Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved. -The original source can always be found at: - ftp://ftp.debian.org/dists/unstable/main/source/ +This program is free software; you can redistribute it and/or modify +it under the terms of the Apache License version 2.0. -Copyright Holder: unknown - -License: - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -On Debian systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. +The full text of the Apache 2.0 can be found in +/usr/share/common-licenses. diff --git a/lockupinfo/_util_log.h b/lockupinfo/_util_log.h index 3cb7969..39a72d9 100644 --- a/lockupinfo/_util_log.h +++ b/lockupinfo/_util_log.h @@ -1,8 +1,7 @@ - /* * LOCKUPINFO * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Jeesun Kim * diff --git a/lockupinfo/lockupinfo.c b/lockupinfo/lockupinfo.c index ec358d6..d2d525a 100644 --- a/lockupinfo/lockupinfo.c +++ b/lockupinfo/lockupinfo.c @@ -1,8 +1,7 @@ - /* * LOCKUPINFO * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Jeesun Kim * diff --git a/packaging/sys-assert.spec b/packaging/sys-assert.spec index fcd5984..7514a6c 100644 --- a/packaging/sys-assert.spec +++ b/packaging/sys-assert.spec @@ -3,10 +3,15 @@ Summary: System Assert Version: 0.3.0 Release: 1 Group: TBD -License: LGPL +License: Apache_2.0 Source0: %{name}-%{version}.tar.gz +BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(heynoti) +BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(utilX) +BuildRequires: pkgconfig(ui-gadget) +BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(sqlite3) @@ -14,10 +19,10 @@ BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(pmapi) BuildRequires: pkgconfig(libcurl) BuildRequires: cmake +BuildRequires: edje-tools %description -System Assert - +libsys-assert (shared object). %prep %setup -q @@ -29,48 +34,21 @@ export CFLAGS+=" -fPIC" %endif cmake . -DCMAKE_INSTALL_PREFIX=/usr + make %{?jobs:-j%jobs} %install -%make_install +rm -rf %{buildroot} -mkdir -p %{buildroot}/opt/bs/core -mkdir -p %{buildroot}/opt/share/hidden_storage/SLP_debug -touch %{buildroot}/opt/etc/.debugmode +%make_install %post -p /sbin/ldconfig -chown root:5000 /opt/bs/core -chmod 775 /opt/bs/core - -chown root:5000 /opt/share/hidden_storage/SLP_debug -chmod 755 /opt/share/hidden_storage -chmod 775 /opt/share/hidden_storage/SLP_debug - - -# added below for dbg package -DBG_DIR=/home/developer/sdk_tools/usr/lib/debug - -if [ -L /usr/lib/debug ] -then - echo "already exists" - exit -fi - -mkdir -p ${DBG_DIR} -if [ -d /usr/lib/debug ] -then - cp -a /usr/lib/debug/* ${DBG_DIR} - rm -rf /usr/lib/debug -fi - -ln -sf ${DBG_DIR} /usr/lib/debug %postun -p /sbin/ldconfig %files /usr/bin/* /usr/lib/*.so* -/etc/udev/rules.d/* -%dir /opt/bs/core -%dir /opt/share/hidden_storage/SLP_debug -%config(missingok) /opt/etc/.debugmode +/etc/udev/rules.d/92-rb-dump.rules +/opt/etc/.debugmode + diff --git a/sys-assert/src/_logic.c b/sys-assert/src/_logic.c deleted file mode 100644 index 7f47349..0000000 --- a/sys-assert/src/_logic.c +++ /dev/null @@ -1,1092 +0,0 @@ - -/* - * SYS-ASSERT - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Jeesun Kim Youngkyeong Yun - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#define CS_DIR "/opt/share/hidden_storage/SLP_debug" -#define VERINFO_PATH "/etc/info.ini" -#define CMDLINE_PATH "/proc/self/cmdline" - - -/* WARNING : formatted string buffer is limited to 1024 byte */ -int _fdrintf(int fd, const char *fmt, ...) -{ - int n; - char buff[1024]; - va_list args; - va_start(args, fmt); - n = vsnprintf(buff, 1024 - 1, fmt, args); - write(fd, buff, n); - va_end(args); - return n; -} - -char *fgets_fd(char *s, int n, int fd) -{ - char c; - register char *cs; - int num = 0; - - cs = s; - while (--n > 0 && (num = read(fd, &c, 1) > 0)) { - if ((*cs++ = c) == '\n') - break; - } - *cs = '\0'; - return (num == 0 && cs == s) ? NULL : s; -} - -static char *_get_dir_name(char *src) -{ - char *t, *r; - - t = r = (char *)src; - - while (*t) { - if (*t == '/' || *t == '.') - r = t + 1; - t++; - } - return r; -} - -int _get_appname(char *apppath, char *appname, int size) -{ - int pfd, ret; - - pfd = open(CMDLINE_PATH, O_RDONLY); - if (pfd < 0) { - fprintf(stderr, "Failed to open (%s)\n", CMDLINE_PATH); - } - - read(pfd, apppath, size); - snprintf(appname, size, "%s", - pfd < 0 ? "Unknown" : _get_dir_name(buf)); - - close(pfd); -} - -int _filter_with_appname(char *appname) -{ - retvm_if(appname == NULL, -1, "Invalid argument: appname is NULL\n"); - if (!strcmp(appname, "dpkg-deb")) { - return -1; - } - return 0; -} - -int _check_pid_exist(char *dir, char *strpid) -{ - int ret = 0; - DIR *dp; - struct dirent *dirp; - - dp = opendir(dir); - if (dp == NULL) { - fprintf(stderr, "Failed to open (%s)\n", dir); - return -1; - } - - while ((dirp = readdir(dp)) != NULL) { - if (!strcmp(dirp->d_name, strpid)) { - ret = 1; - } - } - closedir(dp); - return ret; -} - -void _write_crash_color(int fd, int pid) -{ - int color = 0; - DIR *dp; - struct dirent *dirp; - char strpid[10]; - - snprintf(strpid, sizeof(strpid), "%d", pid); - - if (_check_pid_exist("/tmp/vip", strpid) > 0) { - fprintf(stderr, "pid=%d is VIP process\n", pid); - _fprintf(fd, "RED SCREEN"); - - } else if (_check_pid_exist("/tmp/permanent", strpid) > 0) { - fprintf(stderr, "pid=%d is Permanent process\n", pid); - _fprintf(fd, "BLUE SCREEN"); - } - } -} - -void _write_sw_version(int fd) -{ - int pfd; - char *str1 = "Major="; - char *str2 = "Minor="; - char *str3 = "Build="; - char *str4 = "Date="; - char *str5 = "Time="; - char buf[256] = {0, }; - int len1, len2, len3, len4, len5; - - len1 = strlen(str1); - len2 = strlen(str2); - len3 = strlen(str3); - len4 = strlen(str4); - len5 = strlen(str5); - - pfd = open(VERINFO_PATH, O_RDONLY); - if (pfd < 0) { - fprintf(stderr, "Failed to open (%s)\n", VERINFO_PATH); - return; - } - - _fdrintf(fd, - "******************************\n" - "s/w version\n" - "******************************\n"); - while (fgets_fd(buf, sizeof(buf), pfd) != NULL) { - if (!strncmp(str1, buf, len1)) { - _fdrintf(fd, "%s", buf); - - } else if (!strncmp(str2, buf, len2)) { - _fdrintf(fd, "%s", buf); - - } else if (!strncmp(str3, buf, len3)) { - _fdrintf(fd, "%s", buf); - - } else if (!strncmp(str4, buf, len4)) { - _fdrintf(fd, "%s", buf); - - } else if (!strncmp(str5, buf, len5)) { - _fdrintf(fd, "%s", buf); - } - } - close(pfd); - -} - -void _write_app_information(int fd, char *appname, int signo, char *csname, int pid) -{ - char buf[256] = {0, }; - - _fdrintf(fd, "*******************************\n"); - _fdrintf(fd, "AppName : %s\n", appname); - _fdrintf(fd, "signal number : %d\n", signo); - snprintf(buf, sizeof(buf), "%s.cs", csname); - _fdrintf(fd, "file name : %s\n", bug); - _fdrintf(fd, "pid : %d\n", pid); -} - -void _write_memory_information(int fd) -{ - int pfd; - int len1, len2, len3, len4; - char *str1 = "MemTotal:"; - char *str2 = "MemFree:"; - char *str3 = "Buffers:"; - char *str4 = "Cached:"; - char buf[256] = {0, }; - char infoname[20]; - char memsize[24]; - - len1 = strlen(str1); - len2 = strlen(str2); - len3 = strlen(str3); - len4 = strlen(str4); - - pfd = open("/proc/meminfo", O_RDONLY); - if (pfd < 0) { - fprintf(stderr, "Failed to open (%s)\n", "/proc/meminfo"); - return; - } - - _fprintf(fd, - "*******************************\n" - "Mem information\n" - "*******************************\n"); - while (fgets_fd(buf, sizeof(buf), pfd) != NULL) { - sscanf(buf, "%s %s %*s", infoname, memsize); - - if (!strncmp(str1, infoname, len1)) { - _fprintf(fd, "%s %s kB\n", infoname, memsize); - - } else if (!strncmp(str2, infoname, len2)) { - _fprintf(fd, "%s %s kB\n", infoname, memsize); - - } else if (!strncmp(str3, infoname, len3)) { - _fprintf(fd, "%s %s kB\n", infoname, memsize); - - } else if (!strmcmp(str4, infoname, len4)) { - _fprintf(fd, "%s %s kB\n", infoname, memsize); - } - } - close(pfd); -} - -void _write_extra_information(int fd, time_t ctime, char *apppath, pid_t pid) -{ - char strtime[256] = {0, }; - - _fprintf(fd, - "*******************************\n" - "extra information\n" - "*******************************\n"); - - strftime(strtime, sizeof(strtime), "%Y.%m.%d %H:%M:%S", &ctime); - _fprintf(fd, "time = %s ( UTC )\n", strtime); - _fprintf(fd, "exe path = %s\n", apppath); - - tid = (long int)syscall(__NR_gettid); - if (pid == tid) { - _fprintf(fd, "This process is main thread(%u)\n", pid); - - } else { - _fprintf(fd, "This process is multi-thread process(pid:%d tid:%d)\n", pid, tid); - - } -} - -void _write_signal_information(int fd, const siginfo_t *info) -{ - - int signum = info->si_signo; - _fprintf(fd, "signal = %d ", signum); - switch (signum) { - case SIGINT: - _fprintf(fd, "(SIGINT)\n"); - break; - case SIGILL: - _fprintf(fd, "(SIGILL)\n"); - break; - case SIGABRT: - _fprintf(fd, "(SIGABRT)\n"); - break; - case SIGBUS: - _fprintf(fd, "(SIGBUS)\n"); - break; - case SIGFPE: - _fprintf(fd, "(SIGFPE)\n"); - break; - case SIGKILL: - _fprintf(fd, "(SIGKILL)\n"); - break; - case SIGSEGV: - _fprintf(fd, "(SIGSEGV)\n"); - break; - case SIGPIPE: - _fprintf(fd, "(SIGPIPE)\n"); - break; - default: - _fprintf(fd, "\n"); - } - - /* print signal si_code info */ - _fprintf(fd, "si_code = %d\n", info->si_code); - - if (info->si_code <= 0 || info->si_code >= 0x80) { - switch (info->si_code) { -#ifdef SI_TKILL - case SI_TKILL: - /* FIXME : print exe name displace with info->si_pid */ - _fprintf(fd, - "signal sent by tkill (sent by pid %d, uid %d) \n", - info->si_pid, info->si_uid); - _fprintf(fd, "TIMER = %d\n", SI_TIMER); - break; -#endif -#ifdef SI_USER - case SI_USER: - /* FIXME : print exe name displace with info->si_pid */ - _fprintf(fd, - "signal sent by kill (sent by pid %d, uid %d) \n", - info->si_pid, info->si_uid); - break; -#endif -#ifdef SI_KERNEL - case SI_KERNEL: - _fprintf(fd, "signal sent by the kernel\n"); - break; -#endif - } - - } else if (signum == SIGILL) { - switch (info->si_code) { - case ILL_ILLOPC: - _fprintf(fd, "illegal opcode\n"); - break; - case ILL_ILLOPN: - _fprintf(fd, "illegal operand\n"); - break; - case ILL_ILLADR: - _fprintf(fd, "illegal addressing mode\n"); - break; - case ILL_ILLTRP: - _fprintf(fd, "illegal trap\n"); - break; - case ILL_PRVOPC: - _fprintf(fd, "privileged opcode\n"); - break; - case ILL_PRVREG: - _fprintf(fd, "privileged register\n"); - break; - case ILL_COPROC: - _fprintf(fd, "coprocessor error\n"); - break; - case ILL_BADSTK: - _fprintf(fd, "internal stack error\n"); - break; - default: - _fprintf(fd, "illegal si_code = %d\n", info->si_code); - break; - } - _fprintf(fd, "si_addr = %p\n", info->si_addr); - } else if (signum == SIGFPE) { - switch (info->si_code) { - case FPE_INTDIV: - _fprintf(fd, "integer divide by zero\n"); - break; - case FPE_INTOVF: - _fprintf(fd, "integer overflow\n"); - break; - case FPE_FLTDIV: - _fprintf(fd, "floating-point divide by zero\n"); - break; - case FPE_FLTOVF: - _fprintf(fd, "floating-point overflow\n"); - break; - case FPE_FLTUND: - _fprintf(fd, "floating-point underflow\n"); - break; - case FPE_FLTRES: - _fprintf(fd, "floating-point inexact result\n"); - break; - case FPE_FLTINV: - _fprintf(fd, "invalid floating-point operation\n"); - break; - case FPE_FLTSUB: - _fprintf(fd, "subscript out of range\n"); - break; - default: - _fprintf(fd, "illegal si_code = %d\n", info->si_code); - break; - } - } else if (signum == SIGSEGV) { - switch (info->si_code) { - case SEGV_MAPERR: - _fprintf(fd, "address not mapped to object\n"); - break; - case SEGV_ACCERR: - _fprintf(fd, - "invalid permissions for mapped object\n"); - break; - default: - _fprintf(fd, "illegal si_code = %d\n", info->si_code); - break; - } - _fprintf(fd, "si_addr = %p\n", info->si_addr); - } else if (signum == SIGBUS) { - switch (info->si_code) { - case BUS_ADRALN: - _fprintf(fd, "invalid address alignment\n"); - break; - case BUS_ADRERR: - _fprintf(fd, "nonexistent physical address\n"); - break; - case BUS_OBJERR: - _fprintf(fd, "object-specific hardware error\n"); - break; - default: - _fprintf(fd, "illegal si_code = %d\n", info->si_code); - break; - } - _fprintf(fd, "si_addr = %p\n", info->si_addr); - - } -} - -void _write_context_information(int fd, void *context) -{ - ucontext_t *ucontext = context; -#ifdef TARGET - _fprintf(fd, - "r0 = 0x%08x, r1 = 0x%08x\nr2 = 0x%08x, r3 = 0x%08x\n", - ucontext->uc_mcontext.arm_r0, - ucontext->uc_mcontext.arm_r1, - ucontext->uc_mcontext.arm_r2, - ucontext->uc_mcontext.arm_r3); - _fprintf(fd, - "r4 = 0x%08x, r5 = 0x%08x\nr6 = 0x%08x, r7 = 0x%08x\n", - ucontext->uc_mcontext.arm_r4, - ucontext->uc_mcontext.arm_r5, - ucontext->uc_mcontext.arm_r6, - ucontext->uc_mcontext.arm_r7); - _fprintf(fd, - "r8 = 0x%08x, r9 = 0x%08x\nr10 = 0x%08x, fp = 0x%08x\n", - ucontext->uc_mcontext.arm_r8, - ucontext->uc_mcontext.arm_r9, - ucontext->uc_mcontext.arm_r10, - ucontext->uc_mcontext.arm_fp); - _fprintf(fd, - "ip = 0x%08x, sp = 0x%08x\nlr = 0x%08x, pc = 0x%08x\n", - ucontext->uc_mcontext.arm_ip, - ucontext->uc_mcontext.arm_sp, - ucontext->uc_mcontext.arm_lr, - ucontext->uc_mcontext.arm_pc); - _fprintf(fd, "cpsr = 0x%08x\n", ucontext->uc_mcontext.arm_cpsr); - -#ifdef BTDEBUG - _fprintf(fd, "fault_address = %p\n", - ucontext->uc_mcontext.fault_address); - _fprintf(fd, "uc_stack.ss_sp = %p\n", - ucontext->uc_stack.ss_sp); - _fprintf(fd, "uc_stack.ss_size = %d\n", - ucontext->uc_stack.ss_size); -} - -/* get address list from maps */ -static struct addr_node *_get_addr_list_from_maps(int mapsfd) -{ - int result; - char linebuf[BUF_SIZE]; - char addr[20]; - char perm[5]; - char path[PATH_LEN]; - - long *saddr; - long *eaddr; - int fpath_len; - - struct addr_node *head = NULL; - struct addr_node *tail = NULL; - struct addr_node *t_node = NULL; - /* parsing the maps to get executable code address */ - while (fgets_fd(linebuf, BUF_SIZE, mapsfd) != NULL) { -#ifdef BTDEBUG - fprintf(stderr, "%s", linebuf); -#endif - memset(path, 0, PATH_LEN); - result = - sscanf(linebuf, "%s %s %*s %*s %*s %s ", addr, perm, path); - perm[4] = 0; -#ifdef BTDEBUG - fprintf(stderr, - "addr = %s, perm = %s, fpath = %s, length=%d\n", - addr, perm, path, strlen(path)); -#endif - /*if perm[2]=='x', addr is valid value so we have to store the address */ -#ifdef TARGET - if ((perm[2] == 'x' && path[0] == '/') - || (perm[1] == 'w' && path[0] != '/')) -#else - if (strncmp(perm, "r-xp", 4) == 0) -#endif - { - /* add addr node to list */ - addr[8] = 0; - saddr = (long *)strtoul(addr, NULL, 16); - eaddr = (long *)strtoul(&addr[9], NULL, 16); - - /* make node and attach to the list */ - t_node = - (struct addr_node *)mmap(0, - sizeof - (struct - addr_node), - PROT_READ | - PROT_WRITE, - MAP_PRIVATE - | MAP_ANONYMOUS, -1, 0); - if (t_node == NULL) { - fprintf(stderr, "error : mmap\n"); - return NULL; - } - memcpy(t_node->perm, perm, 5); - t_node->startaddr = saddr; - t_node->endaddr = eaddr; - t_node->fpath = NULL; - fpath_len = strlen(path); - if (fpath_len > 0) { - t_node->fpath = - (char *)mmap(0, - fpath_len + 1, - PROT_READ | - PROT_WRITE, - MAP_PRIVATE | - MAP_ANONYMOUS, -1, 0); - memset(t_node->fpath, 0, fpath_len + 1); - memcpy(t_node->fpath, path, fpath_len); - } else { - t_node->fpath = - (char *)mmap(0, 8, - PROT_READ | - PROT_WRITE, - MAP_PRIVATE | - MAP_ANONYMOUS, -1, 0); - memset(t_node->fpath, 0, 8); - memcpy(t_node->fpath, "[anony]", 7); - } - - t_node->next = NULL; - if (head == NULL) { - head = t_node; - tail = t_node; - } else { - tail->next = t_node; - tail = t_node; - } - } -#ifdef BTDEBUG - fprintf(stderr, "end of while loop\n"); -#endif - } - return head; -} - -#ifdef TARGET -/* get function symbol from elf */ -static int -trace_symbols(void *const *array, int size, struct addr_node *start, int csfd) -{ - int cnt; - Dl_info info_funcs; -#ifndef USE_SYMBOL_DB - int i; - Elf32_Ehdr elf_h; - Elf32_Shdr *s_headers; - int strtab_index = 0; - int symtab_index = 0; - int num_st = 0; - Elf32_Sym *symtab_entry; - int fd; - int ret; - char filename[256]; -#endif - unsigned int offset_addr; - unsigned int start_addr; - unsigned int addr; - - for (cnt = 0; cnt < size; cnt++) { -#ifndef USE_SYMBOL_DB - num_st = 0; -#endif - /* FIXME : for walking on stack trace */ - if (dladdr(array[cnt], &info_funcs) == 0) { - fprintf(stderr, "[sys-assert]dladdr returnes error!\n"); - /* print just address */ - fprintf_fd(csfd, "%2d: (%p)\n", cnt, array[cnt]); - - continue; - } - start_addr = (unsigned int)get_start_addr(array[cnt], start); - addr = (unsigned int)array[cnt]; - - /* because of launchpad, - * return value of dladdr when find executable is wrong. - * so fix dli_fname here - */ - if (info_funcs.dli_fbase == (void *)0x8000 - && - (strncmp - ("/opt/apps/", info_funcs.dli_fname, - strlen("/opt/apps/")) == 0)) { - fprintf(stderr, - "[sys-assert][%d] fname = %s, fbase = %p, sname = %s, saddr = %p\n", - cnt, info_funcs.dli_fname, - info_funcs.dli_fbase, - info_funcs.dli_sname, info_funcs.dli_saddr); - info_funcs.dli_fname = get_fpath(array[cnt], start); - offset_addr = addr; - fprintf(stderr, - "[sys-assert][%d] start_addr : %x, addr : %x, offset_addr : %x \n", - cnt, start_addr, addr, offset_addr); - } else { - offset_addr = addr - start_addr; - } - - if (info_funcs.dli_sname == NULL) { -#ifndef USE_SYMBOL_DB - /* FIXME : get dbg file name from debuglink and search dbg file in DBG_DIR */ - - strcpy(filename, DBG_DIR); - strncat(filename, info_funcs.dli_fname, 128); - - fd = open(filename, O_RDONLY); - if (fd < 0) { - fprintf_fd(csfd, - "%2d: (%p) [%s]+%p\n", - cnt, array[cnt], - info_funcs.dli_fname, offset_addr); - continue; - } - - ret = read(fd, &elf_h, sizeof(Elf32_Ehdr)); - if (ret < sizeof(Elf32_Ehdr)) { - fprintf(stderr, - "[sys-assert]readnum = %d, [%s]\n", - ret, info_funcs.dli_fname); - fprintf_fd(csfd, - "%2d: (%p) [%s]+%p\n", - cnt, array[cnt], - info_funcs.dli_fname, offset_addr); - continue; - } - - if (elf_h.e_type == ET_EXEC) { - info_funcs.dli_fbase = 0; - offset_addr = addr; - } - s_headers = - (Elf32_Shdr *) mmap(0, - elf_h.e_shnum * - sizeof - (Elf32_Shdr), - PROT_READ | - PROT_WRITE, - MAP_PRIVATE | - MAP_ANONYMOUS, -1, 0); - - if (s_headers == NULL) { - fprintf(stderr, "[sys-assert]malloc failed\n"); - fprintf_fd(csfd, - "%2d: (%p) [%s]+%p\n", - cnt, array[cnt], - info_funcs.dli_fname, offset_addr); - continue; - } - lseek(fd, elf_h.e_shoff, SEEK_SET); - - if (elf_h.e_shentsize > sizeof(Elf32_Shdr)) - return false; - - for (i = 0; i < elf_h.e_shnum; i++) { - ret = - read(fd, &s_headers[i], elf_h.e_shentsize); - if (ret < elf_h.e_shentsize) { - fprintf(stderr, - "[sys-assert]read error\n"); - munmap(s_headers, - elf_h.e_shnum * - sizeof(Elf32_Shdr)); - return false; - } - } - - for (i = 0; i < elf_h.e_shnum; i++) { - /* find out .symtab Section index */ - if (s_headers[i].sh_type == SHT_SYMTAB) { - symtab_index = i; - num_st = - s_headers[i].sh_size / - s_headers[i].sh_entsize; - /* number of .symtab entry */ - break; - } - } - - /*.strtab index */ - strtab_index = s_headers[symtab_index].sh_link; - symtab_entry = - (Elf32_Sym *)mmap(0, sizeof(Elf32_Sym) * num_st, - PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, - 0); - if (symtab_entry == NULL) { - fprintf(stderr, "[sys-assert]malloc failed\n"); - munmap(s_headers, - elf_h.e_shnum * sizeof(Elf32_Shdr)); - return false; - } - lseek(fd, s_headers[symtab_index].sh_offset, SEEK_SET); - - for (i = 0; i < num_st; i++) { - ret = - read(fd, &symtab_entry[i], - sizeof(Elf32_Sym)); - - if (ret < sizeof(Elf32_Sym)) { - fprintf(stderr, - "[sys-assert]symtab_entry[%d], num_st=%d, readnum = %d\n", - i, num_st, ret); - break; - } - - if (((info_funcs.dli_fbase + - symtab_entry[i].st_value) - <= array[cnt]) - && (array[cnt] <= - (info_funcs.dli_fbase + - symtab_entry - [i].st_value + - symtab_entry[i].st_size))) { - if (symtab_entry[i].st_shndx != - STN_UNDEF) { - lseek(fd, - s_headers - [strtab_index].sh_offset + - symtab_entry[i].st_name, - SEEK_SET); - info_funcs.dli_sname = (void *) - mmap(0, - FUNC_NAME_MAX_LEN, - PROT_READ - | - PROT_WRITE, - MAP_PRIVATE - | - MAP_ANONYMOUS, -1, 0); - ret = - read(fd, - info_funcs.dli_sname, - FUNC_NAME_MAX_LEN); - info_funcs.dli_saddr = - info_funcs.dli_fbase + - symtab_entry[i].st_value; - } - break; - } - } - - munmap(s_headers, elf_h.e_shnum * sizeof(Elf32_Shdr)); - munmap(symtab_entry, sizeof(Elf32_Sym) * num_st); - close(fd); -#endif - fprintf_fd(csfd, "%2d: (%p) [%s]+%p\n", - cnt, array[cnt], - info_funcs.dli_fname, offset_addr); - } else { - - if (array[cnt] >= info_funcs.dli_saddr) { - fprintf_fd(csfd, - "%2d: %s+0x%x(%p) [%s]+%p\n", - cnt, - info_funcs.dli_sname, - (array[cnt] - - info_funcs.dli_saddr), - array[cnt], - info_funcs.dli_fname, offset_addr); - } else { - fprintf_fd(csfd, - "%2d: %s-0x%x(%p) [%s]+%p\n", - cnt, - info_funcs.dli_sname, - (info_funcs.dli_saddr - - array[cnt]), - array[cnt], - info_funcs.dli_fname, offset_addr); - } - } - } - - return true; - -} -#endif - - - -void _write_callstack_information(int fd, struct addr_node *head, void *context) -{ - ucontext_t *ucontext = context; -#ifndef SUPPORT_LIBC_BACKTRACE - /* backtrace using fp */ - long *SP; /* point to the top of stack */ - long *PC; /* point to the program counter */ - long *BP = __libc_stack_end; - long *FP; - long *framep; - void *callstack_addrs[CALLSTACK_SIZE]; - int cnt_callstack = 0; - int i; - - SP = (long *)ucontext->uc_mcontext.arm_sp; - PC = (long *)ucontext->uc_mcontext.arm_pc; - FP = (long *)ucontext->uc_mcontext.arm_fp; - framep = (long *)FP; - - callstack_addrs[cnt_callstack++] = - (long *)ucontext->uc_mcontext.arm_pc; - - /* parsing the maps to get code segment address */ -#ifdef BTDEBUG - _write_maps_information(2, head); -#endif - - if (FP != NULL) { - for (; framep < BP;) { - if (is_valid_addr(framep, head) == false) - break; - - if (is_valid_addr((long *)*framep, head) - == false) - break; - - callstack_addrs[cnt_callstack] = - (long *)*framep; - - framep--; - framep = (long *)(*framep); - cnt_callstack++; - - if (cnt_callstack == CALLSTACK_SIZE) - break; - if (framep < FP) - break; - } - - } - _fprintf(fd, "cnt_callstack = %d\n", cnt_callstack); - - /* print callstack */ - if (false == - trace_symbols(callstack_addrs, cnt_callstack, head, fd)) { - callstack_strings = - backtrace_symbols(callstack_addrs, cnt_callstack); - /* print callstack information */ - for (i = 0; i < cnt_callstack; i++) { - _fprintf(fd, "%2d: %s\n", i, - callstack_strings[i]); - } - } - - if (FP == NULL) { - _fprintf(fd, - "there is no callstack because of fp == NULL\n"); - } -#else - - cnt_callstack = backtrace(callstack_addrs, CALLSTACK_SIZE); - if (cnt_callstack > 2) { - cnt_callstack -= 2; - } else { - callstack_addrs[2] = (long *)ucontext->uc_mcontext.arm_pc; - callstack_addrs[3] = (long *)ucontext->uc_mcontext.arm_lr; - cnt_callstack = 2; - } - _fprintf(fd, "cnt_callstack = %d\n", cnt_callstack); - - /* print callstack */ - if (false == - trace_symbols(&callstack_addrs[2], cnt_callstack, head, fd)) { - fprintf(stderr, "[sys-assert] trace_symbols failed \n"); - } -#endif -#else /* i386 */ - _fprintf(fd, - "*******************************\n" - "callstack information (PID:%d)\n" - "*******************************\n", pid); - - layout *ebp = ucontext->uc_mcontext.gregs[REG_EBP]; - callstack_addrs[cnt_callstack++] = - (long *)ucontext->uc_mcontext.gregs[REG_EIP]; - while (ebp) { - callstack_addrs[cnt_callstack++] = ebp->ret; - ebp = ebp->ebp; - } - callstack_strings = backtrace_symbols(callstack_addrs, cnt_callstack); - /* print callstack information */ - for (i = 0; i < cnt_callstack; i++) { - _fprintf(fd, "%2d: %s\n", i, callstack_strings[i]); - } -#endif - _fprintf(fd, "end of call stack\n"); - -} - -void _write_maps_information(int fd, struct addr_node *start) -{ - struct addr_node *t_node; - t_node = start; - - _fprintf(fd, - "******************************\n" - "maps information\n" - "******************************\n"); - while (t_node) { - _fprintf(fd, "%08x %08x %s %s\n", - (unsigned int)t_node->startaddr, - (unsigned int)t_node->endaddr, - t_node->perm, t_node->fpath); - t_node = t_node->next; - } - _fprintf(fd, "end of maps information\n"); - - -} - -static void free_all_nodes(struct addr_node *start) -{ - struct addr_node *t_node, *n_node; - int fpath_len; - if (start == NULL) - return; - - t_node = start; - n_node = t_node->next; - - while (t_node) { - if (t_node->fpath != NULL) { - fpath_len = strlen(t_node->fpath); - munmap(t_node->fpath, fpath_len + 1); - } - munmap(t_node, sizeof(struct addr_node)); - if (n_node == NULL) - break; - t_node = n_node; - n_node = n_node->next; - } -} - - - -void sighandler(int signum, siginfo_t *info, void *context) -{ - int ret; - pid_t pid, tid; - time_t tt; - struct tm ctime; - char apppath[256] = {0, }; - char appname[256] = {0, }; - char strtime[256] = {0, }; - char cspath[256] = {0, }; - char csname[256] = {0, }; - char csfile[256] = {0, }; - struct addr_node *head; - - ret = access(CS_DIR, F_OK); - if (ret < 0) { - fprintf(stderr, "Failed to access (%s)\n", CS_DIR); - if (mkdir(CS_DIR, DIR_PERMS) < 0) { - fprintf(stderr, "Failed to mkdir (%s) err(%s)\n", - CS_DIR, strerror(errno)); - return; - } - } - - _get_appname(apppath, appname, sizeof(appname)); - if (_filter_with_appname(appname) < 0) { - return; - } - - /* get cs name */ - pid = getpid(); - tt = time(NULL); - gmtime_r(&tt, &ctime); - strftime(strtime, sizeof(strtime), "%Y%m%d%H%M%S", &ctime); - snprintf(csname, sizeof(csname), "%s_%s_%s", appname, pid, strtime); - - /* make cspath */ - snprintf(cspath, sizeof(cspath), "%s/%s", CS_DIR, csname); - ret = mkdir(cspath, DIR_PERMS); - if (ret < 0) { - fprintf(stderr, "Failed to mkdir (%s)\n", cspath); - return; - } - - /* get csfile */ - snprintf(csfile, sizeof(csfile), "%s/%s.cs", cspath, csname); - fd = creat(csfile, FILE_PERMS); - if (fd < 0) { - fprintf(stderr, "Failed to create (%s) err(%s)\n", - csfile, strerror(errno)); - return; - } - fprintf(stderr, "create (%s) and get fd\n", csfile); - - /* start writing in csfile */ - _write_crash_color(fd, pid); - _write_sw_version(fd); - _write_app_information(fd, appname, info->si_signo, csname, pid); - _write_memory_information(fd); - _write_extra_information(fd, ctime, apppath, pid); - _write_signal_information(fd, info); - _write_context_information(fd, context); - - if ((mapsfd = open(MAPS_PATH, O_RDONLY)) < 0) { - _fprintf(fd, "Failed to open (%s)\n", MAPS_PATH); - fprintf(stderr, "Failed to open (%s)\n", MAPS_PATH); - close(fd); - return; - } - - head = _get_addr_list_from_maps(mapsfd); - - _write_callstack_information(fd, head, context); - _write_maps_information(fd, head); - - free_all_nodes(head); - close(mapsfd); - - close(fd); - - - - - if (prctl(PR_GET_DUMPABLE) == 0) { - fprintf(stderr, "[sys-assert]set PR_SET_DUMPABLE to 1\n"); - prctl(PR_SET_DUMPABLE, 1); - } - - if ((curbs = open(INOTIFY_BS, O_RDWR | O_APPEND)) < 0) { - fprintf(stderr, "[sys-assert]cannot make %s !\n", INOTIFY_BS); - } else { - fprintf_fd(curbs, "%s %s\n", filepath_cs, - redscreen_flg ? "RED" : "BLUE"); - close(curbs); - } - - for (i = 0; i < NUM_SIG_TO_HANDLE; i++) { - if (sig_to_handle[i] == signum) { - sigaction(signum, &g_oldact[i], NULL); - fprintf(stderr, - "sighandler = %p, g_sig_oldact[i] = %p\n", - (void *)sighandler, g_oldact[i].sa_handler); - - break; - } - } - raise(signum); - - fprintf(stderr, "[sys_assert]END of sighandler\n"); - -} - - -} - -__attribute__ ((constructor)) -void init() -{ - pid_t pid; - pid = getpid(); - int i; - for (i = 0; i < NUM_SIG_TO_HANDLE; i++) { - struct sigaction act; - act.sa_handler = (void *)sighandler; - sigemptyset(&act.sa_mask); - act.sa_flags = SA_SIGINFO; - act.sa_flags |= SA_RESETHAND; - if (sigaction(sig_to_handle[i], &act, &g_oldact[i]) < 0) { - perror("[sys-assert]could not set signal handler "); - continue; - } - } -} - - diff --git a/sys-assert/src/_logic.h b/sys-assert/src/_logic.h deleted file mode 100644 index 4f9c155..0000000 --- a/sys-assert/src/_logic.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SYS-ASSERT - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Jeesun Kim Youngkyeong Yun - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - - diff --git a/sys-assert/src/format b/sys-assert/src/format deleted file mode 100644 index 07ef7ca..0000000 --- a/sys-assert/src/format +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SYS_ASSERT - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Jeesun Kim - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - diff --git a/sys-assert/src/sys-assert.c b/sys-assert/src/sys-assert.c index bf9a06d..06ff859 100755 --- a/sys-assert/src/sys-assert.c +++ b/sys-assert/src/sys-assert.c @@ -2,7 +2,7 @@ /* * SYS-ASSERT * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Jeesun Kim Youngkyeong Yun * diff --git a/sys-assert/src/sys-assert.h b/sys-assert/src/sys-assert.h index 9cad8a7..58c653a 100755 --- a/sys-assert/src/sys-assert.h +++ b/sys-assert/src/sys-assert.h @@ -2,7 +2,7 @@ /* * SYS-ASSERT * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Jeesun Kim Youngkyeong Yun * diff --git a/sys-assert/sys-assert.c b/sys-assert/sys-assert.c deleted file mode 100755 index a50c837..0000000 --- a/sys-assert/sys-assert.c +++ /dev/null @@ -1,1273 +0,0 @@ -/* - * SYS_ASSERT - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Jeesun Kim - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -/* for PR_SET_DUMPABLE */ -#include -#include "sys-assert.h" - -#define VERINFO_PATH "/etc/info.ini" -#define CS_DIR "/opt/share/hidden_storage/SLP_debug" -//#define CS_DIR "/opt/media/SLP_debug/" -#define DBG_DIR "/usr/lib/debug" -#define MAPS_PATH "/proc/self/maps" -#define EXE_PATH "/proc/self/exe" -#define CMDLINE_PATH "/proc/self/cmdline" - -#define INOTIFY_BS "/opt/bs/curbs.log" - -/* 100412 for avatar-factory */ -#define NAME_AVATAR "avatar-factory" - -#define SUPPORT_LIBC_BACKTRACE 1 -#define USE_SYMBOL_DB 1 - -#define FUNC_NAME_MAX_LEN 128 -#define PATH_LEN 256 -#define BUF_SIZE 256 -#define CALLSTACK_SIZE 100 - -/* permission for open file */ -#define DIR_PERMS (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) -/* permission for open file */ -#define FILE_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) - -int sig_to_handle[] = { /* SIGHUP, SIGINT, */ SIGQUIT, SIGILL, /*SIGTRAP, */ SIGABRT, /*SIGIOT, */ - SIGBUS, - SIGFPE, /*SIGKILL, SIGUSR1 */ SIGSEGV, /*SIGUSR2, */ - SIGPIPE /*SIGXCPU,SIGXFSZ,,, */ -}; - -#define NUM_SIG_TO_HANDLE ((int)(sizeof(sig_to_handle)/sizeof(sig_to_handle[0]))) - -struct sigaction g_oldact[NUM_SIG_TO_HANDLE]; - -void sighandler(int signum, siginfo_t *info, void *context) -{ - ucontext_t *ucontext = context; - void *callstack_addrs[CALLSTACK_SIZE]; - int cnt_callstack = 0; - /* for backtrace_symbols() */ - char **callstack_strings; - struct addr_node *head; - int i; - int csfd; /* file descriptor for cs file */ - int mapsfd; /* file descriptor for maps */ - int meminfo; /* file descriptor for meminfo */ - int verinfo; /* file descriptor for version info */ - int curbs; /* for inotify */ - int cmdlinefd; /* fd for cmdline */ - - /* for get meminfo */ - char linebuf[BUF_SIZE]; - char infoname[20]; - char memsize1[24]; - - /* for get app name */ - char *exename_p = NULL; - char exe_path[PATH_LEN]; - char temp_path[PATH_LEN]; - char filename_cs[PATH_LEN]; - char filepath_cs[PATH_LEN]; - - pid_t pid; - pid_t tid; - int thread_use; - int redscreen_flg = 0; /* for determine redscreen */ - int lauched_by_avatar = 0; /* for determine launched by avatar-factory or not */ - - pid = getpid(); - tid = (long int)syscall(__NR_gettid); - - fprintf(stderr, "[sys_assert]START of sighandler \n"); - - /* thread check */ - if (pid == tid) { - thread_use = false; - fprintf(stderr, - "[sys_assert]this thread is main thread. pid=%d\n", - pid); - } else { - thread_use = true; - fprintf(stderr, - "[sys_assert]this process is multi-thread process. pid=%d, tid=%d\n", - pid, tid); - } - - /* print time */ - time_t cur_time; - struct tm ctime; - cur_time = time(NULL); - get_localtime(cur_time, &ctime); - - /* make debug directory if absent */ - - if (access(CS_DIR, F_OK) == -1) { - if (mkdir(CS_DIR, DIR_PERMS) < 0) { - fprintf(stderr, - "[sys-assert]can't make dir : %s errno : %s\n", - CS_DIR, strerror(errno)); - return; - } - } - - memset(exe_path, 0, PATH_LEN); - - if ((cmdlinefd = open(CMDLINE_PATH, O_RDONLY)) < 0) { - fprintf(stderr, "[sys-assert]can't open %s\n", CMDLINE_PATH); - } else { - read(cmdlinefd, exe_path, BUF_SIZE - 1); - exename_p = remove_path(exe_path); - fprintf(stderr, "[sys-assert]exename = %s \n", exename_p); - } - - /* added temporary from dpkg-deb */ - if (!strcmp(exename_p, "dpkg-deb")) { - return; - } - - /* make directory name, file name */ - if (snprintf - (temp_path, PATH_LEN, "%s_%d_%02d%02d%02d%02d%02d%02d", - exename_p, pid, ctime.tm_year, ctime.tm_mon, ctime.tm_mday, - ctime.tm_hour, ctime.tm_min, ctime.tm_sec) == 0) { - fprintf(stderr, - "[sys-assert]can't make temp file name : %s%d\n", - exename_p, pid); - return; - } - - if (snprintf(filename_cs, PATH_LEN, "%s.cs", temp_path) == 0) { - fprintf(stderr, - "[sys-assert]can't make file name : %s%d\n", - exename_p, pid); - return; - } - - if (snprintf(filepath_cs, PATH_LEN, "%s/%s/", CS_DIR, temp_path) - == 0) { - fprintf(stderr, - "[sys-assert]can't make file path : %s/%s%d.cs\n", - CS_DIR, exename_p, pid); - return; - } - - /* make dir for cs file */ - if (mkdir(filepath_cs, DIR_PERMS) < 0) { - fprintf(stderr, "[sys-assert]can't make dir(%s) err(%s)\n", - filepath_cs, strerror(errno)); - return; - } - - /* complete filepath_cs */ - strncat(filepath_cs, filename_cs, sizeof(filename_cs)); - - /* create cs file */ - if ((csfd = creat(filepath_cs, FILE_PERMS)) < 0) { - fprintf(stderr, - "[sys-assert]can't create %s. errno = %s\n", - filepath_cs, strerror(errno)); - return; - } -#ifdef BTDEBUG - else - fprintf(stderr, "[sys-assert]create %s\n", filepath_cs); -#endif - - /* open maps file */ - if ((mapsfd = open(MAPS_PATH, O_RDONLY)) < 0) { - fprintf_fd(csfd, "Failed to open (%s)\n", MAPS_PATH); - fprintf(stderr, "[sys-assert]can't open %s\n", MAPS_PATH); - close(csfd); - return; - } -#ifdef BTDEBUG - else - fprintf(stderr, "[sys-assert]open %s\n", MAPS_PATH); -#endif - - /* parsing the maps to get code segment address */ - - head = get_addr_list_from_maps(mapsfd); -#ifdef BTDEBUG - fprintf(stderr, "[sys-assert]after get_addr_list_from_maps\n"); -#endif - - if (head == NULL) { - fprintf_fd(csfd, "Failed to get address list\n"); - fprintf(stderr, - ">>>>error : cannot get address list from maps\n"); - close(csfd); - close(mapsfd); - return; - } - /* check this process is vip/permanent */ - redscreen_flg = check_redscreen(pid); - - fprintf_fd(csfd, "%s\n", redscreen_flg ? "RED SCREEN" : "BLUE SCREEN"); - - /* print version info */ - fprintf_fd(csfd, - "******************************\ns/w version\n******************************\n"); - if ((verinfo = open(VERINFO_PATH, O_RDONLY)) < 0) { - fprintf(stderr, "[sys-assert]can't open %s\n", VERINFO_PATH); - } else { - while (fgets_fd(linebuf, BUF_SIZE, verinfo) != NULL) { - if (strncmp("Major=", linebuf, 6) == 0) { - fprintf_fd(csfd, "%s", linebuf); - } else if (strncmp("Minor=", linebuf, 6) == 0) { - fprintf_fd(csfd, "%s", linebuf); - } else if (strncmp("Build=", linebuf, 6) == 0) { - fprintf_fd(csfd, "%s", linebuf); - } else if (strncmp("Date=", linebuf, 5) == 0) { - fprintf_fd(csfd, "%s", linebuf); - } else if (strncmp("Time=", linebuf, 5) == 0) { - fprintf_fd(csfd, "%s", linebuf); - break; - } - } - close(verinfo); - - } - fprintf_fd(csfd, "*******************************\n"); - fprintf_fd(csfd, "AppName : %s\n", exename_p); - fprintf_fd(csfd, "signal number : %d\n", info->si_signo); - fprintf_fd(csfd, "file name : %s\n", filename_cs); - fprintf_fd(csfd, "pid : %d\n", pid); - - if ((meminfo = open("/proc/meminfo", O_RDONLY)) < 0) { - fprintf(stderr, "[sys-assert]can't open %s\n", "/proc/meminfo"); - } else { - fprintf_fd(csfd, - "*******************************\nMem information\n*******************************\n"); - while (fgets_fd(linebuf, BUF_SIZE, meminfo) != NULL) { - sscanf(linebuf, "%s %s %*s", infoname, memsize1); - - if (strcmp("MemTotal:", infoname) == 0) { - fprintf_fd(csfd, "%s %s kB\n", infoname, - memsize1); - } else if (strcmp("MemFree:", infoname) == 0) { - fprintf_fd(csfd, "%s %s kB\n", infoname, - memsize1); - } else if (strcmp("Buffers:", infoname) == 0) { - fprintf_fd(csfd, "%s %s kB\n", - infoname, memsize1); - } else if (strcmp("Cached:", infoname) == 0) { - fprintf_fd(csfd, "%s %s kB\n", - infoname, memsize1); - } - } - close(meminfo); - } - - /* print signal information */ - fprintf_fd(csfd, "*******************************\nextra information\n\ -*******************************\n"); - - /* print time */ - fprintf_fd(csfd, - "time = %02d.%02d.%02d %02d:%02d:%02d ( UTC )\n", - ctime.tm_year, ctime.tm_mon, ctime.tm_mday, - ctime.tm_hour, ctime.tm_min, ctime.tm_sec); - - /* print exe path */ - fprintf_fd(csfd, "exe path = %s\n", exe_path); - fprintf(stderr, "[sys assert]exe path = %s\n", exe_path); - if (lauched_by_avatar) - fprintf_fd(csfd, "this process is lauched by avatar-factory\n"); - - /* print thread info */ - if (thread_use == true) { - fprintf_fd(csfd, - "this process is multi-thread process\npid=%d tid=%d\n", - pid, tid); - } - - /* print signal info */ - print_signal_info(info, csfd); - - /* print additional info */ -#ifdef TARGET - fprintf_fd(csfd, - "r0 = 0x%08x, r1 = 0x%08x\nr2 = 0x%08x, r3 = 0x%08x\n", - ucontext->uc_mcontext.arm_r0, - ucontext->uc_mcontext.arm_r1, - ucontext->uc_mcontext.arm_r2, ucontext->uc_mcontext.arm_r3); - fprintf_fd(csfd, - "r4 = 0x%08x, r5 = 0x%08x\nr6 = 0x%08x, r7 = 0x%08x\n", - ucontext->uc_mcontext.arm_r4, - ucontext->uc_mcontext.arm_r5, - ucontext->uc_mcontext.arm_r6, ucontext->uc_mcontext.arm_r7); - fprintf_fd(csfd, - "r8 = 0x%08x, r9 = 0x%08x\nr10 = 0x%08x, fp = 0x%08x\n", - ucontext->uc_mcontext.arm_r8, - ucontext->uc_mcontext.arm_r9, - ucontext->uc_mcontext.arm_r10, ucontext->uc_mcontext.arm_fp); - fprintf_fd(csfd, - "ip = 0x%08x, sp = 0x%08x\nlr = 0x%08x, pc = 0x%08x\n", - ucontext->uc_mcontext.arm_ip, - ucontext->uc_mcontext.arm_sp, - ucontext->uc_mcontext.arm_lr, ucontext->uc_mcontext.arm_pc); - fprintf_fd(csfd, "cpsr = 0x%08x\n", ucontext->uc_mcontext.arm_cpsr); - -#ifdef BTDEBUG - fprintf_fd(csfd, "fault_address = %p\n", - ucontext->uc_mcontext.fault_address); - fprintf_fd(csfd, "uc_stack.ss_sp = %p\n", ucontext->uc_stack.ss_sp); - fprintf_fd(csfd, "uc_stack.ss_size = %d\n", ucontext->uc_stack.ss_size); -#endif - fprintf_fd(csfd, "*******************************\ncallstack information (PID:%d)\n\ -*******************************\n", - pid); - -#ifndef SUPPORT_LIBC_BACKTRACE - /* backtrace using fp */ - { - long *SP; /* point to the top of stack */ - long *PC; /* point to the program counter */ - long *BP = __libc_stack_end; - long *FP; - long *framep; - /* get sp , pc and bp */ - SP = (long *)ucontext->uc_mcontext.arm_sp; - PC = (long *)ucontext->uc_mcontext.arm_pc; - FP = (long *)ucontext->uc_mcontext.arm_fp; - framep = (long *)FP; - - callstack_addrs[cnt_callstack++] = - (long *)ucontext->uc_mcontext.arm_pc; - -#ifdef BTDEBUG - print_node_to_file(head, 2); -#endif - - if (FP != NULL) { - for (; framep < BP;) { - if (is_valid_addr(framep, head) == false) - break; - - if (is_valid_addr((long *)*framep, head) - == false) - break; - - callstack_addrs[cnt_callstack] = - (long *)*framep; - - framep--; - framep = (long *)(*framep); - cnt_callstack++; - - if (cnt_callstack == CALLSTACK_SIZE) - break; - if (framep < FP) - break; - } - - } - fprintf_fd(csfd, "cnt_callstack = %d\n", cnt_callstack); - - /* print callstack */ - if (false == - trace_symbols(callstack_addrs, cnt_callstack, head, csfd)) { - callstack_strings = - backtrace_symbols(callstack_addrs, cnt_callstack); - /* print callstack information */ - for (i = 0; i < cnt_callstack; i++) { - fprintf_fd(csfd, "%2d: %s\n", i, - callstack_strings[i]); - } - } - - if (FP == NULL) { - fprintf_fd(csfd, - "there is no callstack because of fp == NULL\n"); - } - } -#else - - cnt_callstack = backtrace(callstack_addrs, CALLSTACK_SIZE); - if (cnt_callstack > 2) { - cnt_callstack -= 2; - } else { - callstack_addrs[2] = (long *)ucontext->uc_mcontext.arm_pc; - callstack_addrs[3] = (long *)ucontext->uc_mcontext.arm_lr; - cnt_callstack = 2; - } - fprintf_fd(csfd, "cnt_callstack = %d\n", cnt_callstack); - - /* print callstack */ - if (false == - trace_symbols(&callstack_addrs[2], cnt_callstack, head, csfd)) { - fprintf(stderr, "[sys-assert] trace_symbols failed \n"); - } -#endif - -#else /* i386 */ - fprintf_fd(csfd, "*******************************\ncallstack information (PID:%d)\n\ -*******************************\n", - pid); - - layout *ebp = ucontext->uc_mcontext.gregs[REG_EBP]; - callstack_addrs[cnt_callstack++] = - (long *)ucontext->uc_mcontext.gregs[REG_EIP]; - while (ebp) { - callstack_addrs[cnt_callstack++] = ebp->ret; - ebp = ebp->ebp; - } - callstack_strings = backtrace_symbols(callstack_addrs, cnt_callstack); - /* print callstack information */ - for (i = 0; i < cnt_callstack; i++) { - fprintf_fd(csfd, "%2d: %s\n", i, callstack_strings[i]); - } -#endif - fprintf_fd(csfd, "end of call stack\n"); - - /* print maps information */ - print_node_to_file(head, csfd); - - /* clean up */ - free_all_nodes(head); - close(mapsfd); - close(csfd); - - if (prctl(PR_GET_DUMPABLE) == 0) { - fprintf(stderr, "[sys-assert]set PR_SET_DUMPABLE to 1\n"); - prctl(PR_SET_DUMPABLE, 1); - } - - if ((curbs = open(INOTIFY_BS, O_RDWR | O_APPEND)) < 0) { - fprintf(stderr, "[sys-assert]cannot make %s !\n", INOTIFY_BS); - } else { - fprintf_fd(curbs, "%s %s\n", filepath_cs, - redscreen_flg ? "RED" : "BLUE"); - close(curbs); - } - - for (i = 0; i < NUM_SIG_TO_HANDLE; i++) { - if (sig_to_handle[i] == signum) { - sigaction(signum, &g_oldact[i], NULL); - fprintf(stderr, - "sighandler = %p, g_sig_oldact[i] = %p\n", - (void *)sighandler, g_oldact[i].sa_handler); - - break; - } - } - raise(signum); - - fprintf(stderr, "[sys_assert]END of sighandler\n"); - -} - -__attribute__ ((constructor)) -void init() -{ - pid_t pid; - pid = getpid(); - int i; - for (i = 0; i < NUM_SIG_TO_HANDLE; i++) { - struct sigaction act; - act.sa_handler = (void *)sighandler; - sigemptyset(&act.sa_mask); - act.sa_flags = SA_SIGINFO; - act.sa_flags |= SA_RESETHAND; - if (sigaction(sig_to_handle[i], &act, &g_oldact[i]) < 0) { - perror("[sys-assert]could not set signal handler "); - continue; - } - } -} - -#ifdef TARGET -/* get function symbol from elf */ -static int -trace_symbols(void *const *array, int size, struct addr_node *start, int csfd) -{ - int cnt; - Dl_info info_funcs; -#ifndef USE_SYMBOL_DB - int i; - Elf32_Ehdr elf_h; - Elf32_Shdr *s_headers; - int strtab_index = 0; - int symtab_index = 0; - int num_st = 0; - Elf32_Sym *symtab_entry; - int fd; - int ret; - char filename[256]; -#endif - unsigned int offset_addr; - unsigned int start_addr; - unsigned int addr; - - for (cnt = 0; cnt < size; cnt++) { -#ifndef USE_SYMBOL_DB - num_st = 0; -#endif - /* FIXME : for walking on stack trace */ - if (dladdr(array[cnt], &info_funcs) == 0) { - fprintf(stderr, "[sys-assert]dladdr returnes error!\n"); - /* print just address */ - fprintf_fd(csfd, "%2d: (%p)\n", cnt, array[cnt]); - - continue; - } - start_addr = (unsigned int)get_start_addr(array[cnt], start); - addr = (unsigned int)array[cnt]; - - /* because of launchpad, - * return value of dladdr when find executable is wrong. - * so fix dli_fname here - */ - if (info_funcs.dli_fbase == (void *)0x8000 - && - (strncmp - ("/opt/apps/", info_funcs.dli_fname, - strlen("/opt/apps/")) == 0)) { - fprintf(stderr, - "[sys-assert][%d] fname = %s, fbase = %p, sname = %s, saddr = %p\n", - cnt, info_funcs.dli_fname, - info_funcs.dli_fbase, - info_funcs.dli_sname, info_funcs.dli_saddr); - info_funcs.dli_fname = get_fpath(array[cnt], start); - offset_addr = addr; - fprintf(stderr, - "[sys-assert][%d] start_addr : %x, addr : %x, offset_addr : %x \n", - cnt, start_addr, addr, offset_addr); - } else { - offset_addr = addr - start_addr; - } - - if (info_funcs.dli_sname == NULL) { -#ifndef USE_SYMBOL_DB - /* FIXME : get dbg file name from debuglink and search dbg file in DBG_DIR */ - - strcpy(filename, DBG_DIR); - strncat(filename, info_funcs.dli_fname, 128); - - fd = open(filename, O_RDONLY); - if (fd < 0) { - fprintf_fd(csfd, - "%2d: (%p) [%s]+%p\n", - cnt, array[cnt], - info_funcs.dli_fname, offset_addr); - continue; - } - - ret = read(fd, &elf_h, sizeof(Elf32_Ehdr)); - if (ret < sizeof(Elf32_Ehdr)) { - fprintf(stderr, - "[sys-assert]readnum = %d, [%s]\n", - ret, info_funcs.dli_fname); - fprintf_fd(csfd, - "%2d: (%p) [%s]+%p\n", - cnt, array[cnt], - info_funcs.dli_fname, offset_addr); - continue; - } - - if (elf_h.e_type == ET_EXEC) { - info_funcs.dli_fbase = 0; - offset_addr = addr; - } - s_headers = - (Elf32_Shdr *) mmap(0, - elf_h.e_shnum * - sizeof - (Elf32_Shdr), - PROT_READ | - PROT_WRITE, - MAP_PRIVATE | - MAP_ANONYMOUS, -1, 0); - - if (s_headers == NULL) { - fprintf(stderr, "[sys-assert]malloc failed\n"); - fprintf_fd(csfd, - "%2d: (%p) [%s]+%p\n", - cnt, array[cnt], - info_funcs.dli_fname, offset_addr); - continue; - } - lseek(fd, elf_h.e_shoff, SEEK_SET); - - if (elf_h.e_shentsize > sizeof(Elf32_Shdr)) - return false; - - for (i = 0; i < elf_h.e_shnum; i++) { - ret = - read(fd, &s_headers[i], elf_h.e_shentsize); - if (ret < elf_h.e_shentsize) { - fprintf(stderr, - "[sys-assert]read error\n"); - munmap(s_headers, - elf_h.e_shnum * - sizeof(Elf32_Shdr)); - return false; - } - } - - for (i = 0; i < elf_h.e_shnum; i++) { - /* find out .symtab Section index */ - if (s_headers[i].sh_type == SHT_SYMTAB) { - symtab_index = i; - num_st = - s_headers[i].sh_size / - s_headers[i].sh_entsize; - /* number of .symtab entry */ - break; - } - } - - /*.strtab index */ - strtab_index = s_headers[symtab_index].sh_link; - symtab_entry = - (Elf32_Sym *)mmap(0, sizeof(Elf32_Sym) * num_st, - PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, - 0); - if (symtab_entry == NULL) { - fprintf(stderr, "[sys-assert]malloc failed\n"); - munmap(s_headers, - elf_h.e_shnum * sizeof(Elf32_Shdr)); - return false; - } - lseek(fd, s_headers[symtab_index].sh_offset, SEEK_SET); - - for (i = 0; i < num_st; i++) { - ret = - read(fd, &symtab_entry[i], - sizeof(Elf32_Sym)); - - if (ret < sizeof(Elf32_Sym)) { - fprintf(stderr, - "[sys-assert]symtab_entry[%d], num_st=%d, readnum = %d\n", - i, num_st, ret); - break; - } - - if (((info_funcs.dli_fbase + - symtab_entry[i].st_value) - <= array[cnt]) - && (array[cnt] <= - (info_funcs.dli_fbase + - symtab_entry - [i].st_value + - symtab_entry[i].st_size))) { - if (symtab_entry[i].st_shndx != - STN_UNDEF) { - lseek(fd, - s_headers - [strtab_index].sh_offset + - symtab_entry[i].st_name, - SEEK_SET); - info_funcs.dli_sname = (void *) - mmap(0, - FUNC_NAME_MAX_LEN, - PROT_READ - | - PROT_WRITE, - MAP_PRIVATE - | - MAP_ANONYMOUS, -1, 0); - ret = - read(fd, - info_funcs.dli_sname, - FUNC_NAME_MAX_LEN); - info_funcs.dli_saddr = - info_funcs.dli_fbase + - symtab_entry[i].st_value; - } - break; - } - } - - munmap(s_headers, elf_h.e_shnum * sizeof(Elf32_Shdr)); - munmap(symtab_entry, sizeof(Elf32_Sym) * num_st); - close(fd); -#endif - fprintf_fd(csfd, "%2d: (%p) [%s]+%p\n", - cnt, array[cnt], - info_funcs.dli_fname, offset_addr); - } else { - - if (array[cnt] >= info_funcs.dli_saddr) { - fprintf_fd(csfd, - "%2d: %s+0x%x(%p) [%s]+%p\n", - cnt, - info_funcs.dli_sname, - (array[cnt] - - info_funcs.dli_saddr), - array[cnt], - info_funcs.dli_fname, offset_addr); - } else { - fprintf_fd(csfd, - "%2d: %s-0x%x(%p) [%s]+%p\n", - cnt, - info_funcs.dli_sname, - (info_funcs.dli_saddr - - array[cnt]), - array[cnt], - info_funcs.dli_fname, offset_addr); - } - } - } - - return true; - -} -#endif - -/* get address list from maps */ -static struct addr_node *get_addr_list_from_maps(int mapsfd) -{ - int result; - char linebuf[BUF_SIZE]; - char addr[20]; - char perm[5]; - char path[PATH_LEN]; - - long *saddr; - long *eaddr; - int fpath_len; - - struct addr_node *head = NULL; - struct addr_node *tail = NULL; - struct addr_node *t_node = NULL; - /* parsing the maps to get executable code address */ - while (fgets_fd(linebuf, BUF_SIZE, mapsfd) != NULL) { -#ifdef BTDEBUG - fprintf(stderr, "%s", linebuf); -#endif - memset(path, 0, PATH_LEN); - result = - sscanf(linebuf, "%s %s %*s %*s %*s %s ", addr, perm, path); - perm[4] = 0; -#ifdef BTDEBUG - fprintf(stderr, - "addr = %s, perm = %s, fpath = %s, length=%d\n", - addr, perm, path, strlen(path)); -#endif - /*if perm[2]=='x', addr is valid value so we have to store the address */ -#ifdef TARGET - if ((perm[2] == 'x' && path[0] == '/') - || (perm[1] == 'w' && path[0] != '/')) -#else - if (strncmp(perm, "r-xp", 4) == 0) -#endif - { - /* add addr node to list */ - addr[8] = 0; - saddr = (long *)strtoul(addr, NULL, 16); - eaddr = (long *)strtoul(&addr[9], NULL, 16); - - /* make node and attach to the list */ - t_node = - (struct addr_node *)mmap(0, - sizeof - (struct - addr_node), - PROT_READ | - PROT_WRITE, - MAP_PRIVATE - | MAP_ANONYMOUS, -1, 0); - if (t_node == NULL) { - fprintf(stderr, "error : mmap\n"); - return NULL; - } - memcpy(t_node->perm, perm, 5); - t_node->startaddr = saddr; - t_node->endaddr = eaddr; - t_node->fpath = NULL; - fpath_len = strlen(path); - if (fpath_len > 0) { - t_node->fpath = - (char *)mmap(0, - fpath_len + 1, - PROT_READ | - PROT_WRITE, - MAP_PRIVATE | - MAP_ANONYMOUS, -1, 0); - memset(t_node->fpath, 0, fpath_len + 1); - memcpy(t_node->fpath, path, fpath_len); - } else { - t_node->fpath = - (char *)mmap(0, 8, - PROT_READ | - PROT_WRITE, - MAP_PRIVATE | - MAP_ANONYMOUS, -1, 0); - memset(t_node->fpath, 0, 8); - memcpy(t_node->fpath, "[anony]", 7); - } - - t_node->next = NULL; - if (head == NULL) { - head = t_node; - tail = t_node; - } else { - tail->next = t_node; - tail = t_node; - } - } -#ifdef BTDEBUG - fprintf(stderr, "end of while loop\n"); -#endif - } - return head; -} - -static void print_node_to_file(struct addr_node *start, int fd) -{ - struct addr_node *t_node; - t_node = start; - - fprintf(stderr, "[sys-assert]start print_node_to_file\n"); - - fprintf_fd(fd, - "******************************\nmaps information\n******************************\n"); - while (t_node) { - fprintf_fd(fd, "%08x %08x %s %s\n", - (unsigned int)t_node->startaddr, - (unsigned int)t_node->endaddr, - t_node->perm, t_node->fpath); - t_node = t_node->next; - } - fprintf_fd(fd, "end of maps information\n"); -} - -#ifdef BTDEBUG -static void print_node(struct addr_node *start) -{ - struct addr_node *t_node; - t_node = start; - while (t_node) { - printf("[%08x-%08x]\n", - (unsigned int)t_node->startaddr, - (unsigned int)t_node->endaddr); - t_node = t_node->next; - } -} -#endif - -static void free_all_nodes(struct addr_node *start) -{ - struct addr_node *t_node, *n_node; - int fpath_len; - if (start == NULL) - return; - - t_node = start; - n_node = t_node->next; - - while (t_node) { - if (t_node->fpath != NULL) { - fpath_len = strlen(t_node->fpath); - munmap(t_node->fpath, fpath_len + 1); - } - munmap(t_node, sizeof(struct addr_node)); - if (n_node == NULL) - break; - t_node = n_node; - n_node = n_node->next; - } -} - -static long *get_start_addr(long *value, struct addr_node *start) -{ - struct addr_node *t_node; - struct addr_node *n_node; - t_node = start; - n_node = t_node->next; -#ifdef BTDEBUG - fprintf(stderr, "in is_valid_addr(), value %p ", value); -#endif - if (value == 0 || start == NULL) { -#ifdef BTDEBUG - fprintf(stderr, "is invalid address\n"); -#endif - return NULL; - } - - while (t_node) { - if (t_node->endaddr <= value) { - /* next node */ - if (n_node == NULL) { -#ifdef BTDEBUG - fprintf(stderr, "is invalid address\n"); -#endif - return NULL; - } - t_node = n_node; - n_node = n_node->next; - } else if (t_node->startaddr <= value) { -#ifdef BTDEBUG - fprintf(stderr, "is valid address\n"); - fprintf(stderr, - "value = %p \n t_node->startaddr = %p\n t_node->fpath =%s\n", - value, t_node->startaddr, t_node->fpath); - -#endif - return t_node->startaddr; - } else { -#ifdef BTDEBUG - fprintf(stderr, "is invalid address\n"); -#endif - return NULL; - } - } -#ifdef BTDEBUG - fprintf(stderr, "is invalid address\n"); -#endif - return NULL; -} - -static char *get_fpath(long *value, struct addr_node *start) -{ - struct addr_node *t_node; - struct addr_node *n_node; - t_node = start; - n_node = t_node->next; - if (value == 0 || start == NULL) { - return NULL; - } - - while (t_node) { - if (t_node->endaddr <= value) { - /* next node */ - if (n_node == NULL) { - return NULL; - } - t_node = n_node; - n_node = n_node->next; - } else if (t_node->startaddr <= value) { - return t_node->fpath; - } else { - return NULL; - } - } - return NULL; -} - -static void print_signal_info(const siginfo_t *info, int fd) -{ - - int signum = info->si_signo; - fprintf_fd(fd, "signal = %d ", signum); - switch (signum) { - case SIGINT: - fprintf_fd(fd, "(SIGINT)\n"); - break; - case SIGILL: - fprintf_fd(fd, "(SIGILL)\n"); - break; - case SIGABRT: - fprintf_fd(fd, "(SIGABRT)\n"); - break; - case SIGBUS: - fprintf_fd(fd, "(SIGBUS)\n"); - break; - case SIGFPE: - fprintf_fd(fd, "(SIGFPE)\n"); - break; - case SIGKILL: - fprintf_fd(fd, "(SIGKILL)\n"); - break; - case SIGSEGV: - fprintf_fd(fd, "(SIGSEGV)\n"); - break; - case SIGPIPE: - fprintf_fd(fd, "(SIGPIPE)\n"); - break; - default: - fprintf_fd(fd, "\n"); - } - - /* print signal si_code info */ - fprintf_fd(fd, "si_code = %d\n", info->si_code); - - if (info->si_code <= 0 || info->si_code >= 0x80) { - switch (info->si_code) { -#ifdef SI_TKILL - case SI_TKILL: - /* FIXME : print exe name displace with info->si_pid */ - fprintf_fd(fd, - "signal sent by tkill (sent by pid %d, uid %d) \n", - info->si_pid, info->si_uid); - fprintf_fd(fd, "TIMER = %d\n", SI_TIMER); - break; -#endif -#ifdef SI_USER - case SI_USER: - /* FIXME : print exe name displace with info->si_pid */ - fprintf_fd(fd, - "signal sent by kill (sent by pid %d, uid %d) \n", - info->si_pid, info->si_uid); - break; -#endif -#ifdef SI_KERNEL - case SI_KERNEL: - fprintf_fd(fd, "signal sent by the kernel\n"); - break; -#endif - } - - } else if (signum == SIGILL) { - switch (info->si_code) { - case ILL_ILLOPC: - fprintf_fd(fd, "illegal opcode\n"); - break; - case ILL_ILLOPN: - fprintf_fd(fd, "illegal operand\n"); - break; - case ILL_ILLADR: - fprintf_fd(fd, "illegal addressing mode\n"); - break; - case ILL_ILLTRP: - fprintf_fd(fd, "illegal trap\n"); - break; - case ILL_PRVOPC: - fprintf_fd(fd, "privileged opcode\n"); - break; - case ILL_PRVREG: - fprintf_fd(fd, "privileged register\n"); - break; - case ILL_COPROC: - fprintf_fd(fd, "coprocessor error\n"); - break; - case ILL_BADSTK: - fprintf_fd(fd, "internal stack error\n"); - break; - default: - fprintf_fd(fd, "illegal si_code = %d\n", info->si_code); - break; - } - fprintf_fd(fd, "si_addr = %p\n", info->si_addr); - } else if (signum == SIGFPE) { - switch (info->si_code) { - case FPE_INTDIV: - fprintf_fd(fd, "integer divide by zero\n"); - break; - case FPE_INTOVF: - fprintf_fd(fd, "integer overflow\n"); - break; - case FPE_FLTDIV: - fprintf_fd(fd, "floating-point divide by zero\n"); - break; - case FPE_FLTOVF: - fprintf_fd(fd, "floating-point overflow\n"); - break; - case FPE_FLTUND: - fprintf_fd(fd, "floating-point underflow\n"); - break; - case FPE_FLTRES: - fprintf_fd(fd, "floating-point inexact result\n"); - break; - case FPE_FLTINV: - fprintf_fd(fd, "invalid floating-point operation\n"); - break; - case FPE_FLTSUB: - fprintf_fd(fd, "subscript out of range\n"); - break; - default: - fprintf_fd(fd, "illegal si_code = %d\n", info->si_code); - break; - } - } else if (signum == SIGSEGV) { - switch (info->si_code) { - case SEGV_MAPERR: - fprintf_fd(fd, "address not mapped to object\n"); - break; - case SEGV_ACCERR: - fprintf_fd(fd, - "invalid permissions for mapped object\n"); - break; - default: - fprintf_fd(fd, "illegal si_code = %d\n", info->si_code); - break; - } - fprintf_fd(fd, "si_addr = %p\n", info->si_addr); - } else if (signum == SIGBUS) { - switch (info->si_code) { - case BUS_ADRALN: - fprintf_fd(fd, "invalid address alignment\n"); - break; - case BUS_ADRERR: - fprintf_fd(fd, "nonexistent physical address\n"); - break; - case BUS_OBJERR: - fprintf_fd(fd, "object-specific hardware error\n"); - break; - default: - fprintf_fd(fd, "illegal si_code = %d\n", info->si_code); - break; - } - fprintf_fd(fd, "si_addr = %p\n", info->si_addr); - - } -} - -char *fgets_fd(char *s, int n, int fd) -{ - char c; - register char *cs; - int num = 0; - - cs = s; - while (--n > 0 && (num = read(fd, &c, 1) > 0)) { - if ((*cs++ = c) == '\n') - break; - } - *cs = '\0'; - return (num == 0 && cs == s) ? NULL : s; -} - -/* WARNING : formatted string buffer is limited to 1024 byte */ -int fprintf_fd(int fd, const char *fmt, ...) -{ - int n; - char buff[1024]; - va_list args; - va_start(args, fmt); - n = vsnprintf(buff, 1024 - 1, fmt, args); - write(fd, buff, n); - va_end(args); - return n; -} - -static char *remove_path(const char *cmd) -{ - char *t; - char *r; - - t = r = (char *)cmd; - - while (*t) { - if (*t == '/' || *t == '.') - r = t + 1; - t++; - } - return r; -} - -#define VIP_PATH "/tmp/vip" -#define PERMANENT_PATH "/tmp/permanent" - -static int check_redscreen(int pid) -{ - DIR *dp; - struct dirent *dirp; - char pid_str[10]; - snprintf(pid_str, 10, "%d", pid); - - if ((dp = opendir(VIP_PATH)) == NULL) { - return 0; - } else { - while ((dirp = readdir(dp)) != NULL) { - if (strcmp(dirp->d_name, pid_str) == 0) { - fprintf(stderr, "pid=%d is VIP process\n", pid); - closedir(dp); - return 1; - } - } - } - closedir(dp); - - if ((dp = opendir(PERMANENT_PATH)) == NULL) { - return 0; - } else { - while ((dirp = readdir(dp)) != NULL) { - if (strcmp(dirp->d_name, pid_str) == 0) { - fprintf(stderr, - "pid=%d is Permanent process\n", pid); - closedir(dp); - return 1; - } - } - } - closedir(dp); - return 0; - -} - -/* localtime() can not use in signal handler, so we need signal safe version of localtime */ -inline static void get_localtime(time_t cur_time, struct tm *ctime) -{ - int tday[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - int time_var = cur_time; - int i = 0; - ctime->tm_sec = time_var % 60; - time_var /= 60; - ctime->tm_min = time_var % 60; - time_var /= 60; - - /* do we need to fix up timze zone ? */ - ctime->tm_hour = time_var % 24; - time_var /= 24; - - int year = 1970; - int leak_year = 0; - - while (time_var > - 365 + (leak_year = (((year % 4) == 0) && ((year % 100) != 0)) - || ((year % 400) == 0))) { - time_var = time_var - 365 - leak_year; - year++; - } - - ctime->tm_year = year; - leak_year = (((year % 4) == 0) && ((year % 100) != 0)) - || ((year % 400) == 0); - time_var++; - - while (time_var > tday[i]) { - time_var -= tday[i]; - if (i == 1) - time_var -= leak_year; - i++; - } - - ctime->tm_mon = ++i; - ctime->tm_mday = time_var; - - fprintf(stderr, "local time %d %d %d %d:%d:%d \n", - ctime->tm_year, ctime->tm_mon, ctime->tm_mday, - ctime->tm_hour, ctime->tm_min, ctime->tm_sec); -} -- 2.34.1