Program Crash out when export Gedcom

Aug 27, 2009 at 12:44 AM

Hi,

I worked on family show for one week and when i try to export in Gedcom file, the program crash out. Please can you help me to solve this problem as i entered many information. My OS is windows vista.

Thank you for your help.

Developer
Aug 30, 2009 at 1:08 AM

There could be a few reasons but it's really hard to diagnose what may be causing it without seeing the actual file.

I'm surpirsed that it actually crashes though.  The gedcom export method is called in a try catch statement so if it fails, it should handle the exception with a message saying the export failed rather than a crash.

That may point to some form of corruption in the familyx file.

If you have access to Visual Studio, I suggest running the program and inserting breakpoint on each of the ExportPeople and ExportFamily methods in the Export method in GedcomExport.cs:

 

public void Export(PeopleCollection peopleCollection)
        {
            this.people = peopleCollection;

            using (writer = new StreamWriter(gedcomFilePath))
            {
                WriteLine(0, "HEAD", "");
                ExportPeople();  //<--breakpoint here
                ExportFamilies(); //<--breakpoint here
                WriteLine(0, "TRLR", ""); //<--breakpoint here
            }
        }

 

That will narrow it down to the 2 main areas where the exception is could be occuring.  Once you find which method, keep adding additional break points in that method at key points until you find which bit of code is causing the crash.  Then a solution may be found.

elyoh

 

 

 

Aug 30, 2009 at 5:20 PM

thanks for your answer. I think the file can be corrupted cause export works well with the demo file. Unfortunatly, i'm just an amateur and i dont understand what you suggest me to do. I first imported my file in family show from a Gedcom file with characters like "é" or ï . After import, these characters were deleted in family show so i added them back. Do you think it could corrupt the file and make the program crash?

Developer
Sep 1, 2009 at 6:41 PM
Edited Sep 1, 2009 at 6:42 PM

Hmm I don't think the characters are causing it. If you paste in other extended characters like é or ï it can handle them fine -  it just can't import these from GEDCOM files.  Indeed I tried the same operation with lots of different characters with no problems.

How many people are in your tree?  If it is many thousands, then it could be a performance problem however without access to debug info there is not much more I can do.  If your willing to share the file (either by personal message or on an Issue thread which has an upload funtion) I'll happily try and diagnose the cause.

elyoh

Sep 19, 2009 at 3:07 PM

Hi, sorry i've been away for few weeks. Well my tree count only 91 people (small one for the moment...) but i'm afraid to loose some information that i entered directly in the program during my family meeting. Sorry for my english... If i understand what you told me, you would agree to take my file and try to find the cause? It would be very nice, just tell me how to do that and i will send you my file.

Thanks

Developer
Sep 19, 2009 at 3:49 PM

Yes, I can take a look at the file.

If you send a personal message (load my profile page:  http://www.codeplex.com/site/users/view/elyoh and click "Contact elyoh" ) I can get you to e-mail the file.

Alternatively if you create an Issue Thread ( "Issue Tracker" ) you can upload your file there but it will be online for everyone to access.

elyoh

 

Nov 12, 2009 at 2:27 PM

Hi!

I've the same problem.

Could it be the double link between 2 trees? Same person connecting 2 trees by 2 different family relations? Same person being brother in law and uncle?

Here the copy of the "exception detail" generated when I run the v.3 code on vb2009, (as stand alone it simply crashes).

Bye

Diamantino

================================================================

System.NullReferenceException was unhandled
  Message="A referência de objecto não foi definida como uma instância de um objecto."
  Source="FamilyShowLib"
  StackTrace:
       em Microsoft.FamilyShowLib.Person.Equals(Person other) em K:\Genealogia\V3\FamilyShowVB\FamilyShowLib\Person.vb:line 952
       em Microsoft.FamilyShowLib.Person.GetSpouseRelationship(Person spouse) em K:\Genealogia\V3\FamilyShowVB\FamilyShowLib\Person.vb:line 966
       em Microsoft.FamilyShowLib.FamilyMap.Create(PeopleCollection people) em K:\Genealogia\V3\FamilyShowVB\FamilyShowLib\GedcomExport.vb:line 420
       em Microsoft.FamilyShowLib.GedcomExport.ExportFamilies() em K:\Genealogia\V3\FamilyShowVB\FamilyShowLib\GedcomExport.vb:line 111
       em Microsoft.FamilyShowLib.GedcomExport.Export(PeopleCollection peopleCollection, String gedcomFilePath) em K:\Genealogia\V3\FamilyShowVB\FamilyShowLib\GedcomExport.vb:line 57
       em Microsoft.FamilyShow.MainWindow.ExportGedcom(Object sender, EventArgs e) em K:\Genealogia\V3\FamilyShowVB\FamilyShow\MainWindow.xaml.vb:line 427
       em System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       em System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
       em System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       em System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       em System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       em System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
       em System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
       em System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       em System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       em System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       em System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       em System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       em System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
       em System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
       em System.Windows.Input.CommandManager.TransferEvent(IInputElement newSource, ExecutedRoutedEventArgs e)
       em System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       em System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
       em System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
       em System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       em System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       em System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       em System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       em System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       em System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
       em System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
       em MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
       em System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
       em System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       em System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       em System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       em System.Windows.Threading.DispatcherOperation.InvokeImpl()
       em System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       em System.Threading.ExecutionContext.runTryCode(Object userData)
       em System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       em System.Windows.Threading.DispatcherOperation.Invoke()
       em System.Windows.Threading.Dispatcher.ProcessQueue()
       em System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       em MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       em MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       em System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       em System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       em System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       em System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       em System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       em MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       em MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       em System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       em System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       em System.Windows.Threading.Dispatcher.Run()
       em System.Windows.Application.RunDispatcher(Object ignore)
       em System.Windows.Application.RunInternal(Window window)
       em System.Windows.Application.Run(Window window)
       em System.Windows.Application.Run()
       em Microsoft.FamilyShow.App.Main() em K:\Genealogia\V3\FamilyShowVB\FamilyShow\obj\Debug\Application.g.vb:line 75
       em System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       em System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       em System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       em System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Developer
Nov 13, 2009 at 4:30 PM

I forgot to update this thread when I investigated the problem for galiouje.  It basically occurs when an identical relationship is specified twice e.g. a father son relationship, similar to what you describe.  You cannot see the problem visibly in the program until you try to export a gedcom.  It then creates a null reference issue and crashes.

The way to fix this is by removing the duplicate relationship in the familyx file.  If you have difficulty doing this, contact me (load my profile page:  http://www.codeplex.com/site/users/view/elyoh and click "Contact elyoh" )  and I can take a look at your file as I did for other users.

The source of the problem is a bug in the v3 which sometimes adds a relationship again even when it already existed.

Hope this helps

Nov 13, 2009 at 6:19 PM

Hi!

...eeeeeeh! I do have that situation in fact! My wife has a sister that married a uncle of mine! I could try to wipe out one relation, but don't want to...

The problem is a glitch in a bugged connection, or hapens in any "double" situation?

Diamantino

 

Developer
Nov 13, 2009 at 7:31 PM

It's just a bug in some code which seems to occur sometimes in version 3 and is due to issues in the connecting existing people option of version 3.