Structure 2.3.4: Multiuser bug

Pritchard Lab, Stanford University


Structure v.2.3.4 10/1014

  • Structure crashes 'silently'; this is associated with running multiple threads or on multi-user computers.

    Many thanks to Tony Travis for this bug report, description and patch!

    The problem is that "structure" attempts to create or overwrite a file called "seed.txt" in the current directory of the environment where it is running. That is normally not a problem if the user has write access to the directory. However, when "structure" is installed centrally on a multi-user computer attempting to open "seed.txt" in a directory that is read-only to a user causes "structure" to segfault and crash. This is a particular problem with programs like "Structure-GUI" and ParallelStructure which may execute "structure" in a read-only directory and do not report that it crashed! The user is unaware that "structure" has crashed and, in that respect, "structure" crashes silently, but in fact the problem is the other programs not reporting that it crashed.

    My work-around is to make "structure" create or overwrite "seed.txt" in the users $HOME directory instead. This might also be problematic if a user is running multiple instances of "structure" concurrently as with "ParallelStructure". We've had some unexplained crashes that might be caused by two instances of "structure" attempting to open the file for writes at the same time. I think it might be better to create the files in /tmp identified by PID as I did originally but I don't know if it is OK to delete this file on exit - I would just remove the code that creates or opens the file and print the seed to STDOUT with other info.

    Under Linux/Unix just use:

    patch ran.c < ran.c.patch

    I generated the patch using:

    diff -Naur ran.c.orig ran.c > ran.c.patch

    Download patch.c

    where "ran.c.orig" is the file you distribute and "ran.c" is my version.