Bug 84618 - [Embedded Firebird] shows C runtime error message trying to create db
Summary: [Embedded Firebird] shows C runtime error message trying to create db
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.3.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: needsWindows
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-03 06:28 UTC by reinierolislagers
Modified: 2014-10-05 15:12 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description reinierolislagers 2014-10-03 06:28:13 UTC
When creating a new Firebird embedded database through the wizard I get
Runtime Error!
Program <...path to soffice.bin>

R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.

FYI 
- I've got 32 bit and 64 bit Firebird 2.5.3 fbclient.dll, fbembed.dll and support libraries installed in windows\system32 and windows\syswow64. Works well with Flamerobin and 32 bit FreePascal applications.
- Got Java JRE7 installed (x86)
Comment 1 Julien Nabet 2014-10-03 06:42:24 UTC
Do you have jre7 32 bits? Indeed, it can't work with jre 7 64 bits since LO for Windows is built in 32 bits only
Comment 2 reinierolislagers 2014-10-03 06:47:20 UTC
"Got Java JRE7 installed (x86)" so yes, 32 bit
Comment 3 Julien Nabet 2014-10-03 07:20:04 UTC
Sorry for my previous comment, Firebird doesn't use Java (HSQLDB, the default DB on LO for the moment, yes).

Is it a brand new install or an update/upgrade? Did you download LO from official website? (see http://www.libreoffice.org/download/libreoffice-fresh/)
Comment 4 reinierolislagers 2014-10-03 07:22:43 UTC
It's a series of upgrades. Yes, installed from official server.
Wouldn't it help if I produced some trace log or something?
Comment 5 Julien Nabet 2014-10-03 07:28:51 UTC
For the test, could you rename your LO directory profile (see https://wiki.documentfoundation.org/User_Profile#Windows) and give it a new try?
Comment 6 reinierolislagers 2014-10-03 07:37:52 UTC
Renamed LO profile dir; I still the error message.
Comment 7 Julien Nabet 2014-10-03 07:43:58 UTC
Lionel: thought you might be interested in this one.
Comment 8 Lionel Elie Mamane 2014-10-03 08:18:12 UTC
Googling suggests this is a manifest issue. CCing our Windows "FindTheExpert", and people that have helped with Windows issues in the past.
Comment 9 DavidO 2014-10-03 09:47:34 UTC
(In reply to Lionel Elie Mamane from comment #8)
> Googling suggests this is a manifest issue. CCing our Windows
> "FindTheExpert", and people that have helped with Windows issues in the past.

Can someone provide hints how to build LO with firebird support and exact steps how to reproduce the problem.
Comment 10 Lionel Elie Mamane 2014-10-03 09:52:43 UTC
(In reply to reinierolislagers from comment #0)
> - I've got 32 bit and 64 bit Firebird 2.5.3 fbclient.dll, fbembed.dll and
> support libraries installed in windows\system32 and windows\syswow64. Works
> well with Flamerobin and 32 bit FreePascal applications.

I wonder if it is not a conflict between the libraries bundled with LibreOffice and these "system" installations. Could you try without the system-installed firebird libraries?
Comment 11 Lionel Elie Mamane 2014-10-03 09:59:51 UTC
(In reply to DavidO from comment #9)

> Can someone provide hints how to build LO with firebird support

--enable-firebird-sdbc --without-system-firebird

Since the error message hints at C runtime library mismatches, it might depend on your build time vs run time environment, not sure.

> and exact steps how to reproduce the problem.

c:\users\davido > "c:\progra~1\libreoffice 4.3\program\soffice"
menu tools / options / LibreOffice / Advanced / Enable experimental features
OK
menu file / new / database
create a new database
embeded database: Firebird Embedded
Finish
choose a location and file name
save
Comment 12 reinierolislagers 2014-10-03 15:51:20 UTC
(In reply to Lionel Elie Mamane from comment #10)
> I wonder if it is not a conflict between the libraries bundled with
> LibreOffice and these "system" installations. Could you try without the
> system-installed firebird libraries?

x86 test program using Firebird without dlls in application dir runs: ok

Rename all fb libs in/below x86 dir:
dir c:\windows\SysWOW64\*.???_ /s
 Directory of c:\windows\SysWOW64

05/08/2014  12:05    <SYMLINK>      FBCLIENT.DLL_ [c:\windows\syswow64\fbembed.d
ll]
09/07/2014  07:51         3,829,760 fbembed.dll_
09/07/2014  07:45           149,012 firebird.msg_
22/07/2014  09:20    <SYMLINK>      GDS32.DLL_ [c:\windows\syswow64\fbembed.dll]

09/07/2014  07:49             7,680 ib_util.dll_
09/07/2014  07:36         1,568,768 icudt30.dll_
09/07/2014  07:36           417,792 icuin30.dll_
09/07/2014  07:36           675,840 icuuc30.dll_
               8 File(s)      6,648,852 bytes

 Directory of c:\windows\SysWOW64\intl

09/07/2014  07:51           925,696 fbintl.dll_
               1 File(s)        925,696 bytes
							 
x86 test program using Firebird without dlls in application dir fails to run: ok


Now LibreOffice indeed does not show the error message and I can create tables etc.

1. Perhaps I've installed the libs incorrectly (just copied them) but if not:
2. While this may be a workaround, IMO having fbclient/fbembed installed in the system(wow64) dir is a common scenario, is not a problem for other applications using Firebird and should be handled OK if possible. Thanks.
Comment 13 Lionel Elie Mamane 2014-10-04 19:26:12 UTC
(In reply to reinierolislagers from comment #12)

> Rename all fb libs in/below x86 dir:

> Now LibreOffice indeed does not show the error message and I can create
> tables etc.

OK, thanks. So that we can reproduce, can you please give us a download link to the firebird libs you installed (the exact same version), and how you installed them (if not by the putative installation instructions that putatively come with the download). Thanks.

> 2. While this may be a workaround, IMO having fbclient/fbembed installed in
> the system(wow64) dir is a common scenario, is not a problem for other
> applications using Firebird and should be handled OK if possible.

Yes.
Comment 14 reinierolislagers 2014-10-05 12:26:53 UTC
Thanks.
I couldn't really find any installation instructions except those mentioning to put the dlls in your application directory - which is cumbersome when developing many Firebird embedded databases.

Actually I think it's my fault - I confirmed with the Firebird support list:
http://news.gmane.org/find-root.php?message_id=542FC679.1020209%40gmail.com

Summary: you're not supposed to copy libfbembed.dll+support libs into the system32/syswow64 directories. Copying to 
1. your application dir or 
2. to a directory on your PATH 
is ok.

I will try approach 2 and document the exact steps/downloads used and success or failure. Thanks again for looking into this.
Comment 15 reinierolislagers 2014-10-05 13:34:39 UTC
Installing systemwide Firebird embedded into a directory in the %PATH%:
1. mkdir %programdata%\Fbembed32 (in my case, Windows 7: C:\ProgramData\Fbembed32)
2. Download 32 bit 2.5.3 embedded zip and extract files:
http://sourceforge.net/projects/firebird/files/firebird-win32/2.5.3-Release/Firebird-2.5.3.26778-0_Win32_embed.zip/download
=> extract at least
fbembed.dll
icudt30.dll
icuin30.dll
icuuc30.dll
Microsoft.VC80.CRT.manifest
msvcp80.dll
msvcr80.dll
fbembed.dll 
into that directory.
3. add %programdata%\fbembed32 to system path
4. try client application using Firebird embedded (did not need to restart first but it never hurts) => works
5. start Libreoffice, create embedded FB database. Works for me.

I think this bug can be closed (happy to do it myself, don't know proper procedure here) - thanks for everybody's time and effort!