http://bugs.winehq.org/show_bug.cgi?id=21896
Summary: sigaltstack: invalid argument Product: Wine Version: 1.1.39 Platform: x86 URL: http://translate.google.com/translate?hl=en&sl=ja&u=ht tp://quasiquote.org/log2/Erlang&ei=BS2LS5GIHoOulwerrIH PAQ&sa=X&oi=translate&ct=result&resnum=3&ved=0CA4Q7gEw Ag&prev=/search%3Fq%3D%2522sigaltstack%2Binvalid%2Barg ument%2522%26hl%3Den%26client%3Dfirefox-a%26hs%3DPib%2 6rls%3Dcom.ubuntu:en-US:official OS/Version: OpenBSD Status: NEW Keywords: download, source Severity: enhancement Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: austinenglish@gmail.com
When running wine on OpenBSD, you see sigaltstack: Invalid argument
several times. It seems to be related to pthread, see: http://quasiquote.org/log2/Erlang
google translated: http://translate.google.com/translate?hl=en&sl=ja&u=http://quasiquot...
http://bugs.winehq.org/show_bug.cgi?id=21896
Matias Colli matiasbsd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matiasbsd@gmail.com
--- Comment #1 from Matias Colli matiasbsd@gmail.com 2012-05-02 20:35:34 CDT --- I'm looking in the wine source code. I found that "sigaltstack: invalid argument" happens if the call to sigaltstack() fails. So I searched for why sigaltstack() fails. I found the answer in the source code of the OpenBSD pthreads library.
OpenBSD does not have kernel threads. The OpenBSD pthreads library implements threads in userspace. (OpenBSD is the only operating system, that I know, where pthreads are not kernel threads. They say that Wine 1.1.19 uses kernel threads, but this is not true for OpenBSD!) The OpenBSD pthreads library does override multiple libc functions, including sigaltstack().
Here is the comment in OpenBSD src/lib/libpthread/uthread/uthread_sigaltstack.c
<pre> /* * IEEE Std 1003.1-2001 says: * * "Use of this function by library threads that are not bound to * kernel-scheduled entities results in undefined behavior." * * There exists code (e.g. alpha setjmp) that uses this function * to get information about the current stack. * * The "undefined behaviour" in this implementation is thus: * o if ss is *not* null return -1 with errno set to EINVAL * o if oss is *not* null fill it in with information about the * current stack and return 0. * * This lets things like alpha setjmp work in threaded applications. */
int sigaltstack(const struct sigaltstack *ss, struct sigaltstack *oss) { struct pthread *curthread = _get_curthread();
int ret = 0; if (ss != NULL) { errno = EINVAL; ret = -1; } else ... </pre>
So the OpenBSD pthreads library does not allow a separate signal stack. Whenever you give a signal stack to sigaltstack(), it always returns EINVAL.
Remove sigalstack option in configure and configure.ac files: configure: sigaltstack \ configure.ac: sigaltstack \
So I comment the sigalstack funtion in signal_i386.c file to ignore this error: dlls/ntdll/signal_i386.c: //if (sigaltstack(&ss, NULL) == -1) perror( "sigaltstack" );
Regards, Matias Colli UNIX SysAdmin
http://bugs.winehq.org/show_bug.cgi?id=21896
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |UPSTREAM
--- Comment #2 from Alexandre Julliard julliard@winehq.org 2012-05-03 02:56:28 CDT --- (In reply to comment #1)
OpenBSD does not have kernel threads. The OpenBSD pthreads library implements threads in userspace. (OpenBSD is the only operating system, that I know, where pthreads are not kernel threads. They say that Wine 1.1.19 uses kernel threads, but this is not true for OpenBSD!) The OpenBSD pthreads library does override multiple libc functions, including sigaltstack().
Wine requires kernel threads. This will have to be addressed in OpenBSD.
http://bugs.winehq.org/show_bug.cgi?id=21896
--- Comment #3 from Matias Colli matiasbsd@gmail.com 2012-05-03 07:10:21 CDT --- OpenBSD has an inferior implementation of pthreads(3).
OpenBSD, like other systems that resemble Unix, provides the pthreads interface for multithreaded programming, which allows one process to run multiple threads at the same time, while the threads share the memory and the open files. The other systems provide kernel threads through pthreads. OpenBSD still provides pthreads through a user-mode library, with no kernel support; so threads above OpenBSD have problems or limitations. The most obvious limitation is that the OpenBSD pthreads library confines all threads of a process to one processor. Another limitation, which seems arbitrary, is that programs using OpenBSD pthreads cannot use sigaltstack(2).
https://bugs.winehq.org/show_bug.cgi?id=21896
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=21896
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |RESOLVED
--- Comment #5 from Austin English austinenglish@gmail.com --- This was inadvertently caught up in my unclosed bugs filter. NOTOURBUG should only be closed when fixed upstream.
Setting back to RESOLVED NOTOURBUG.
Sorry for the spam.