First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 140809
Alias:
Product:
Component:
Status: CLOSED
Resolution: UPSTREAM
Assigned To: Paul de Vrieze <pauldv@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Hanno Meyer-Thurow <h.mth@web.de>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Test.java A testcase? text/plain Hanno Meyer-Thurow 2006-07-17 17:07 0000 263 bytes Details
emerge.info emerge --info text/plain Peter Humphrey 2006-10-18 08:57 0000 3.18 KB Details
db_java_wrap.s.diff.bz2 db_java_wrap.c with -O2 opt. segfaults application/octet-stream Hanno Meyer-Thurow 2006-12-18 13:05 0000 174.16 KB Details
java-wrapper_no-strict-aliasing.diff -fstrict-aliasing miscompiles db_java_wrap.c patch Hanno Meyer-Thurow 2006-12-18 14:14 0000 433 bytes Details | Diff
Test.java proper testcase text/plain Hanno Meyer-Thurow 2006-12-19 04:12 0000 637 bytes Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 140809 depends on: Show dependency tree
Bug 140809 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.




View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-07-17 11:37 0000
As far as I know does Andreas want to use system db for openoffice in future.
He told me to report this.

Now if one compiles sys-libs/db-4.x with gcc-4.x it miscompiles cni/jni code of
sys-libs/db.

What happens if the optimization level is higher than -O1 is that HelpLinker
(Java) in helpcontent2 module segfaults because of that.

The only thing to get around that is to place 'replace-flags "-O2" "-O1"' and
'replace-flags "-O3" "-O1"' before configure in src_compile.

I tried to get a good backtrace but gdb did not print useful information this
time but still segfaults.

------- Comment #1 From Andreas Proschofsky 2006-07-17 11:49:54 0000 -------
(In reply to comment #0)
> As far as I know does Andreas want to use system db for openoffice in future.
> He told me to report this.

Yep that's true, using system-db should solve some problems for us, so I'm
quite interested in getting a solution for this.

------- Comment #2 From Paul de Vrieze 2006-07-17 12:34:55 0000 -------
Do you have any idea which of the flags enabled by -O2 causes it? Or a small
testcase? Which openoffice source file fails? (Could you give me the specific
gcc command?) I prefer to fix the sourcecode. Otherwise I could try to fix it.

------- Comment #3 From Hanno Meyer-Thurow 2006-07-17 16:28:40 0000 -------
Well, I just found these links:
http://www.gatago.com/comp/databases/berkeley-db/18675477.html
http://dev.sleepycat.com/resources/faq_show.html?id=113&back=%3Factio

They say to replace it by -O. I can say that -O1 does just fine, too. So I
prefer -O1. ;)

@ Paul
If you want to dig into gcc and/or db hacking you may contact sleepycat. They
know about it.
Sorry, I cannot be of more help here.

------- Comment #4 From Hanno Meyer-Thurow 2006-07-17 17:07:17 0000 -------
Created an attachment (id=92037) [details]
A testcase?

From the first link.
- create new Database

It does not segfault here but runs forever.

------- Comment #5 From Hanno Meyer-Thurow 2006-08-21 14:48:07 0000 -------
Any news here, Paul?

Could be cool to have a check for gcc4.x to reset the optimization level in the
ebuild.

------- Comment #6 From Peter Humphrey 2006-10-18 08:55:57 0000 -------
Here, after switching GCC from 3.4.6 to 4.1.1 I cannot compile db-4.3.29-r2. I
get this:

-- 
[...]
/bin/sh ./libtool --mode=compile x86_64-pc-linux-gnu-g++ -c -I. -I../dist/.. 
-D_GNU_SOURCE -D_REENTRANT -O1 -march=opteron -pipe ../dist/../cxx/cxx_db.cpp
 x86_64-pc-linux-gnu-g++ -c -I. -I../dist/.. -D_GNU_SOURCE -D_REENTRANT -O1
-march=opteron -pipe ../dist/../cxx/cxx_db.cpp  -fPIC -DPIC -o .libs/cxx_db.o
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/backward/iostream.h:31,
                 from ./db_cxx.h:60,
                 from ../dist/../cxx/cxx_db.cpp:15:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/backward/backward_warning.h:32:2:
warning: #warning This file includes at least one deprecated or antiquated
header. Please consider using one of the 32 headers found in section 17.4.1.2
of the C++ standard. Examples include substituting the <X> header for the <X.h>
header for C++ includes, or <iostream> instead of the deprecated header
<iostream.h>. To disable this warning use -Wno-deprecated.
In file included from ../dist/../cxx/cxx_db.cpp:15:
./db_cxx.h:61:23: error: exception.h: No such file or directory
-- 

I tried setting the optimisation level down, thus:

-- 
$ cat /etc/portage/env/sys-libs/db
CFLAGS="-O1 -march=opteron -pipe"
CXXFLAGS="${CFLAGS}"
-- 

... but I still get the same error. Not sure what else to try.

------- Comment #7 From Peter Humphrey 2006-10-18 08:57:17 0000 -------
Created an attachment (id=99945) [details]
emerge --info

------- Comment #8 From Hanno Meyer-Thurow 2006-12-18 13:05:53 0000 -------
Created an attachment (id=104309) [details]
db_java_wrap.c with -O2 opt. segfaults

... db_java_wrap.c with -O1 is fine.

It segfaults in: Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1set_1errcall
This is the assembly code diff.bz2 between -O1 and -O2 opt.
I hope it helps.

------- Comment #9 From Hanno Meyer-Thurow 2006-12-18 14:14:30 0000 -------
Created an attachment (id=104321) [details]
-fstrict-aliasing miscompiles db_java_wrap.c

------- Comment #10 From Hanno Meyer-Thurow 2006-12-19 04:12:13 0000 -------
Created an attachment (id=104352) [details]
proper testcase

------- Comment #11 From Hanno Meyer-Thurow 2006-12-23 04:37:26 0000 -------
May be it is also good to inform upstream to update their FAQ. See:
http://www.oracle.com/technology/products/berkeley-db/faq/db_faq.html#13

------- Comment #12 From Andreas Proschofsky 2007-01-12 12:14:33 0000 -------
the fix is not necessary anymore to build OOo with system-db, still would be
good to get it in /me thinks

------- Comment #13 From Hanno Meyer-Thurow 2007-04-17 09:44:39 0000 -------
I sent my patch upstream and Oracle included it. So upcoming releases will be
fine hopefully.

------- Comment #14 From Hanno Meyer-Thurow 2007-08-31 09:57:51 0000 -------
berkeley db 4.6.19 has the fix → closing.

First Last Prev Next    No search results available      Search page      Enter new bug