[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-11-19 Thread Christian Ehrhardt 
Since I before had only arm traces here, this is x86: Program received signal SIGSEGV, Segmentation fault. __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:384 384 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-11-19 Thread Christian Ehrhardt 
Notes to myself for another day if I need to revisit this Repro: # enable sources for apt $ apt upgrade $ apt install dpkg-dev openjade docbook-dsssl $ apt source pgpool2 $ cd pgpool2-4.1.1/doc/src/sgml/ $ openjade -wall -wno-unused-param -wno-empty -wfully-tagged -c /usr/share/sgml/docbook/sty

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-11-19 Thread Christian Ehrhardt 
I've found that: - recompiling openjade on Debian nowadays makes it exhibit the same behavior - recompiling openjade in Debian&Ubuntu with gcc-9 also fails the same way I'd love to find the root cause, but my hope of identifying either a compiler-default-option or compiler-version that made it bre

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-11-19 Thread Christian Ehrhardt 
FYI These issues might exist for a long time, but seem to grow recently - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489482 - https://sources.debian.org/src/vim/2:8.2.1913-1/debian/changelog/?hl=2026#L2026 ** Bug watch added: Debian Bug tracker #489482 https://bugs.debian.org/cgi-bi

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-11-19 Thread Christian Ehrhardt 
This now indeed breaks on all architectures: https://launchpadlibrarian.net/507574538/buildlog_ubuntu-hirsute-amd64.pgpool2_4.1.4-2_BUILDING.txt.gz https://launchpadlibrarian.net/507575283/buildlog_ubuntu-hirsute-armhf.pgpool2_4.1.4-2_BUILDING.txt.gz https://launchpadlibrarian.net/507578381/buildlo

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-04-22 Thread Christian Ehrhardt 
FYI I got reports this might now also affect ppc64 and amd64. For ppc64 the confirmation is in that -O0 build fixes it. So this might have to be re-rolled setting -O0 on all architectures. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to o

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-04-05 Thread Christian Ehrhardt 
This migrated and fixed the issue. => https://launchpad.net/ubuntu/+source/openjade/1.4devel1-21.3ubuntu1 But as discussed before since this is more a mitigation than a fix we keep the bug open. -- You received this bug notification because you are a member of Desktop Packages, which is subscrib

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-04-01 Thread Christian Ehrhardt 
Thanks, I have modified the changelog to not - auto-close the bug, but still refer to it. Uploaded ... -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to openjade in Ubuntu. https://bugs.launchpad.net/bugs/1869734 Title: openjade segfaul

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-04-01 Thread Robie Basak
+1 to upload the patch in comment #2 as you need it for release purposes, but as this is a workaround rather than a solution I think this bug should remain open. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to openjade in Ubuntu. https://

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
One last shot, I've found that this is unexpected by the vector code: void resize(size_t n) { if (n < size_) erase(ptr_ + n, ptr_ + size_); else if (n > size_) append(n - size_); But in this case: (gdb) p n $39 = 2 (gdb) p size_ $40 = 2 So it would need to do NOTHING! It alr

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
I've gone rather deep on this, but I think I need to timebox this now. Remaining questions: - Maybe the inlining pre-evaluates things wrong and combines resize/size in a bad way to pass the value 2 where it should be 1? - maybe the code<->line association is wrong and this is the first args.re

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
But we actually have 2 entries. It should not break. (gdb) p args $32 = {_vptr.NCVector = 0xf7f8a020 >+16>, size_ = 2, ptr_ = 0xab46eae0, alloc_ = 2} (gdb) p *(args.ptr_+0)$33 = {_vptr.Owner = 0xf7f8a040 +16>, p_ = 0xab46f9f0} (gdb) p *(args.ptr_+1) $34 = {_vptr.Owner = 0xf7f

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
The call is from: OpenSP::NCVector >::resize (this=0xe0c8, n=1) That means resize it to size "1". And it would be ok to delete all later elements. void resize(size_t n) { if (n < size_) erase(ptr_ + n, ptr_ + size_); else if (n > size_) append(n - size_); } p pt

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
Backtrace is more readable now, erase comes from resize it seems. #0 0xf7e4f620 in OpenSP::NCVector >::erase (this=0xe0c8, p1=0xab46eaf0, p2=0xab46eb00) at /usr/include/OpenSP/Vector.cxx:132 #1 0xf7e4e0e4 in OpenSP::NCVector >::resize (this=0xe0c8,

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
This is the most trimmed down versions that fails: -O0 -finline-functions-called-once But: -O2 -fno-inline-functions-called-once does not make it work, probably other optimizations can trigger the same issue. But maybe the one above is better to debug? -- You received this bug notification beca

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
With GCC-7 the -O1 build segfaults as well. Maybe more debug info in there? => nothing more helpful :-/ Lets see if we can get the same result with: -fauto-inc-dec -fbranch-count-reg -fcombine-stack-adjustments -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse -ff

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
I installed gcc/g++ in version 7 and 8 as well and added in d/rules: CC=gcc-7 export CC CPP=cpp-7 export CPP CXX=g++-7 export CXX I see the build being: libtool: compile: g++-7 -DHAVE_CONFIG_H -I. -I.. -I../grove -g --pipe -fpermissive -fno-lifetime-dse -O2 -MT GroveBuilder.lo -MD -

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
So we have a debuggable build with -O0 that doesn't trigger the error. And one that "suddenly appears at ::erase with bad arguments". :-/ We might have to come back to just set -O0 on arm64 ... -- You received this bug notification because you are a member of Desktop Packages, which is subscribe

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
... make debugging harder -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to openjade in Ubuntu. https://bugs.launchpad.net/bugs/1869734 Title: openjade segfaults on arm (due to gcc optimization) Status in openjade package in Ubuntu: T

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-31 Thread Christian Ehrhardt 
Three classes Rule, ElementRule and QueryRule define int compareSpecificity(const Rule &) const; int compareSpecificity2(const ElementRule *) const; int compareSpecificity2(const QueryRule *) const; Per Backtrace we seem to be in a "Rule" object but since the passed object is optimize

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-30 Thread Christian Ehrhardt 
BTW src:opensp a Cxx file in includes really? This is on version 1.5.2 for ages no upstream changes. It is possible that depeding on the optimization of openjade on build it changes the code flow into ::erase and then triggers the bad behavior. replaced the broken line with: for (const T *p =

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-30 Thread Christian Ehrhardt 
If I run this with the -O0 build it never ever reaches OpenSP::Vector::erase So the code is still broken, but we just don't reach it. -O0 isn't even a good mitigation. Tracking the root cause further. Very late in the -O0 build it then hits it like: ::erase (this=0xab027250, p1=0xaaeb5c

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-30 Thread Christian Ehrhardt 
Ok, now things make sense. src:openjade also builds libostyle1c2 and updating that to the -O0 build made it work. So overall this would be a good fix still. Drawback, I'd love to know what is going on under the covers ... :-/ -- You received this bug notification because you are a member of Des

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-30 Thread Ubuntu Foundations Team Bug Bot
** Tags added: patch -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to openjade in Ubuntu. https://bugs.launchpad.net/bugs/1869734 Title: openjade segfaults on arm (due to gcc optimization) Status in openjade package in Ubuntu: Triage

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-30 Thread Christian Ehrhardt 
Harr, so we knew we could rebuild it on the system -O2 => segfault -O0 => working Building on LP (PPA) doesn't behave the same way. Even thou https://launchpadlibrarian.net/471751679/buildlog_ubuntu-focal-arm64.openjade_1.4devel1-21.3ubuntu1~ppa1_BUILDING.txt.gz really built it -O0 the binary ou

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-30 Thread Christian Ehrhardt 
** Patch added: "fix by building arm64 as -O0" https://bugs.launchpad.net/ubuntu/+source/openjade/+bug/1869734/+attachment/5343403/+files/fix-lp-1869734.debdiff -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to openjade in Ubuntu. https

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-30 Thread Christian Ehrhardt 
PPA: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3999 -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to openjade in Ubuntu. https://bugs.launchpad.net/bugs/1869734 Title: openjade segfaults on arm (due to gcc optimization

[Desktop-packages] [Bug 1869734] Re: openjade segfaults on arm (due to gcc optimization)

2020-03-30 Thread Christian Ehrhardt 
Get a postgresql9.5 package and build it, it will fail. Re-run the failing command: $ gdb /usr/bin/openjade (gdb): run -wall -wno-unused-param -wno-empty -wfully-tagged -wnet -D . -D . -c /usr/share/sgml/docbook/stylesheet/dsssl/modular/catalog -d stylesheet.dsl -t sgml -i output-html -V html-in