Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6900 closed defect (fixed)

perl select implementation does not work as expected

Reported by: kilmarnock@… Owned by: developers
Priority: normal Milestone: Backfire 10.03.1
Component: packages Version: Kamikaze trunk
Keywords: Cc:

Description

I am trying to get fhem to work on openwrt. It depends on the select implementation. I attach a test where nfound is supposed to return "1":

my $nfound = select($rin, undef, undef, $to);
print("nfound: $nfound\n");

but it prints out "0". I doublechecked the bug with the author of fhem who is certainly a better perl programmer than I am.

If I can be of any help, feel free to ask.

Felix

Attachments (3)

test.pl (1.7 KB) - added by kilmarnock@… 7 years ago.
tests the select statement for a IO:INET:Socket
strace_out.txt (32.6 KB) - added by kilmarnock@… 7 years ago.
strace for the testrun (strace -o file perl test.pl)
testrun_out.txt (105 bytes) - added by anonymous 7 years ago.
the testrun stdout output for perl test.pl

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by kilmarnock@…

tests the select statement for a IO:INET:Socket

Changed 7 years ago by kilmarnock@…

strace for the testrun (strace -o file perl test.pl)

Changed 7 years ago by anonymous

the testrun stdout output for perl test.pl

comment:1 Changed 7 years ago by anonymous

The mighty irc revealed:
<anonymized> you can add this debug befire the select: printf("vector = %s\n", unpack "b*", $rin)
<anonymized> should return something like 00010000
<perlbug> perl test.pl vector = 00010000 nfound: 0
<anonymized> hmm, yeah, looks like the bitmap get list somewhere between vec() and system()
<anonymized> in strace you see: _newselect(8, [], NULL, NULL, {3, 0})   = 0 (Timeout) which means it probes fds up to 8 from the specified set, but the first set ($rin in perl) is empty, it should rather be [3]
<anonymized> what is your architecture?
<perlbug> ar7xxx
<anonymized> so big endian

comment:2 Changed 7 years ago by me at sqls dot net

I'm having a problem with the select command, however with the BackupPC application I'm trying to get working on OpenWRT on a WZR-HP-G300HN with the same ar7xxx architecture. Reading the last comment here makes me thing there's some magical answer in the "big endian" statement. But I'm not smart enough to understand how that answers or resolves this problem. Could some clearification be added? Is there a hack or patch or some workout solution to solve select() problems?

comment:3 Changed 7 years ago by juhosg

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with r21465. Thanks for reporting!

comment:4 Changed 7 years ago by nico

  • Milestone changed from Kamikaze to Backfire 10.03.1

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.