Git init
authorKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 15:51:04 +0000 (00:51 +0900)
committerKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 15:51:04 +0000 (00:51 +0900)
29 files changed:
CMakeLists.txt [new file with mode: 0644]
INSTALL [new file with mode: 0644]
build.sh [new file with mode: 0755]
debian/README.Debian [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/libsys-assert-0.install.in [new file with mode: 0755]
debian/libsys-assert-0.postinst [new file with mode: 0644]
debian/org.tizen.blue-screen.install.in [new file with mode: 0755]
debian/rules [new file with mode: 0755]
lockupinfo/92-rb-dump.rules [new file with mode: 0644]
lockupinfo/CMakeLists.txt [new file with mode: 0644]
lockupinfo/_util_log.h [new file with mode: 0644]
lockupinfo/lockupinfo.c [new file with mode: 0644]
lockupinfo/lockupinfo.sh [new file with mode: 0755]
packaging/sys-assert.spec [new file with mode: 0644]
sys-assert/.debugmode [new file with mode: 0644]
sys-assert/CMakeLists.txt [new file with mode: 0644]
sys-assert/src/_logic.c [new file with mode: 0644]
sys-assert/src/_logic.h [new file with mode: 0644]
sys-assert/src/format [new file with mode: 0644]
sys-assert/src/sys-assert.c [new file with mode: 0755]
sys-assert/src/sys-assert.h [new file with mode: 0755]
sys-assert/sys-assert.c [new file with mode: 0755]
sys-assert/sys-assert.pc [new file with mode: 0755]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..eea27ec
--- /dev/null
@@ -0,0 +1,5 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+ADD_SUBDIRECTORY(sys-assert)
+ADD_SUBDIRECTORY(lockupinfo)
+
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..ddf4e78
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,33 @@
+1. make the build directory
+
+  ex) 
+
+   $ mkdir build
+
+
+2. change the working directory to the build directory
+
+  ex)
+
+   $ cd build
+
+
+3. run 'cmake'
+
+  $ cmake ${SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=/usr
+
+  ex)
+
+   $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
+
+   or
+
+   $ cmake ..
+
+
+4. make & make install
+
+  ex)
+
+   $ make -j 2 && make install
+
diff --git a/build.sh b/build.sh
new file mode 100755 (executable)
index 0000000..fb55e98
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,9 @@
+cd `dirname $0`
+if [ ! -d "./build" ]
+then 
+       mkdir build
+fi
+cd `dirname $0`/build
+cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
+make
+make install
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644 (file)
index 0000000..8c05128
--- /dev/null
@@ -0,0 +1,6 @@
+sys-assert for Debian
+---------------------
+
+<possible notes regarding this package - if none, delete this file>
+
+ -- unknown <yk.yun@samsung.com>  Wed, 06 Jan 2010 15:31:21 +0900
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..56fec67
--- /dev/null
@@ -0,0 +1,1258 @@
+sys-assert (0.3.0-2) unstable; urgency=low
+
+  * modified package name.
+  * Git: 165.213.180.114:pkgs/s/sys-assert
+  * Tag: sys-assert_0.3.0-2
+
+ -- Jeesun Kim <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <iamjs.kim@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <wonguk.jeong@samsung.com>  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 <sangjung.woo@samsung.com>  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 <wonguk.jeong@samsung.com>  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 <sangjung.woo@samsung.com>  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 <sangjung.woo@samsung.com>  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 <youmin.ha@samsung.com>  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 <youmin.ha@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Sat, 27 Mar 2010 16:20:31 +0900
+
+sys-assert (0.2.12-5) unstable; urgency=low
+
+  * toolchain upgrade
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Thu, 25 Mar 2010 16:54:59 +0900
+
+sys-assert (0.2.12-4) unstable; urgency=low
+
+  * EFL update
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Tue, 16 Mar 2010 11:49:44 +0900
+
+sys-assert (0.2.12-3) unstable; urgency=low
+
+  * fix lockupinfo.sh 
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Thu, 11 Mar 2010 09:54:24 +0900
+
+sys-assert (0.2.12-2) unstable; urgency=low
+
+  * add lockupinfo.sh
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Wed, 10 Mar 2010 18:25:06 +0900
+
+sys-assert (0.2.12-0) unstable; urgency=low
+
+  * change theme to use kessler
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Wed, 24 Feb 2010 15:32:17 +0900
+
+sys-assert (0.2.6-6) unstable; urgency=low
+
+  * purple screen is enabled 
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Wed, 10 Feb 2010 17:18:03 +0900
+
+sys-assert (0.2.6-3) unstable; urgency=low
+
+  * purple screen is enabled
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Tue, 09 Feb 2010 23:24:29 +0900
+
+sys-assert (0.2.6-2) unstable; urgency=low
+
+  * purple screen is temporary disabled 
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Mon, 08 Feb 2010 22:54:22 +0900
+
+sys-assert (0.2.6-0) unstable; urgency=low
+
+  * ADD FEATURE : Red/purple screen
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Mon, 08 Feb 2010 12:28:07 +0900
+
+sys-assert (0.2.5-0-1EFL+) unstable; urgency=low
+
+  * Reversion for -1EFL+
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Tue, 02 Feb 2010 17:02:00 +0900
+
+sys-assert (0.2.4-0) unstable; urgency=low
+
+  * change winset API
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Sat, 30 Jan 2010 13:55:14 +0900
+
+sys-assert (0.2.3-1) unstable; urgency=low
+
+  * change path 
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Wed, 27 Jan 2010 09:59:42 +0900
+
+sys-assert (0.2.2-1) unstable; urgency=low
+
+  * rebuild for EFL upgrade
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Thu, 21 Jan 2010 16:12:20 +0900
+
+sys-assert (0.2.1-1) unstable; urgency=low
+
+  * bug fix : support i686 build
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  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 <yk.yun@samsung.com>  Wed, 06 Jan 2010 19:43:40 +0900
+
+sys-assert (0.2.0-0) unstable; urgency=low
+
+  * add blue screen pkg
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Wed, 06 Jan 2010 19:19:42 +0900
+
+sys-assert (0.1.1-0) unstable; urgency=low
+
+  * Add information
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Tue, 05 Jan 2010 16:32:16 +0900
+
+sys-assert (0.1.0-0) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Youngkyeong Yun <yk.yun@samsung.com>  Mon, 29 Dec 2009 16:38:38 +0900
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..353a3ae
--- /dev/null
@@ -0,0 +1,19 @@
+Source: sys-assert
+Section: devel
+Priority: extra
+Maintainer: Youngjoo Park <yjoo93.park@samsung.com>, Youngkyeong Yun <yk.yun@samsung.com>
+Uploaders: Jeesun Kim <iamjs.kim@samsung.com> Youngkyeong Yun <yk.yun@samsung.com>
+Build-Depends: debhelper (>= 5), autotools-dev, libappcore-efl-dev, libheynoti-dev, libelm-dev, libslp-utilx-dev, libui-gadget-dev, libbundle-dev, libglib2.0-dev, libslp-setting-dev, libsqlite3-dev, libslp-pm-dev, dlog-dev, libslp-sysman-dev
+Standards-Version: 0.1.0
+
+Package: libsys-assert-0
+Section: libs
+Architecture: any
+Depends: 
+Description: libsys-assert (shared object)
+
+Package: sys-assert-0-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libsys-assert-0
+Description: libsys-assert dbg package
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..61147ee
--- /dev/null
@@ -0,0 +1,26 @@
+This is sys-assert, written and maintained by unknown <yk.yun@samsung.com>
+on Wed, 06 Jan 2010 15:31:21 +0900.
+
+The original source can always be found at:
+       ftp://ftp.debian.org/dists/unstable/main/source/
+
+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'.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..ca882bb
--- /dev/null
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/debian/libsys-assert-0.install.in b/debian/libsys-assert-0.install.in
new file mode 100755 (executable)
index 0000000..fba661e
--- /dev/null
@@ -0,0 +1,6 @@
+@PREFIX@/bin/lockupinfo
+@PREFIX@/bin/lockupinfo.sh
+
+@PREFIX@/lib/libsys-assert*.so*
+/etc/udev/rules.d/92-rb-dump.rules
+/opt/etc/.debugmode
diff --git a/debian/libsys-assert-0.postinst b/debian/libsys-assert-0.postinst
new file mode 100644 (file)
index 0000000..315f6e8
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+# if [ ${USER} == "root" ]
+# then
+   # Change file owner
+   # 1. libraries
+   # chown root:root /usr/lib/libsys-assert.so
+   # 2. executables
+   # 3. configurations
+   # 4. profile script
+   # chown root:root /etc/profile.d/setup_bs.sh
+
+#fi
+# Change file permissions
+# 1. libraries
+# chmod 644 /usr/lib/libsys-assert.so
+# 2. executables
+# 3. configurations
+# 4. booting script
+mkdir -p /opt/bs/core
+chown root:5000 /opt/bs/core
+chmod 775 /opt/bs/core
+
+mkdir -p /opt/share/hidden_storage/SLP_debug
+chown root:5000 /opt/share/hidden_storage/SLP_debug
+chmod 755 /opt/share/hidden_storage
+chmod 775 /opt/share/hidden_storage/SLP_debug
+
+touch /opt/etc/.debugmode
+
+# 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
diff --git a/debian/org.tizen.blue-screen.install.in b/debian/org.tizen.blue-screen.install.in
new file mode 100755 (executable)
index 0000000..c3f0668
--- /dev/null
@@ -0,0 +1,14 @@
+@PREFIX@/bin/blue-screen
+@PREFIX@/share/edje/*
+#@PREFIX@/share/edje/blue-screen.edj
+#@PREFIX@/share/edje/bs-viewer.edj
+@PREFIX@/bin/lockupinfo
+@PREFIX@/bin/lockupinfo.sh
+#@PREFIX@/bin/crashuploader
+/opt/share/applications/*
+#/opt/share/applications/org.tizen.bs-viewer.desktop
+/opt/apps/org.tizen.blue-screen/data
+/opt/apps/org.tizen.blue-screen/bin/bs-viewer
+/opt/apps/org.tizen.blue-screen/res/images/*
+/opt/apps/org.tizen.blue-screen/res/icons/default/small/org.tizen.blue-screen.png
+#/opt/bs/debuglevel/*
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..51650aa
--- /dev/null
@@ -0,0 +1,125 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?= -Wall -g
+CXXFLAGS ?=  -Wall -g
+LDFLAGS ?=
+PREFIX ?= /usr
+DATADIR ?= /opt
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+        BUILD_TYPE=Debug
+else
+        BUILD_TYPE=Release
+endif
+
+LDFLAGS += -Wl,--as-needed
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+       CXXFLAGS += -O0
+else
+       CFLAGS += -O2
+       CXXFLAGS += -O2
+endif
+
+#LDFLAGS +=
+
+CFLAGS += -fPIC
+
+CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+       mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
+       CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX="$(PREFIX)" -DCMAKE_BUILD_TYPE="$(BUILD_TYPE)"
+
+       touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp
+       dh_testdir
+
+       # Add here commands to compile the package.
+       cd $(CMAKE_BUILD_DIR) && $(MAKE)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               cat $$f > $${f%.in}; \
+               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
+       done
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       rm -rf $(CMAKE_BUILD_DIR)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               rm -f $${f%.in}; \
+       done
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+#      dh_installdirs
+
+       # Add here commands to install the package into debian/wavplayer.
+       cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs
+#      dh_installdocs
+       dh_installexamples
+       dh_install --sourcedir=debian/tmp
+#      dh_installmenu
+#      dh_installdebconf
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       dh_strip --dbg-package=sys-assert-0-dbg
+       dh_compress
+       dh_fixperms
+#      dh_perl
+       dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/lockupinfo/92-rb-dump.rules b/lockupinfo/92-rb-dump.rules
new file mode 100644 (file)
index 0000000..685496a
--- /dev/null
@@ -0,0 +1,3 @@
+
+#RB_DUMP
+ACTION=="change" DEVPATH=="/devices/platform/samsung_input_bridge", ENV{RB_DUMP}=="ON" RUN+="/usr/bin/lockupinfo.sh"
diff --git a/lockupinfo/CMakeLists.txt b/lockupinfo/CMakeLists.txt
new file mode 100644 (file)
index 0000000..33ab804
--- /dev/null
@@ -0,0 +1,46 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(lockupinfo C)
+
+SET(PROJECT_NAME "lockupinfo")
+SET(SRCS lockupinfo.c)
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs-common REQUIRED)
+
+FOREACH(flag ${pkgs-common_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fpie")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+       ADD_DEFINITIONS("-DTARGET")
+       MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DSLP_DEBUG")
+ADD_DEFINITIONS("-DEAPI")
+ADD_DEFINITIONS("-DDEBUG_ON")
+ADD_DEFINITIONS("-DLCD_TYPE_WVGA")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs-common_LDFLAGS})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lockupinfo.sh DESTINATION bin)
+
+#install in default files for lockup key combination
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/92-rb-dump.rules DESTINATION /etc/udev/rules.d)
diff --git a/lockupinfo/_util_log.h b/lockupinfo/_util_log.h
new file mode 100644 (file)
index 0000000..3cb7969
--- /dev/null
@@ -0,0 +1,67 @@
+
+/*
+ *  LOCKUPINFO
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeesun Kim <iamjs.kim@samsung.com>
+ * 
+ * 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.
+ *
+ */
+
+#ifndef __LOCKUPINFO_UTIL_LOG_H__
+#define __LOCKUPINFO_UTIL_LOG_H__
+
+#include <unistd.h>
+//#include <dlog.h>
+
+#undef LOG_TAG
+#define LOG_TAG "LOCKUPINFO"
+#define _E(fmt, arg...) fprintf(stderr, "[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
+#define _D(fmt, arg...) fprintf(stderr, "[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
+//#define _E(fmt, arg...) LOGE("[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
+//#define _D(fmt, arg...) LOGD("[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
+
+#define retvm_if(expr, val, fmt, arg...) do { \
+       if(expr) { \
+               _E(fmt, ##arg); \
+               _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return (val); \
+       } \
+} while (0)
+
+#define retv_if(expr, val) do { \
+       if(expr) { \
+               _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return (val); \
+       } \
+} while (0)
+
+#define retm_if(expr, fmt, arg...) do { \
+       if(expr) { \
+               _E(fmt, ##arg); \
+               _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return; \
+       } \
+} while (0)
+
+#define ret_if(expr) do { \
+       if(expr) { \
+               _E("(%s) -> %s() return", #expr, __FUNCTION__); \
+               return; \
+       } \
+} while (0)
+
+
+#endif                         /* __LOCKUPINFO_UTIL_LOG_H__ */
diff --git a/lockupinfo/lockupinfo.c b/lockupinfo/lockupinfo.c
new file mode 100644 (file)
index 0000000..ec358d6
--- /dev/null
@@ -0,0 +1,337 @@
+
+/*
+ *  LOCKUPINFO
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeesun Kim <iamjs.kim@samsung.com>
+ * 
+ * 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.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <time.h>
+
+#include "_util_log.h"
+
+#define VERINFO_PATH "/etc/info.ini"
+#define DEBUG_DIR "/opt/share/hidden_storage/SLP_debug"
+#define PATH_LEN 256
+#define BUF_SIZE 256
+#define PERMS 0755
+#define FILE_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
+
+/* lockupinfo launch key combination: 
+ * 1. volume side key up
+ * 2. volume side key down
+ * 3. home key
+ * 4. home key
+ * 5. volume side key up
+ * 6. volume side key down
+ * 7. volume side key up
+ * 8. home key
+ */
+
+/* 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;
+}
+
+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;
+}
+
+int main()
+{
+       char lbuf[BUF_SIZE];
+       char name[32] = {0, };
+       char size[32] = {0, };
+       char unit[32] = {0, };
+       int csfd;
+       int tmpfd;
+       int meminfo;
+       int verinfo;
+
+       fprintf(stderr, "[lockupinfo] executed\n");
+
+       /* get time  */
+       time_t cur_time;
+       struct tm ctime;
+       cur_time = time(NULL);
+       localtime_r(&cur_time, &ctime);
+
+       char nbuf[256] = {0, }; /* name buf */
+       char dbuf[256] = {0, }; /* dir buf */
+       char ibuf[256] = {0, }; /* info buf */
+       char cbuf[256] = {0, }; /* cmd buf */
+       char tbuf[256] = {0, }; /* temp buf */
+       int ret;
+
+//     snprintf(nbuf, sizeof(nbuf), "debuginfo_%02d%02d%02d%02d%02d%02d",
+//                     ctime->tm_year, ctime->tm_mon, ctime->tm_mday,
+//                     ctime->tm_hour, ctime->tm_min, ctime->tm_sec);
+
+       strftime(tbuf, sizeof(tbuf), "%Y%m%d%H%M%S", &ctime);
+       snprintf(nbuf, sizeof(nbuf), "debuginfo_%s", tbuf);
+
+       /* make debug directory if absent */
+       ret = access(DEBUG_DIR, F_OK);
+       if (ret < 0) {
+               if (ret = mkdir(DEBUG_DIR, PERMS) < 0) {
+                       _E("Failed to mkdir %s(errno:%d)\n", DEBUG_DIR, ret);
+                       return -1;
+               }
+       }
+
+       snprintf(dbuf, sizeof(dbuf), "%s/%s", DEBUG_DIR, nbuf);
+       ret = mkdir(dbuf, PERMS);
+       retvm_if(ret < 0, -1, "Failed to mkdir %s(errno:%d)\n", dbuf, ret);
+
+       snprintf(dbuf, sizeof(dbuf), "%s/%s/%s", DEBUG_DIR, nbuf, "files");
+       ret = mkdir(dbuf, PERMS);
+       retvm_if(ret < 0, -1, "Failed to mkdir %s(errno:%d)\n", dbuf, ret);
+       _D("lockupinfo dir [%s]\n", dbuf);
+
+       snprintf(ibuf, sizeof(ibuf), "%s/%s.info", dbuf, nbuf);
+
+       /* create .info file */
+       csfd = creat(ibuf, FILE_PERMS);
+       retvm_if(csfd < 0, -1, "Failed to creat %s\n", ibuf);
+
+       /* print version info */
+       fprintf_fd(csfd, "******************************\n");
+       fprintf_fd(csfd, "s/w version\n");
+       fprintf_fd(csfd, "******************************\n");
+
+       verinfo = open(VERINFO_PATH, O_RDONLY);
+       if (verinfo < 0) {
+               _E("Failed to open %s\n", VERINFO_PATH);
+
+       } else {
+               while (fgets_fd(lbuf, BUF_SIZE, verinfo)) {
+                       if (strncmp("Major=", lbuf, 6) == 0) {
+                               fprintf_fd(csfd, "%s", lbuf);
+
+                       } else if (strncmp("Minor=", lbuf, 6) == 0) {
+                               fprintf_fd(csfd, "%s", lbuf);
+
+                       } else if (strncmp("Date=", lbuf, 5) == 0) {
+                               fprintf_fd(csfd, "%s", lbuf);
+
+                       } else if (strncmp("Time=", lbuf, 5) == 0) {
+                               fprintf_fd(csfd, "%s", lbuf);
+                               break;
+                       }
+               }
+               close(verinfo);
+
+       }
+
+       /* print mem info */
+       meminfo = open("/proc/meminfo", O_RDONLY);
+       if (meminfo < 0) {
+               _E("Failed to open %s\n", "/proc/meminfo");
+
+       } else {
+               fprintf_fd(csfd, "*******************************\n");
+               fprintf_fd(csfd, "Mem information\n");
+               fprintf_fd(csfd, "*******************************\n");
+
+               while (fgets_fd(lbuf, BUF_SIZE, meminfo) != NULL) {
+                       sscanf(lbuf, "%s %s %s", name, size, unit);
+
+                       if (strcmp("MemTotal:", name) == 0) {
+                               fprintf_fd(csfd, "%s\t%10.0d %s\n", name, atoi(size), unit);
+
+                       } else if (strcmp("MemFree:", name) == 0) {
+                               fprintf_fd(csfd, "%s\t%10.0d %s\n", name, atoi(size), unit);
+
+                       } else if (strcmp("Buffers:", name) == 0) {
+                               fprintf_fd(csfd, "%s\t%10.0d %s\n", name, atoi(size), unit);
+
+                       } else if (strcmp("Cached:", name) == 0) {
+                               fprintf_fd(csfd, "%s\t%10.0d %s\n", name, atoi(size), unit);
+
+                       }
+               }
+               close(meminfo);
+       }
+
+       /* ps info */
+       snprintf(cbuf, sizeof(cbuf), "%s > %s",
+                       "ps ax -o pid,tid,ppid,f,stat,pcpu,pmem,wchan,command", "/tmp/ps_tmp.log");
+       system(cbuf);
+
+       tmpfd = open("/tmp/ps_tmp.log", O_RDONLY);
+       if (tmpfd < 0) {
+               _E("Failed to open %s\n", "/tmp/ps_tmp.log");
+       } else {
+               fprintf_fd(csfd, "*******************************\n");
+               fprintf_fd(csfd, "PS information\n");
+               fprintf_fd(csfd, "*******************************\n");
+
+               while (fgets_fd(lbuf, BUF_SIZE, tmpfd) != NULL) {
+                       fprintf_fd(csfd, "%s", lbuf);
+               }
+               close(tmpfd);
+               unlink("/tmp/ps_tmp.log");
+       }
+
+       /* ping info */
+       snprintf(cbuf, sizeof(cbuf), "%s 2> %s",
+                       "xinfo -p", "/tmp/ping_tmp.log");
+       system(cbuf);
+
+       if ((tmpfd = open("/tmp/ping_tmp.log", O_RDONLY)) < 0) {
+               fprintf(stderr, "[lockupinfo]can't open %s\n",
+                       "/tmp/ping_tmp.log");
+       } else {
+               fprintf_fd(csfd, "*******************************\n");
+               fprintf_fd(csfd, "ping test for all top level windows\n");
+               fprintf_fd(csfd, "*******************************\n");
+
+               while (fgets_fd(lbuf, BUF_SIZE, tmpfd)) {
+                       fprintf_fd(csfd, "%s", lbuf);
+               }
+               close(tmpfd);
+               unlink("/tmp/ping_tmp.log");
+       }
+
+       /* dump topvwins */
+       snprintf(cbuf, sizeof(cbuf), "%s %s",
+                       "/usr/bin/xinfo -xwd_topvwins", dbuf);
+       system(cbuf);
+
+       /* close lockupinfoXXXX.info */
+       close(csfd);
+
+       snprintf(cbuf, sizeof(cbuf), "%s %s/%s.info %s/%s/%s.cs",
+                       "cp", dbuf, nbuf, DEBUG_DIR, nbuf, nbuf);
+       system(cbuf);
+
+
+
+       /* make dlog file */
+       snprintf(tbuf, sizeof(tbuf), "%s/%s", dbuf, "main.log");
+       snprintf(cbuf, sizeof(cbuf), "dlogutil -v time -d -f %s *:v", tbuf);
+       system(cbuf);
+
+       snprintf(tbuf, sizeof(tbuf), "%s/radio.log", dbuf);
+       fprintf(stderr, "radio log path = %s\n", tbuf);
+       snprintf(cbuf, sizeof(cbuf), "dlogutil -v time -b radio -d -f %s *:v", tbuf);
+       system(cbuf);
+
+
+       /* dump window manager info 
+        * this code came from window team
+        */
+       fprintf(stderr, "[lockupinfo]dump window manager info\n");
+       snprintf(cbuf, sizeof(cbuf), "%s %s/%s",
+                       "/usr/bin/e_comp_util -l DUMP_INFO -f", dbuf, "e_comp.log");
+       system(cbuf);
+
+       snprintf(cbuf, sizeof(cbuf), "%s %s/%s",
+                       "/usr/bin/border_win_info -p ALL -f", dbuf, "e_illume2.log");
+       system(cbuf);
+
+       system("/usr/bin/keygrab_status 2");
+       snprintf(cbuf, sizeof(cbuf), "%s %s",
+                       "cp -af /opt/var/log/keygrab_status.txt", cbuf);
+       system(cbuf);
+
+       snprintf(cbuf, sizeof(cbuf), "%s %s/%s",
+                       "/usr/bin/screenshot bmp", cbuf, "slp_screenshot.bmp");
+       system(cbuf);
+
+       snprintf(cbuf, sizeof(cbuf), "%s > %s/%s",
+                       "xinfo -topvwins 2", dbuf, "xinfo_topvwins.txt");
+       system(cbuf);
+
+       /* end from window team */
+
+       /*  copy prev xorg log */
+       snprintf(cbuf, sizeof(cbuf), "%s %s",
+                       "cp /opt/var/log/prev.Xorg.*", dbuf);
+       system(cbuf);
+
+       /*  copy xorg log */
+       snprintf(cbuf, sizeof(cbuf), "%s %s",
+                       "cp /opt/var/log/Xorg.*", dbuf);
+       system(cbuf);
+
+       /* dump a list of current tasks and their information */
+       /* requsted by window team */
+       /*snprintf(cbuf, sizeof(cbuf), "echo t > /proc/sysrq-trigger");
+        *system(cbuf);
+        */
+
+       /* copy syslog messages */
+       snprintf(cbuf, sizeof(cbuf), "%s %s",
+                       "cp /opt/var/log/messages*", dbuf);
+       system(cbuf);
+
+       /* copy nand log */
+       snprintf(cbuf, sizeof(cbuf), "%s %s",
+                       "cp /opt/var/log/nandlog_*", dbuf);
+       system(cbuf);
+
+       /* launch bluescreen */
+       pid_t bs_pid;
+
+       if ((bs_pid = fork()) < 0) {
+               fprintf(stderr, "[lockupinfo] fork_error\n");
+
+       } else if (bs_pid == 0) {
+               if (execl
+                   ("/usr/bin/blue-screen", "blue-screen", ibuf,
+                    "LOCKUPINFO", (char *)0) < 0) {
+                       fprintf(stderr, "[lockupinfo] exec_error\n");
+               }
+               _exit(1);       /*/ shouldn't get here */
+       }
+
+       fprintf(stderr, "[lockupinfo] exit\n");
+       return 0;
+
+}
+
+
diff --git a/lockupinfo/lockupinfo.sh b/lockupinfo/lockupinfo.sh
new file mode 100755 (executable)
index 0000000..e5a91be
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+export DISPLAY=:0
+echo t > /proc/sysrq-trigger
+/usr/bin/lockupinfo
diff --git a/packaging/sys-assert.spec b/packaging/sys-assert.spec
new file mode 100644 (file)
index 0000000..6409a70
--- /dev/null
@@ -0,0 +1,77 @@
+Name:       sys-assert
+Summary:    Blue screen and bs-viewer ui
+Version:    0.2.89
+Release:    1
+Group:      TBD
+License:    LGPL
+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(dnet)
+BuildRequires:  pkgconfig(sqlite3)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(pmapi)
+BuildRequires:  pkgconfig(libcurl)
+BuildRequires:  cmake
+BuildRequires:  edje-tools
+
+%description
+blue screen and bs-viewer ui
+
+%package -n org.tizen.blue-screen
+Summary:    blue screen and bs-viewer ui
+Group:      TO_BE/FILLED
+
+%description -n org.tizen.blue-screen
+blue screen and bs-viewer ui.
+
+%package -n libsys-assert
+Summary:    libsys-assert (shared object)
+Group:      TO_BE/FILLED
+Requires:   %{name} = %{version}-%{release}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description -n libsys-assert
+libsys-assert (shared object).
+
+%prep
+%setup -q
+
+%build
+export CFLAGS+=" -fPIC"
+%ifarch %{arm}
+    export CFLAGS+=" -DTARGET"
+%endif
+
+cmake . -DCMAKE_INSTALL_PREFIX=/usr
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+
+%make_install
+
+%post -n libsys-assert -p /sbin/ldconfig
+
+%postun -n libsys-assert -p /sbin/ldconfig
+
+%files
+
+%files -n org.tizen.blue-screen
+/usr/bin/*
+/usr/share/*
+/opt/share/*
+/opt/apps/*
+
+%files -n libsys-assert
+/usr/lib/*.so*
+
diff --git a/sys-assert/.debugmode b/sys-assert/.debugmode
new file mode 100644 (file)
index 0000000..6065311
--- /dev/null
@@ -0,0 +1 @@
+This file is for /opt/etc/
diff --git a/sys-assert/CMakeLists.txt b/sys-assert/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6eafd48
--- /dev/null
@@ -0,0 +1,49 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(sys-assert C)
+
+SET(SRCS
+       src/sys-assert.c
+)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+       ADD_DEFINITIONS("-DTARGET")
+       MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DSLP_DEBUG")
+ADD_DEFINITIONS("-DEAPI")
+ADD_DEFINITIONS("-DDEBUG_ON")
+ADD_DEFINITIONS("-DLCD_TYPE_WVGA")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -ldl)
+
+INSTALL(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/.debugmode DESTINATION /opt/etc)
+
+
diff --git a/sys-assert/src/_logic.c b/sys-assert/src/_logic.c
new file mode 100644 (file)
index 0000000..7f47349
--- /dev/null
@@ -0,0 +1,1092 @@
+
+/*
+ * SYS-ASSERT
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeesun Kim <iamjs.kim@samsung.com> Youngkyeong Yun <yk.yun@samsung.com>
+ *
+ * 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
new file mode 100644 (file)
index 0000000..4f9c155
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * SYS-ASSERT
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeesun Kim <iamjs.kim@samsung.com> Youngkyeong Yun <yk.yun@samsung.com>
+ *
+ * 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
new file mode 100644 (file)
index 0000000..07ef7ca
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *  SYS_ASSERT
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeesun Kim <iamjs.kim@samsung.com>
+ *
+ * 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
new file mode 100755 (executable)
index 0000000..bf9a06d
--- /dev/null
@@ -0,0 +1,1271 @@
+
+/*
+ * SYS-ASSERT
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeesun Kim <iamjs.kim@samsung.com> Youngkyeong Yun <yk.yun@samsung.com>
+ *
+ * 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 <stdlib.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <execinfo.h>
+#include <dlfcn.h>
+#include <elf.h>
+#include <fcntl.h>
+#include <ucontext.h>
+#include <signal.h>
+#include <linux/unistd.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <time.h>
+/* for PR_SET_DUMPABLE */
+#include <sys/prctl.h>
+#include "sys-assert.h"
+
+#define VERINFO_PATH "/etc/info.ini"
+#define CS_DIR "/opt/share/hidden_storage/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;
+       char timestr[64]= {0, };
+       cur_time = time(NULL);
+       gmtime_r(&cur_time, &ctime);
+//     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 */
+       strftime(timestr, sizeof(timestr), "%Y%m%d%H%M%S", &ctime);
+       if (snprintf(temp_path, PATH_LEN, "%s_%d_%s", exename_p, pid, timestr) == 0) {
+//         (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\n",
+                       filepath_cs);
+               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  */
+       strftime(timestr, sizeof(timestr), "%Y.%m.%d %H:%M:%S", &ctime);
+       fprintf_fd(csfd, "time = %s ( UTC )\n", timestr);
+
+       /* 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);
+}
diff --git a/sys-assert/src/sys-assert.h b/sys-assert/src/sys-assert.h
new file mode 100755 (executable)
index 0000000..9cad8a7
--- /dev/null
@@ -0,0 +1,87 @@
+
+/*
+ * SYS-ASSERT
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeesun Kim <iamjs.kim@samsung.com> Youngkyeong Yun <yk.yun@samsung.com>
+ *
+ * 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.
+ *
+ */
+
+
+#ifndef _DEBUG_ASSERT_H_
+#define _DEBUG_ASSERT_H_
+
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+       struct addr_node {
+               long *startaddr;
+               long *endaddr;
+               char perm[5];
+               char *fpath;
+               struct addr_node *next;
+       };
+
+#ifdef __arm__
+       typedef struct layout {
+               struct layout *fp;
+               void *ret;
+       } layout;
+
+#else
+       typedef struct layout {
+               struct layout *ebp;
+               void *ret;
+       } layout;
+#endif
+
+       extern void *__libc_stack_end;
+
+       static int trace_symbols(void *const *array, int size,
+                                struct addr_node *start, int csfd);
+
+       static struct addr_node *get_addr_list_from_maps(int fd);
+
+       static void print_node_to_file(struct addr_node *start, int fd);
+
+#ifdef BTDEBUG
+       static void print_node(struct addr_node *start);
+#endif
+       static void free_all_nodes(struct addr_node *start);
+
+       static long *get_start_addr(long *value, struct addr_node *start);
+
+       static char *get_fpath(long *value, struct addr_node *start);
+
+       static void print_signal_info(const siginfo_t *info, int fd);
+
+       char *fgets_fd(char *s, int n, int fd);
+
+       int fprintf_fd(int fd, const char *fmt, ...);
+
+       static char *remove_path(const char *cmd);
+
+       static int check_redscreen(int pid);
+
+       inline static void get_localtime(time_t cur_time, struct tm *ctime);
+
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* _DEBUG_ASSERT_H_ */
diff --git a/sys-assert/sys-assert.c b/sys-assert/sys-assert.c
new file mode 100755 (executable)
index 0000000..a50c837
--- /dev/null
@@ -0,0 +1,1273 @@
+/*
+ * SYS_ASSERT
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeesun Kim <iamjs.kim@samsung.com>
+ *
+ * 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 <stdlib.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <execinfo.h>
+#include <dlfcn.h>
+#include <elf.h>
+#include <fcntl.h>
+#include <ucontext.h>
+#include <signal.h>
+#include <linux/unistd.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <dirent.h>
+/* for PR_SET_DUMPABLE */
+#include <sys/prctl.h>
+#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);
+}
diff --git a/sys-assert/sys-assert.pc b/sys-assert/sys-assert.pc
new file mode 100755 (executable)
index 0000000..0e7185c
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: sys-assert
+Description: for debugging
+Version: 1.0
+Requires: 
+Libs: -L${libdir} 
+Cflags: -I${includedir}