lformella/xdcc-grabscher

FATAL [ 1] 0:XG.Plugin.AWorker.Start() System.EntryPointNotFoundException: FlushFileBuffers at (wrapper managed-to-native) Sharpen.IO.RandomAccessFile:FlushFileBuffers

Strubbl opened this issue · 14 comments

Hello,
with the latest release Shiny Shibe I get the following error on a clean fresh setup. I downloaded the Mac-Linux Binaries. (BTW, the files is named XG_3.3.0.0.tar.Linux.Mac.gz, but I think it was intended to name it XG_3.3.0.0.Linux.Mac.tar.gz. This makes a difference when trying to extract the tgz.)

$ mono XG.Application.exe
27-10-2014 21:22:29,400 FATAL [ 1] 0:XG.Plugin.AWorker.Start()
System.EntryPointNotFoundException: FlushFileBuffers
  at (wrapper managed-to-native) Sharpen.IO.RandomAccessFile:FlushFileBuffers (Microsoft.Win32.SafeHandles.SafeFileHandle)
  at Sharpen.IO.RandomAccessFile.Sync () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.IO.FileStorage+FileBin.Sync () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.IO.BinDecorator.Sync () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.IO.CachingBin.Sync () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.IO.BinDecorator.Sync () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.IO.BlockAwareBin.Sync () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.IoAdaptedObjectContainer.SyncAndClose (IBin bin) [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.IoAdaptedObjectContainer.CloseDatabaseFile () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.IoAdaptedObjectContainer.ShutdownDataStorage () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.ObjectContainerBase.ShutdownObjectContainer () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.ObjectContainerBase+_IRunnable_129.Run () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Foundation.DynamicVariable.With (System.Object value, IRunnable block) [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Foundation.Environments.RunWith (IEnvironment environment, IRunnable runnable) [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.ObjectContainerBase.WithEnvironment (IRunnable runnable) [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.ObjectContainerBase.Open () [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.IoAdaptedObjectContainer..ctor (IConfiguration config, System.String fileName) [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Internal.ObjectContainerFactory.OpenObjectContainer (IEmbeddedConfiguration config, System.String databaseFileName) [0x00000] in <filename unknown>:0 
  at Db4objects.Db4o.Db4oEmbedded.OpenFile (IEmbeddedConfiguration config, System.String databaseFileName) [0x00000] in <filename unknown>:0 
  at XG.DB.Dao.StartRun () [0x00000] in <filename unknown>:0 
  at XG.Plugin.AWorker.Start (System.String aName, Boolean aNewThread) [0x00000] in <filename unknown>:0 

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at XG.Business.Helper.Objects.CheckAndRemoveDuplicates (XG.Model.Domain.Servers aServers) [0x00000] in <filename unknown>:0 
  at XG.Business.App..ctor () [0x00000] in <filename unknown>:0 
  at XG.Application.Programm.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at XG.Business.Helper.Objects.CheckAndRemoveDuplicates (XG.Model.Domain.Servers aServers) [0x00000] in <filename unknown>:0 
  at XG.Business.App..ctor () [0x00000] in <filename unknown>:0 
  at XG.Application.Programm.Main (System.String[] args) [0x00000] in <filename unknown>:0 

Config files are created correctly:

$ find ~/.config/XG
~/.config/XG
~/.config/XG/xgobjects.db4o
~/.config/XG/xgsnapshots.db
~/.config/XG/dl
~/.config/XG/tmp
~/.config/XG/xg.config

My mono version running on Arch Linux is:

$ mono --version
Mono JIT compiler version 3.10.0 (tarball Mon Oct  6 20:46:04 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen

Any hint to fix this issue?

Looks like the included DB40 version is compiled for windows:
http://opensourcejavaphp.net/csharp/db4o/RandomAccessFile.cs.html

#if !CF && !MONO && !SILVERLIGHT
        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
        static extern int FlushFileBuffers(IntPtr fileHandle);
#endif

Strange that this version works on OSX...

I'll try to get and include a mono compatible db4o version.

Please try this archive: ftp://ftp.versant.com/po/db4o/production/db4o-8.0.276.16149-net40.zip

and replace the following dlls located in db4o-8.0/bin/net-4.0:

  • Db4objects.Db4o.Data.Services.dll
  • Db4objects.Db4o.dll
  • Db4objects.Db4o.Linq.dll
  • Mono.Reflection.dll

I copied those files:

db4o-8.0/bin/net-4.0$ cp Db4objects.Db4o.Data.Services.dll Db4objects.Db4o.dll Db4objects.Db4o.Linq.dll Mono.Reflection.dll ~/opt/xg/

and tried to start afterwards two times. still no success:

~/opt/xg$ rm -r ~/.config/XG
~/opt/xg$ mono XG.Application.exe

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at SharpRobin.Core.RrdDb.close () [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) SharpRobin.Core.RrdDb:close ()
  at SharpRobin.Core.RrdDb.Finalize () [0x00000] in <filename unknown>:0 

~/opt/xg$ mono XG.Application.exe
Error destroying handle 0x438 mutex due to 16

Abgebrochen (Speicherabzug geschrieben)

There are some more dll's in the archive. Maybe I should copy them all?

No, this error is related to SharpRobin. Did you deleted the config folder before every start? Please start XG with a previously generated config folder - SharpRobin may have a problem if there is no correct xgsnapshots.db file.

You are right. It works! Woohoo. I have new errors in the webgui right after start. But this is a new issue 👯
From my point of view this issue can be closed.

This is still an issue in the latest Linux package. Please update it or add a comment in the README.md.

An updated package would be nice. This way I do not need to compile (also because of #74)

any new release ?

ftp://ftp.versant.com/po/db4o/production/db4o-8.0.276.16149-net40.zip is not working anymore and i can't find and any other resource for downloading the needed *.dlls

Versant, the developing company of db4o is now actian and they decided to stop the db4o development and also the distributing of the software as stated here:

db4o
With regret we have to announce that Actian decided not to actively pursue and promote the commercial db4o product offering for new customers any longer.
Since the db4o dual licensing model allows for the free usage of the community edition of db4o for non-commercial purposes, you have the opportunity to continue to use it for your non-commercial applications or even fork it to provide support for the community.
For a limited time, you can find the subversion repository under https://source.db4o.com/db4o and the latest installer packages including the source tarball for Java, .NET35, .NET40

Actian will continue to provide commercial licenses and support for existing customers with active support contract.

If you have any question regarding db4o, please contact us at versant_support@actian.com.

Same problem here ...

i finally get this to work.
downloading the file from official web site (http://supportservices.actian.com/versant/default.html) :
Java : https://www.dropbox.com/s/s6farl3dqez7e1r/db4o-8.0.276.16149-java.zip?dl=0
.NET3.5 : https://www.dropbox.com/s/b2nio97ncnqigvf/db4o-8.0.276.16149-net35.zip?dl=0
.NET4.0 : https://www.dropbox.com/s/9pspycobcj6akxn/db4o-8.0.276.16149-net40.zip?dl=0

i've replace all references, since i'm building this, but you can replace dlls as lformella says to have XG3.3 working.

Can anyone help with where am I supposed to put the files that @MokuJinJin is saying to download? I'm having the same issue with the latest release on Ubuntu 14.04 and not sure what to do.

pnill commented

@imthenachoman I've committed a fix for this on my fork if you're still looking for it.

@PermaNulled Thanks! I will check it out.