question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Thread sometimes bails with'Bad file descriptor'

See original GitHub issue
[paultag@cassiel:~][⌚ 12:24 AM] ♥  python
Python 3.4.3+ (default, Jul 28 2015, 13:17:50) 
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pychromecast
>>> pychromecast.get_chromecasts_as_dict()
{}
>>> Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/home/paultag/.virtualenvs/cuttlebot/lib/python3.4/site-packages/zeroconf.py", line 1063, in run
    handler(self.zc)
  File "/home/paultag/.virtualenvs/cuttlebot/lib/python3.4/site-packages/zeroconf.py", line 1014, in <lambda>
    state_change=state_change,
  File "/home/paultag/.virtualenvs/cuttlebot/lib/python3.4/site-packages/zeroconf.py", line 931, in fire
    h(**kwargs)
  File "/home/paultag/.virtualenvs/cuttlebot/lib/python3.4/site-packages/zeroconf.py", line 989, in on_change
    listener.add_service(*args)
  File "/home/paultag/.virtualenvs/cuttlebot/lib/python3.4/site-packages/pychromecast/discovery.py", line 34, in add_service
    service = zconf.get_service_info(typ, name)
  File "/home/paultag/.virtualenvs/cuttlebot/lib/python3.4/site-packages/zeroconf.py", line 1398, in get_service_info
    if info.request(self, timeout):
  File "/home/paultag/.virtualenvs/cuttlebot/lib/python3.4/site-packages/zeroconf.py", line 1221, in request
    zc.send(out)
  File "/home/paultag/.virtualenvs/cuttlebot/lib/python3.4/site-packages/zeroconf.py", line 1657, in send
    bytes_sent = s.sendto(packet, 0, (addr, port))
OSError: [Errno 9] Bad file descriptor

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
1337sup3rh4x0rcommented, Jan 16, 2017
1reaction
AnsgarSchmidtcommented, Oct 14, 2016

Can you catch it within the library and just ignore it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What could cause "bad file descriptor" in multithreaded ...
It's almost certainly a multi-threading issue. Between the two uses of the FILE * , some other thread has closed the underlying file...
Read more >
Bad file descriptor when building multi-module project #115
Hi, I have a project with multiple modules and when I build it using multiple threads (-T2) I get the following error: [ERROR]...
Read more >
TTA SGD 3.42 - error reading fdcircuit - bad file descriptor — oracle ...
An error occurred reading on circuit fdcircuit. Reason: (9) Bad file descriptor. The current operation has failed. If persistent, restart the server.
Read more >
The file descriptor is duplicated in the thread [closed]
My C source behaves strangely. I use Ubuntu 14.04. I use two pthread . And in each of pthread calls the open ()...
Read more >
How to File Nails Safely So They Don't Break or Peel
These are helpful for trimming long nails before filing. A nail file. This can be a classic emery board, though glass files are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found