6

Resolved

Crash when opening .family in version 3.0

description

Great to see a new version of the Family.Show application. Thanks.
 
Yesterday I tried to open the application from several machines using the ClickOnce approach. When I try to open my version 2.0 .family file with about 280 persons it seems to be executed succesfully, however, no persons are selected as default. When I then try to select a person, the application crashes.
 
I have checked out the source code in order to track down the problems. When I debug through the application the family is loaded succesfully - it seems - but when I select a person the application crashes. The selected persons references to other people are null, that is the collections holding the references are initialized with the correct number of relatives, however the entries are null (see attached screen dump).
 
It is worth noticing that I am on a XP machine SP3. Moreover I am from Denmark where we use the odd characters æ. ø and å. However, also persons without these letters fails to load. I am not too skilled in serializing and deserializing XML, but perhaps the problem is related to this. Not sure.
 
Thanks, Jacob.

file attachments

comments

bbout wrote Mar 17, 2009 at 4:03 AM

I too am having the same problem. Start the app, open the windsor family and click on a name and the app crashes every time. Nice.
I am using XP SP3.

bbout wrote Mar 17, 2009 at 4:42 AM

When I tried to Uninstall this using the AddRemove Programs, it did something but I get this message. What is going on with this app? See image attached.

elyoh wrote Apr 3, 2009 at 2:08 AM

Very strange. Some people are reporting this but I can't replicate the error. I used both the version from the site and the latest compiled version of the source code.

My thought are that a the install has not worked correctly.

Anyways, if it helps, I converted your file to version 3, attached (loadproblemnew.zip) . I also zipped up the compiled source code (3.0.zip). It can be run simply by clicking the FamilyShow.exe direct from where you extract the files.

Hope this helps

elyoh

elyoh wrote Apr 3, 2009 at 2:09 AM

Compiled source.

elyoh wrote Apr 5, 2009 at 2:48 PM

I'm begining to wonder if this may be a bug in the .NET 3.5 SP1 software. MS has a patch for a series of bugs including this one:

"In the .NET Framework 3.5 SP1, because of the changes that are made in checking a NULL value to support address space layout randomization (ASLR), a failure case causes an access violation in the runtime. This access violation manifests as an ExecutionEngineException exception. Additionally, the process is terminated."

I've got a fully patched version of .NET 3.5 SP1 and I can't reporduce any of the issues described in either XP or Vista. Given that I can get it to work, it points to some difference in the installed versions of .NET etc.

.NET Patches and Updates

.NET 3.5 SP1 can be downloaded here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en

.NET patches needed for the above (KB959209). There are 3 patches listed when you click your particular operating system from the link below ( note the specified order of install )
http://support.microsoft.com/kb/959209

Then perhaps run windows update and to make sure everything is else is upto date too.

If you could see about updating things if you haven't already and maybe that will fix it :)

elyoh wrote Apr 9, 2009 at 11:38 PM

I have the solution!! There is a problem, not sure why I couldn't reproduce it before but I looked into it more and worked it out. There is a bug in the method LoadVersion2() which replaces spaces in the full file path instead of just the file name. This only manifests itself in XP because VISTA folders tend not to have spaces e.g.

C:\Documents and Settings\User\Local Settings\Application Data\Family.Show\

is

C:\Users\User\AppData\Local

I think the developers have been testing only on Vista because there are also a number of UI glitches when you use XP.

The null errors people get happens a lot when the file hasn't loaded properly and goes away with the proposed fix below. I tested this in XP SP3 and Vista SP1 and windows 7 beta (build 7000).

Proposed fix:

Replace lines 256 - about 294 in People.cs with:
                   // store the stories into temp directory to be packaged into OPC later
                    foreach (Photo photo in p.Photos)
                    {
                        string photoOldPath = Path.Combine(Path.Combine(
                            Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                            App.ApplicationFolderName), photo.RelativePath);
                            if (File.Exists(photoOldPath))
                        {

                            string photoFileName = Path.GetFileName(photo.FullyQualifiedPath);
                            //only remove spaces from the filename not the whole path
                            photoFileName = ReplaceEncodedCharacters(photoFileName);
                            photo.RelativePath = ReplaceEncodedCharacters(photo.RelativePath);

                            string photoFile = Path.Combine(photoFolder, photoFileName);

                            File.Copy(photoOldPath, photoFile, true);
                        }
                    }

                    // store the person's story into temp directory to be packaged into OPC later
                    if (p.Story != null)
                    {
                        string storyOldPath = Path.Combine(Path.Combine(
                            Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                            App.ApplicationFolderName), p.Story.RelativePath);
                        if (File.Exists(storyOldPath))
                        {

                            string storyFileName = Path.GetFileName(p.Story.AbsolutePath);
                            //only remove spaces from the filename not the whole path
                            storyFileName = ReplaceEncodedCharacters(storyFileName);
                            p.Story.RelativePath = ReplaceEncodedCharacters(p.Story.RelativePath);

                            string storyFile = Path.Combine(storyFolder, storyFileName);

                            File.Copy(storyOldPath, storyFile, true);
                        }
                    }

dhochee wrote May 1, 2011 at 7:20 PM

@elyoh: Thanks! Really appreciate the fix. Now I can actually debug on my old XP PC. :)