New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socket on fd 1 gets duped to fd 0 on close(STDIN)+close(STDOUT) #7595
Comments
From Steffen_Ullrich@genua.deCreated by steffen@genua.de- create a socket Example program follows, including output from ktrace/kdump Example works a openbsd3.6/perl5.8.5. I can't reproduce the 1 use strict; duplicate socket to STDIN,STDOUT and close socket fd 9 open( STDIN,"<&".fileno($cl)); 19 __TRACE__(4); closing STDIN gives the following kdump | 22650 perl CALL close(0) 21 __TRACE__(5); closing STDOUT shows it duplicating fd 1 to fd 0 | 22650 perl CALL dup(0x1) 23 __TRACE__(6); Perl Info
|
From coyote.frank@gmx.netThis is a patch which resolves the problem for OpenBSD by using the So this fix should fix the problem for OpenBSD, but not for the other |
From coyote.frank@gmx.netperlbug-32446.patch--- /usr/src/gnu/usr.bin/perl/perlio.c Mon Aug 9 20:08:55 2004
+++ perlio.c Wed Dec 1 14:22:48 2004
@@ -2875,6 +2875,13 @@
*/
f->_file = -1;
return 1;
+# elif defined(__OpenBSD__)
+ /* There may be a better way on OpenBSD:
+ - we could insert a dummy func in the _close function entry
+ f->_close = (int (*)(void *)) dummy_close;
+ */
+ f->_file = -1;
+ return 1;
# elif defined(__EMX__)
/* f->_flags &= ~_IOOPEN; */ /* Will leak stream->_buffer */
f->_handle = -1;
|
From coyote.frank@gmx.netperl #32446 describes a bug with perl5.8 on OpenBSD, where a STDOUT gets Details: |
The RT System itself - Status changed from 'new' to 'open' |
From coyote.frank@gmx.netfor whatever reason the second message with the patch included did not Inline Patch--- perlio.c.orig Mon Aug 9 20:08:55 2004
+++ perlio.c Wed Dec 1 14:22:48 2004
@@ -2875,6 +2875,13 @@
*/
f->_file = -1;
return 1;
+# elif defined(__OpenBSD__)
+ /* There may be a better way on OpenBSD:
+ - we could insert a dummy func in the _close function entry
+ f->_close = (int (*)(void *)) dummy_close;
+ */
+ f->_file = -1;
+ return 1;
# elif defined(__EMX__)
/* f->_flags &= ~_IOOPEN; */ /* Will leak stream->_buffer */
f->_handle = -1;
|
From coyote.frank@gmx.netooops, forgot to attach the patch |
From coyote.frank@gmx.netperlbug-32446.patch--- /usr/src/gnu/usr.bin/perl/perlio.c Mon Aug 9 20:08:55 2004
+++ perlio.c Wed Dec 1 14:22:48 2004
@@ -2875,6 +2875,13 @@
*/
f->_file = -1;
return 1;
+# elif defined(__OpenBSD__)
+ /* There may be a better way on OpenBSD:
+ - we could insert a dummy func in the _close function entry
+ f->_close = (int (*)(void *)) dummy_close;
+ */
+ f->_file = -1;
+ return 1;
# elif defined(__EMX__)
/* f->_flags &= ~_IOOPEN; */ /* Will leak stream->_buffer */
f->_handle = -1;
|
From @rgsSteffen Ullrich wrote:
Thanks, your patch applied as change #23844 to bleadperl. |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#32446 (status was 'resolved')
Searchable as RT32446$
The text was updated successfully, but these errors were encountered: