http://bugs.winehq.org/show_bug.cgi?id=35344
Bug ID: 35344 Summary: Cygwin's post-install scripts fail on fork errors Product: Wine Version: 1.7.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: mail@georg.so Classification: Unclassified
Executing 'wine setup-x86.exe' seems to work quite well (you can step through the wizard, packages are downloaded and extracted) until the post-installation bash scripts are executed.
Then I get for each script a message like:
running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/glib2.0.sh" [..] fixme:ntdll:NtQueryInformationProcess (process=0xffffffff) Unimplemented information class: ProcessSessionInformation [..] fixme:ntdll:NtQueryVolumeInformationFile 0xf0: faking attribute info fixme:ntdll:NtQueryVolumeInformationFile 0xec: faking attribute info fixme:ntdll:NtQueryInformationFile Unsupported class (34) [..] fixme:ntdll:NtQueryVolumeInformationFile 0xf4: faking attribute info fixme:ntdll:NtQueryInformationFile Unsupported class (8) [..] fixme:ntdll:NtQueryVolumeInformationFile 0xfc: faking attribute info [..] fixme:ntdll:NtQueryVolumeInformationFile 0x100: faking attribute info fixme:ntdll:NtQueryVolumeInformationFile 0x124: faking attribute info [..] fixme:ntdll:NtQueryVolumeInformationFile 0x128: faking attribute info [..] /etc/postinstall/glib2.0.sh: fork: retry: Resource temporarily unavailable /etc/postinstall/glib2.0.sh: fork: retry: Resource temporarily unavailable /etc/postinstall/glib2.0.sh: fork: retry: Resource temporarily unavailable /etc/postinstall/glib2.0.sh: fork: retry: Resource temporarily unavailable /etc/postinstall/glib2.0.sh: fork: Resource temporarily unavailable
abnormal exit: exit code=254
The fork error message are always displayed after some kind of timeout.
Where to get the setup-x86.exe:
http://cygwin.com/setup-x86.exe
$ md5sum setup-x86.exe c9818d3500e42fd9eb755d424450871a setup-x86.exe
Executing Cygwin's setup exe inside wine looks a little bit silly, but I want to create a reference cygwin installation for deployment purposes.
see also: http://wiki.winehq.org/CygwinSupport
https://bugs.winehq.org/show_bug.cgi?id=35344
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=35344
--- Comment #1 from Qian Hong fracting@gmail.com --- Hi Georg, I think this bug is related to WRITECOPY, could you try the wine-staging write copy patch?
https://github.com/wine-compholio/wine-staging/tree/master/patches/ntdll-WRI...
To enable the WRITECOPY feature, one should set environment variable STAGING_WRITECOPY=1 before start.
Thanks!
https://bugs.winehq.org/show_bug.cgi?id=35344
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |michael@fds-team.de, | |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=35344
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #2 from super_man@post.com --- I didnt try the patches, but with pure wine it's the same state as before.
fixme:netapi32:NetLocalGroupGetInfo ((null) L"Users" 1 0x6cc308) semi-stub! wine: Unhandled page fault on read access to 0x00000000 at address 0x61183585 (thread 0046), starting debugger... err:dbghelp_msc:pe_load_debug_directory Got a page fault while loading symbols err:dbghelp_msc:pe_load_debug_directory Got a page fault while loading symbols error: Unable to remove temporary file '/var/log/setup.log.runXa00008' abnormal exit: exit code=-1073741819 running: C:\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/update-info-dir.sh" fixme:ntdll:NtSetInformationToken unimplemented class 4 fixme:ntdll:NtQueryInformationProcess (process=0xffffffff) Unimplemented information class: ProcessSessionInformation fixme:advapi:LsaOpenPolicy ((null),0x612b2044,0x00000001,0x6cc344) stub
It gets few crashes while running the postinstall script(s).
https://bugs.winehq.org/show_bug.cgi?id=35344
--- Comment #3 from super_man@post.com --- forgot wine version 1.7.53
https://bugs.winehq.org/show_bug.cgi?id=35344
--- Comment #4 from super_man@post.com --- The sha1sum has already chaged.
e8778fbd16f6d95b7abb0c93d31e8abb4d24d943
But it fails at the install procedure.
It just doesnt seem to go forward.
wine 1.9.12-git.
https://bugs.winehq.org/show_bug.cgi?id=35344
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |damjan.jov@gmail.com Ever confirmed|0 |1
--- Comment #5 from Damjan Jovanovic damjan.jov@gmail.com --- Confirming. Still happens with Wine 4.13 and cygwin-3_0-branch compiled from its Git.
https://bugs.winehq.org/show_bug.cgi?id=35344
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Cygwin's post-install |Cygwin's fork() always |scripts fail on fork errors |fails (from post-install | |scripts onwards)
https://bugs.winehq.org/show_bug.cgi?id=35344
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source Component|-unknown |wineserver
--- Comment #6 from Damjan Jovanovic damjan.jov@gmail.com --- Luckily it's an open-source Windows API app, ie. our dogfood, so we can see what's going on easily.
We know fork() fails. In Cygwin's source code, the chain of events looks as follows: 1) fork() in winsup/cygwin/sigproc.h calls dofork(). 2) dofork() then tries to construct a local hold_everything of type hold_everything. 3) This class hold_everything in winsup/cygwin/sigproc.h has a field lock_signals signals which will be initialized by its constructor. 4) This constructor for lock_signals (same file) does: worked = sig_send (NULL, __SIGHOLD) == 0 5) That sig_send() in winsup/cygwin/sigproc.cc writes to HANDLE sendsig, which is the global static HANDLE my_sendsig in this particular call, then tries to WaitForSingleObject (pack.wakeup, WSSC) where WSSC is 60000 (which explains why fork() takes extremely long to fail). This however fails with WAIT_TIMEOUT so sig_send() sets errno=ENOSYS and returns with -1.
Why does writing to my_sendsig not generate a response on pack.wakeup in due time? 1. During Cygwin startup, dll_crt0_0() in winsup/cygwin/dcrt0.cc calls sigproc_init(), as does dll_crt0_1() if dynamically_loaded is true. 2. sigproc_init() in winsup/cygwin/sigproc.cc calls: new cygthread (wait_sig, cygself, "sig"); 3. wait_sig() in winsup/cygwin/sigproc.cc is meant to signal pack.wakeup.
But 3 never happens, that is, the new cygthread(...) does not result in the thread getting created and the wait_sig() function getting called to signal the fork() thread. Why not?
cygthread (LPVOID_THREAD_START_ROUTINE start, LPVOID param, const char *name) : __name (name), func ((LPTHREAD_START_ROUTINE) start), arglen (0), arg (param), notify_detached (NULL) { QueueUserAPC (async_create, GetCurrentThread (), (ULONG_PTR) this); //create(); }
If QueueUserAPC() is commented and create() uncommented, the thread starts and another failure happens later on, but for now let's debug QueueUserAPC().
async_create() definitely doesn't get called, so the failure is between QueueUserAPC() and the callback it is given. This looks like a Wine bug.
In Wine: 1. kernel32.dll QueueUserAPC() 2. ntdll.dll NtQueueApcThread() 3. wineserver DECL_HANDLER(queue_apc) 4. wineserver queue_apc()
Since the first 2 are trivial, let's focus on wineserver. queue_apc() calls get_apc_queue() to retrieve &thread->user_apc, then adds the APC to the queue, and since it's the first in the queue, calls wake_thread( thread ).
wake_thread() returns 0, meaning the wait condition is still not satisfied. It's not clear whether this a problem though.
Next, the APC must come out of wineserver and return to the application so it can be run and the thread created. How would that happen?
---
Setting the component to "wineserver" for now, until I investigate the APC's return trip.
Is there anyone more familiar with APCs that can help?
https://bugs.winehq.org/show_bug.cgi?id=35344
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #7 from Zebediah Figura z.figura12@gmail.com --- It's bug 24018, and also bug 34865. I'm not sure why both of those were closed as NOTOURBUG; there is a demonstrable Wine bug here.
https://bugs.winehq.org/show_bug.cgi?id=35344
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|wineserver |ntdll
--- Comment #8 from Damjan Jovanovic damjan.jov@gmail.com --- (In reply to Zebediah Figura from comment #7)
It's bug 24018, and also bug 34865. I'm not sure why both of those were closed as NOTOURBUG; there is a demonstrable Wine bug here.
Thank you, excellent find!
That patch from 24018 doesn't apply any more, LdrInitializeThunk() has changed too much and my attempts to patch it anew only got Wine to crash on startup. I'll patch Cygwin as previously described instead, and continue.
This seems to be of a ntdll bug then, changing component.
https://bugs.winehq.org/show_bug.cgi?id=35344
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|NEW |RESOLVED
--- Comment #9 from Zebediah Figura z.figura12@gmail.com --- Resolving duplicate.
*** This bug has been marked as a duplicate of bug 35561 ***
https://bugs.winehq.org/show_bug.cgi?id=35344
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing Duplicate.