I try to build mono on FreeBSD-current (it is a dependency of some GNOME program). Unfortunately this does not work correctly.
What I see are hangs of the build. If I stop the build when it hangs and restart it, it will continue and succeed to process the build steps a little bit further, but then it hangs again.
If I ktrace the hanging process, I see that there is a call to wait returning with the error message that the child does not exist. Then there is a call to nanosleep.
It looks to me like this process missed some SIGCLD (or is waiting for something which did not exist at all), and a loop is waiting for a child to exit. This loop probably has no proper condition for the fact that there is no such child (anymore). As such it will stay forever in this loop.
So I grepped a litte bit around in mono and found the following code in <mono-src-dir>/mcs/class/Mono.Posix/Mono.Unix/UnixProcess.cs:
public void WaitForExit ()
{
int status;
int r;
do {
r = Native.Syscall.waitpid (pid, out status, (Native.WaitOptions) 0);
} while (UnixMarshal.ShouldRetrySyscall (r));
UnixMarshal.ThrowExceptionForLastErrorIf (r);
}
This does look a little bit as it could be related to the problem I see, but ShouldRetrySyscall only returns true if the errno is EINTR. So this looks correct.
I looked a little bit more at this file and it looks like either I do not understand the semantic of this language, or GetProcessStatus does return the returnvalue of the waitpid call instead of the status (which is not what it shall return to my understanding). If I am correct, it can not really detect the status of a process. It would be very bad if such a fundamental thing went unnoticed in mono… which does not put a good light on the unit-tests (if any) or the general testing of mono. For this reason I hope I am wrong.
I did not stop there, as this part does not look like it is the problem. I found the following in mono/io-layer/processes.c:
static gboolean waitfor_pid (gpointer test, gpointer user_data)
{
...
do {
ret = waitpid (process->id, &status, WNOHANG);
} while (errno == EINTR);
if (ret <= 0) {
/* Process not ready for wait */
#ifdef DEBUG
g_message ("%s: Process %d not ready for waiting for: %s",
__func__, process->id, g_strerror (errno));
#endif
return (FALSE);
}
#ifdef DEBUG
g_message ("%s: Process %d finished", __func__, ret);
#endif
process->waited = TRUE;
...
}
And here we have the problem, I think. I changed the (ret <= 0) to (ret == 0 || (ret < 0 && errno != ECHILD)). This will not really give the correct status, but at least it should not block anymore and I should be able to see the difference during the build.
And now after testing, I see a difference, but the problem is still there. The wait with ECHILD is gone in the loop, but there is still some loop with a semaphore operation:
62960 mono CALL clock_gettime(0xd,0xbf9feef8)
62960 mono RET clock_gettime 0
62960 mono CALL semop(0x20c0000,0xbf9feef6,0x1)
62960 mono RET semop 0
62960 mono CALL semop(0x20c0000,0xbf9feef6,0x1)
62960 mono RET semop 0
62960 mono CALL semop(0x20c0000,0xbf9feef6,0x1)
62960 mono RET semop 0
62960 mono CALL semop(0x20c0000,0xbf9feef6,0x1)
62960 mono RET semop 0
62960 mono CALL nanosleep(0xbf9fef84,0)
62960 mono RET nanosleep 0
62960 mono CALL clock_gettime(0xd,0xbf9feef8)
62960 mono RET clock_gettime 0
62960 mono CALL semop(0x20c0000,0xbf9feef6,0x1)
62960 mono RET semop 0
62960 mono CALL semop(0x20c0000,0xbf9feef6,0x1)
62960 mono RET semop 0
62960 mono CALL semop(0x20c0000,0xbf9feef6,0x1)
62960 mono RET semop 0
62960 mono CALL semop(0x20c0000,0xbf9feef6,0x1)
62960 mono RET semop 0
62960 mono CALL nanosleep(0xbf9fef84,0)
OK, there is more going on. I think someone with more knowledge about mono should have a look at this (do not only look at this semop thing, but also look why it loses a child).
GD Star Rating
loading…
GD Star Rating
loading…
Tags: error message,
fundamental thing,
gnome program,
little bit,
pid,
posix,
public void,
returnvalue,
syscall,
unit tests —
I experimented a little bit with the order of directories to backup in tarsnap.
Currently I use the following sorting algorithm:
- least frequently changed directory-trees first
Every change — even in meta-data — will affect the following data, as tarsnap is doing the de-duplication in fixed-width blocks (AFAIR 64k).
- for those directory-trees which change with the same frequency: list the bigger ones first
Implicitly I assume that the smaller ones are much smaller than the bigger ones so that the smaller part which will be backed up will not be noticed because of the bigger change. For my use cases of tarsnap this is true.
- if changes in a directory-tree are much much bigger than anything else, but the directory-tree has a medium change-frequency, put it even before less-frequently changing stuff
I do not want that a small change triggers a big backup, but a big backup can contain the remaining small part.
- if you backup home directories (even root’s one) and they do not contain much data, put them before directory-trees which change a lot daily
I do not want that a login triggers the transfer of data in other directory-trees which have not changed.
GD Star Rating
loading…
GD Star Rating
loading…
Tags: change frequency,
directory tree,
directory trees,
frequency list,
home directories,
little bit,
meta data,
sorting algorithm —
Unfortunately you can not chose…
So, I am now on the sofa, covered a lot (a flu, I even have no voice anymore; before I left work a female coworker told that her husband would probably be happy if this would happen to her…
) and medication and water are not far away on the table.
The good thing with the current technology is, that you can still be a little bit productive (depending on the illness).
As you can read this, it means I have my netbook with me, so that I can take care about some simple things.
GD Star Rating
loading…
GD Star Rating
loading…
Tags: current technology,
female coworker,
flu,
little bit,
lot,
medication,
netbook,
sofa —
I am in the process of preparing the import of code which makes v4l devices usable in the linuxulator. Basically this means you can use your webcam in skype (tested by the submitter of the patch on amd64).
This is not a “apply patch and commit” thing, because the original videodev.h (with some modifications) is used. I was seeking the OK from core@ for this. As there is no license in the header, and the original author (Alan Cox, the linux one, not our FreeBSD one) gave permissions to use it, core@ is OK with the import.
I intent to do a vendor import of the linux header (prepared today, together with some readme which explains where it comes from and some stuff to show that we are on the safe side regarding legal stuff), and then I want to copy this over to the linuxulator as linux_videodev.h and commit the patch (probably a little bit modified in a few places). My plan is to commit it this week. People which already want to play around with it now can have a look at the emulation mailinglist, a link to the patch is posted there.
With the header being in a vendor branch, interested people could then start to submit new BSD licensed drivers or modify existing drivers which make use of the v4l interface, but I let the import of the header into the FreeBSD include directory up to the person which wants to commit the first native FreeBSD-v4l support.
When such native FreeBSD-v4l support is committed, the linuxulator code needs to be revised.
GD Star Rating
loading…
GD Star Rating
loading…
Tags: alan cox,
amd64,
licensed drivers,
little bit,
readme,
safe side,
skype,
submitter,
v4l,
vendor branch —
A lot of people do not do backups at home. Unfortunately this includes me. So far I was lucky that nothing bad happened (or that I was able to get back all via manipulating on-disk-data by hand). For me this is mostly because of the price and complexity (number of backup media involved) for local backups. It also means that I only need a backup for the case of a disk-crash, not because I need to recover a file because I accidently deleted it (yes, I am very good at not loosing data at home… maybe this is also the reason why I have so much data).
I have about 1 TB of raw disk space at home (two times raidz1). Not all of this needs a backup (or is used at all), for example the base system files, /usr/local, the ports distfiles and packages all do not need a backup, but my camera fotos (currently 8 GB) should be included in a backup, my home should be included in a backup, my local staging area for the content of my webserver should be included in a backup, my mails (currently 800 MB) should be included in the backup, local patches to FreeBSD should be included in the backup, …
So let us calculate with about 200 GB of more (mails, fotos, private videos) or less (MP3s from my own CDs) important data for a full backup. Most of it will not change often (MP3s, private videos, fotos), so once a month should be ok, and some (e.g. my mails) change daily, so an incremental each day and a full once a week would be interesting for me. When I do such a backup, I do not want to shuffle around tapes a lot. Maybe one or two times (s0 2 – 3 tapes) would be ok. So I am talking about 80 – 200 GB per tape. The prices for this range from 700 EUR to 1300 EUR just for the tape drive. I have also seen a tape drive from Iomega for about 400 EUR (120 GB per tape), but somehow this sounds like a not so trustworty solution to me (I do not know why, it is just a feeling, maybe I am a little bit biased because of the high-end solution at work, if someone knows more about those Iomega drives and tapes in a long term or high-useage environment, please write a comment).
When I take the current price of tarsnap into account, I come to about $60 per month for the storage, and again $60 for the initial transfer of 200 GB. This assumes the 200 GB are not very compressable. With each incremental backup (changed files matter, not a diff between the files), I assume about 10 GB per month of change (= $3 per month). Yes, this is most probably too much, but I try to calculate a worst case scenario. So this sums up to $60 once and $63 per month. I do not take into account my too slow upstream bandwith. When I assume a 1500 EUR tape drive plus tapes plus cleaning cartridge, we are talking about something like 2 – 3 years of storing the backup in tarsnap (with the Iomega drive this would be just one year).
When I assume that I overestimated everything with a factor of 2, this means 5 – 6 years of using tarsnap vs. buying an expensive tape drive. Now the question is, will the tape drive survive this long, will I be able to use such a drive in new hardware in 6 years, will tarsnap survive this long, and will it stay at the same or better price level (this is also influenced by the price of the storage provider).
Another solution would be to go with a mixed setting, e.g. an 1 TB hard-disk (less than 150 EUR for the hard-disk (with 7 years warranty) and an external case) to do the long term storage of high-volume but long-term-stable stuff (fotos, videos, music), and use tarsnap for the low-volume fast changing stuff (config files, mails). This way the amount of money for the really important things is not much, I would expect less than 1 GB compressed (= less than an EUR per month). This also sounds like a solution which allows me to be lazy (the important stuff can be automated, the nice to have stuff can be done from time to time as needed).
I think I should ask Collin if he has a way to receive SWIFT (IBAN/BIC) transfers for tarsnap…
GD Star Rating
loading…
GD Star Rating
loading…
Tags: backup media,
complexity,
disk crash,
disk space,
iomega,
little bit,
mp3s,
raw disk,
staging area,
tape drive —