http://bugs.winehq.org/show_bug.cgi?id=31237
Bug #: 31237 Summary: libfaketime: integrate with libfaketime to allow running a program with a fake time Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: alister.hood@gmail.com Classification: Unclassified
Like Wine, faketime is another lib/application that is useful for running legacy programs, for example those which can no longer run because of the "millenium bug". It lets you present a fake system time to a program.
It would be nice if the functionality of libfaketime could be integrated with Wine.
The faketime executable and Wine do not cooperate well. Some programs such as winecfg and notepad work well, but when you try to run other programs (e.g. Excel 2007 which was one I tried) they crash, and then any subsequent programs you try to run also crash, even programs which worked fine before running Excel or whatever the problem program was:
# faketime '2006-09-20' winecfg wine: Unhandled page fault on read access to 0x00000000 at address (nil) (thread 001d), starting debugger...
Some Wine programs do actually run fine apart from outputting this error, but others crash properly.
I reported this to the faketime developer, and this was his reply:
Basically, libfaketime has clear limitations when it comes to programs that spawn child processes due to the LD_PRELOAD design. Wine probably starts a lot of sub-programs, and since only the parent process is tricked into seeing the faked time, but the spawned child processes get access to the real wall clock time, this inconsistency might lead to this page fault crash.
As of today, we have undertaken several steps to make libfaketime capable of supporting spawned child processes (at least on Linux), but we're not quite there yet. Some problems we ran into so far are still K.O. criteria, so I can't promise any delivery date right now.
However, libfaketime can be integrated into other programs quite easily, so if the Wine developers would use it in their Wine source, faking the time for any Wine-executed program would be quite trivial and without all those sub-process hassles. However, I don't know whether the Wine guys would be interested in such an option
So, are "the Wine guys" interesting in integrating libfaketime with Wine?
FYI here's a link: http://www.code-wizards.com/projects/libfaketime/index.html
http://bugs.winehq.org/show_bug.cgi?id=31237
alister.hood@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|libfaketime: integrate with |libfaketime: integrate with |libfaketime to allow |libfaketime to allow |running a program with a |running a program with a |fake time |fake system time
http://bugs.winehq.org/show_bug.cgi?id=31237
--- Comment #1 from Alexandre Julliard julliard@winehq.org 2012-07-18 05:17:39 CDT --- To do it right you'd need to ensure that all processes running under the same wineserver see the same time, so even tracking child processes wouldn't be sufficient. It would need a convincing use case to be worth the effort.
http://bugs.winehq.org/show_bug.cgi?id=31237
--- Comment #2 from Austin English austinenglish@gmail.com 2012-07-18 13:54:53 CDT --- You could use RunAsDate: http://www.nirsoft.net/utils/run_as_date.html
works in wine, since 1.3.30: http://bugs.winehq.org/show_bug.cgi?id=19975
http://bugs.winehq.org/show_bug.cgi?id=31237
--- Comment #3 from alister.hood@gmail.com 2012-07-18 20:18:04 CDT --- (In reply to comment #1)
To do it right you'd need to ensure that all processes running under the same wineserver see the same time, so even tracking child processes wouldn't be sufficient. It would need a convincing use case to be worth the effort.
So that sounds like you would be open to patches, anyway. Is that right?
Is there any guidance on what might make a "convincing use case"? There are a lot of use cases, but they do tend to be pretty niche. Another example is for testing a program e.g. to see if it handles expired certificates correctly, or if it works correctly on a leap day.
BTW I've just been reminded that as well as faketime, there is an alternative called datefudge, although last I heard it was missing some of the functionality of datetime. I'll need to test the datefudge executable with Wine on the weekend, but I imagine it will have similar issues.
(In reply to comment #2)
You could use RunAsDate: http://www.nirsoft.net/utils/run_as_date.html
works in wine, since 1.3.30: http://bugs.winehq.org/show_bug.cgi?id=19975
There are cases where RunAsDate doesn't work, and I suspect that a faketime implementation in Wine would not have the same limitations (But I don't really know how Wine works, so I can't say for sure).
http://bugs.winehq.org/show_bug.cgi?id=31237
--- Comment #4 from Alexandre Julliard julliard@winehq.org 2012-07-19 05:15:09 CDT --- (In reply to comment #3)
(In reply to comment #1)
To do it right you'd need to ensure that all processes running under the same wineserver see the same time, so even tracking child processes wouldn't be sufficient. It would need a convincing use case to be worth the effort.
So that sounds like you would be open to patches, anyway. Is that right?
Is there any guidance on what might make a "convincing use case"? There are a lot of use cases, but they do tend to be pretty niche. Another example is for testing a program e.g. to see if it handles expired certificates correctly, or if it works correctly on a leap day.
That sort of niche use case can be handled by maintaining a separate patch that you apply for testing. I wouldn't consider it important enough to justify adding the feature to the main code base.
http://bugs.winehq.org/show_bug.cgi?id=31237
--- Comment #5 from alister.hood@gmail.com 2012-07-20 06:40:41 CDT --- OK, thanks for the replies.
For the record, the same problem does occur using wine with the datefudge executable as occurs with the faketime executable.
http://bugs.winehq.org/show_bug.cgi?id=31237
Erinn Clark erinn@torproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |erinn@torproject.org
--- Comment #6 from Erinn Clark erinn@torproject.org 2013-11-28 19:25:18 CST --- Hi there!
I think I may have a convincing use case for adding this feature. I work for the Tor Project and we've recently been doing a lot of work on making our builds deterministic[1][2]. Currently we're trying to use Wine for some Python stuff but we can't get libfaketime to work with it, no matter what kinds of wrappers we write or what kind of LD_PRELOAD magic we invoke. (If you want some more background on this, there is a long comment here, just look for libfaketime: https://trac.torproject.org/projects/tor/ticket/9444#comment:20)
Is there anything we can do to help make this happen?
[1] https://blog.torproject.org/blog/deterministic-builds-part-one-cyberwar-and-... [2] https://blog.torproject.org/blog/deterministic-builds-part-two-technical-det...
http://bugs.winehq.org/show_bug.cgi?id=31237
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source CC| |austinenglish@gmail.com Version|unspecified |1.6