kmsquire / Logging.jl

Logging package for julia
Other
43 stars 26 forks source link

SystemError: flush: Bad file descriptor on Travis but not on local machine #39

Open JockLawrie opened 8 years ago

JockLawrie commented 8 years ago

Hi there,

I am running the tests for LoggedDicts.jl, which uses Logging.jl as a dependency. On my local machine everything works well, but on Travis I consistently get the error: SystemError: flush: Bad file descriptor

Oddly, the error occurs on a line that is called several times without issue earlier in the test suite. The failure consistently occurs at the same call site (line 44 of test/runtests.jl).

It is unclear if this is a Logging.jl issue, a Travis issue or something that I'm doing wrong. Have you seen this problem before?

Regards, Jock

kmsquire commented 8 years ago

Hi, Thanks for reporting. I haven't run across this, and I don't know what the problem is off hand. I'll try to take a look, but not sure how soon. If you discover anything about it, please post back!

Link with an example from LoggedDicts.jl: https://travis-ci.org/JockLawrie/LoggedDicts.jl/jobs/120814199#L160-L168.

kmsquire commented 8 years ago

Okay, a small hint: the only flush function is here. It might be that the file descriptor you're writing to (is it a file?) can't be created on travis with your current setup, or that whatever you're writing to doesn't exist on travis. Maybe that provides enough hints for digging into it more?

JockLawrie commented 8 years ago

The curious thing is that each call to set!, pop!, push! and delete! calls info(), which then writes to the log file. This all goes without a hitch until the end of runtests.jl. That is, the error is raised only when info() is called for the 9th time.

The only thing I can think of is that the log file is closed by some Travis setting...but then surely the test suite from Logging.jl would have encountered this problem. So I'm stumped.

JockLawrie commented 8 years ago

New fact: Commenting out writes (not logs) to other files passes on Linux but still fails on OSX. Not being a Mac user, I have no idea why.

On 6 April 2016 at 13:18, Kevin Squire notifications@github.com wrote:

Okay, a small hint: the only flush function is here https://github.com/kmsquire/Logging.jl/blob/master/src/Logging.jl#L74. It might be that the file descriptor you're writing to (is it a file?) can't be created on travis with your current setup, or that whatever you're writing to doesn't exist on travis. Maybe that provides enough hints for digging into it more?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/kmsquire/Logging.jl/issues/39#issuecomment-206097324

JockLawrie commented 8 years ago

Now passing on OSX - no issue, it just stopped so I restarted it.

So the problem seems related to writing to a stream not using Logging.jl while also writing to a log file using Logging.jl. The difficulty is that it reproduces on Travis, but not on my local Debian machine.

On 6 April 2016 at 14:53, Jock Lawrie jock.lawrie@gmail.com wrote:

New fact: Commenting out writes (not logs) to other files passes on Linux but still fails on OSX. Not being a Mac user, I have no idea why.

On 6 April 2016 at 13:18, Kevin Squire notifications@github.com wrote:

Okay, a small hint: the only flush function is here https://github.com/kmsquire/Logging.jl/blob/master/src/Logging.jl#L74. It might be that the file descriptor you're writing to (is it a file?) can't be created on travis with your current setup, or that whatever you're writing to doesn't exist on travis. Maybe that provides enough hints for digging into it more?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/kmsquire/Logging.jl/issues/39#issuecomment-206097324