Hello community, here is the log from the commit of package segv_handler for openSUSE:Factory checked in at 2020-03-12 23:08:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/segv_handler (Old) and /work/SRC/openSUSE:Factory/.segv_handler.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "segv_handler" Thu Mar 12 23:08:03 2020 rev:16 rq:784317 version:0.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/segv_handler/segv_handler.changes 2014-10-15 08:52:10.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.segv_handler.new.3160/segv_handler.changes 2020-03-12 23:12:33.539329910 +0100 @@ -1,0 +2,7 @@ +Thu Mar 12 12:43:03 UTC 2020 - Martin Pluskal <[email protected]> + +- Cleanup spec file +- Update to version 0.0.2: + * No changelog available + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ segv_handler.spec ++++++ --- /var/tmp/diff_new_pack.asEFse/_old 2020-03-12 23:12:34.055330113 +0100 +++ /var/tmp/diff_new_pack.asEFse/_new 2020-03-12 23:12:34.055330113 +0100 @@ -1,7 +1,7 @@ # # spec file for package segv_handler # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,23 +12,22 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: segv_handler -Version: 0.0.1 +Version: 0.0.2 Release: 0 -Url: http://samba.org/ftp/unpacked/junkcode/segv_handler/ Summary: System wide segv handler to produces a backtrace -License: GPL-2.0+ +License: GPL-2.0-or-later Group: Development/Tools/Other -Source: http://samba.org/ftp/unpacked/junkcode/segv_handler/backtrace -Source1: http://samba.org/ftp/unpacked/junkcode/segv_handler/Makefile -Source2: http://samba.org/ftp/unpacked/junkcode/segv_handler/README -Source3: http://samba.org/ftp/unpacked/junkcode/segv_handler/segv_handler.c -Source4: http://samba.org/ftp/unpacked/junkcode/segv_handler/testprog.c -BuildRoot: %{_tmppath}/%{name}-%{version}-build +URL: https://samba.org/ftp/unpacked/junkcode/segv_handler/ +Source: https://samba.org/ftp/unpacked/junkcode/segv_handler/backtrace +Source1: https://samba.org/ftp/unpacked/junkcode/segv_handler/Makefile +Source2: https://samba.org/ftp/unpacked/junkcode/segv_handler/README +Source3: https://samba.org/ftp/unpacked/junkcode/segv_handler/segv_handler.c +Source4: https://samba.org/ftp/unpacked/junkcode/segv_handler/testprog.c %description This is a useful utility for installing a system-wide segv handler that @@ -36,35 +35,23 @@ installed as a preload, so you don't need to modify the target programs. - - -Authors: --------- - Andrew Tridgell <tridge at Samba dot org> - %prep -cp -p %{S:1} %{S:2} %{S:3} %{S:4} ${RPM_BUILD_DIR} +export CFLAGS="%{optflags}" +%setup -q -c -T +cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} ./ %build -export CFLAGS=$RPM_OPT_FLAGS -make -rm -f /tmp/segv_testprog.* -%ifnarch %arm -make test -%endif +%make_build %install -mkdir -p \ - ${RPM_BUILD_ROOT}/%{_bindir} \ - ${RPM_BUILD_ROOT}/%{_libdir} \ - ${RPM_BUILD_ROOT}/%{_docdir}/%{name} -install -m 0755 %{S:0} ${RPM_BUILD_ROOT}/%{_bindir} -install -m 0755 ${RPM_BUILD_DIR}/segv_handler.so ${RPM_BUILD_ROOT}/%{_libdir} +install -Dpm 0755 %{SOURCE0} \ + %{buildroot}%{_bindir}/backtrace +install -Dpm 0755 segv_handler.so \ + %{buildroot}%{_libdir}/segv_handler.so %files -%defattr(-,root,root) +%doc README %{_bindir}/backtrace %{_libdir}/segv_handler.so -%doc README %changelog ++++++ Makefile ++++++ --- /var/tmp/diff_new_pack.asEFse/_old 2020-03-12 23:12:34.083330124 +0100 +++ /var/tmp/diff_new_pack.asEFse/_new 2020-03-12 23:12:34.087330126 +0100 @@ -3,14 +3,20 @@ all: segv_handler.so testprog segv_handler.so: segv_handler.o - ld -shared -o $@ $^ $(LIBS) + gcc $(CFLAGS) -shared -o $@ $^ $(LIBS) + +segv_handler64.so: segv_handler.c + gcc $(CFLAGS) -m64 -shared -o $@ $^ $(LIBS) + +segv_handler32.so: segv_handler.c + gcc $(CFLAGS) -m32 -shared -o $@ $^ $(LIBS) testprog: testprog.c - $(CC) -g -o testprog{,.c} + $(CC) -g -o testprog testprog.c test: all -LD_PRELOAD=./segv_handler.so ./testprog - ls -l /tmp/segv_testprog.* + ls -l /var/log/segv/segv_testprog.* clean: /bin/rm -f *.o *.so *~ testprog /tmp/segv_testprog.* ++++++ backtrace ++++++ --- /var/tmp/diff_new_pack.asEFse/_old 2020-03-12 23:12:34.107330134 +0100 +++ /var/tmp/diff_new_pack.asEFse/_new 2020-03-12 23:12:34.107330134 +0100 @@ -8,7 +8,8 @@ cat << EOF > $TMPFILE set height 0 bt full +thread apply all bt full quit EOF -gdb -batch -x $TMPFILE /proc/$PID/exe $PID < /dev/null +gdb -batch -x $TMPFILE --pid $PID < /dev/null 2>&1 /bin/rm -f $TMPFILE ++++++ segv_handler.c ++++++ --- /var/tmp/diff_new_pack.asEFse/_old 2020-03-12 23:12:34.119330139 +0100 +++ /var/tmp/diff_new_pack.asEFse/_new 2020-03-12 23:12:34.123330140 +0100 @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include <signal.h> #include <stdlib.h> #include <stdio.h> @@ -18,14 +19,16 @@ p = strrchr(progname, '/'); *p = 0; - snprintf(cmd, sizeof(cmd), "backtrace %d > /tmp/segv_%s.%d.out 2>&1", + snprintf(cmd, sizeof(cmd), "backtrace %d > /var/log/segv/segv_%s.%d.out 2>&1", (int)getpid(), p+1, (int)getpid()); system(cmd); signal(SIGSEGV, SIG_DFL); return 0; } -void _init(void) +static void segv_init() __attribute__((constructor)); +void segv_init(void) { - signal(SIGSEGV, segv_handler); + signal(SIGSEGV, (sighandler_t) segv_handler); + signal(SIGBUS, (sighandler_t) segv_handler); } ++++++ testprog.c ++++++ --- /var/tmp/diff_new_pack.asEFse/_old 2020-03-12 23:12:34.135330145 +0100 +++ /var/tmp/diff_new_pack.asEFse/_new 2020-03-12 23:12:34.135330145 +0100 @@ -1,9 +1,17 @@ -void foo(int *x) +void another_function(int *yy) { /* add some local variables for "bt full" to see */ int y = 7; double foo = 1.2; - *x = 2; + *yy = 2; +} + +void foo(int *x) +{ + /* add some local variables for "bt full" to see */ + int foovar = 7; + double myval = 1.2; + another_function(x); } int main(void)
