core dump during formatted @printf to file #5951

Closed
alsam opened this Issue Feb 25, 2014 · 3 comments

3 participants

@alsam
julia> xlow = 1.0e-5
1.0e-5

julia> fname1="aaa"
"aaa"

julia> unit50 = open(fname1, "w")
IOStream(<file aaa>)

julia> @printf(unit50,"%18.8e    xlow\n",xlow)
julia: src/unix/stream.c:1236: uv_write2: Assertion `(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE || stream->type == UV_TTY) && "uv_write (unix) does not yet support other types of streams"' failed.
Aborted (core dumped)

However this works:

julia> @printf("%18.8e    xlow\n",xlow)
    1.00000000e-05    xlow

And this works:

julia> @printf(unit50,"%d    xlow\n",42)

So looks like this is a bug.

@ivarne

I also got this after updating today.

Julia Version 0.3.0-prerelease+1741
Commit 4b41e6e* (2014-02-25 06:56 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.0.0)
  CPU: Intel(R) Core(TM) i5-2435M CPU @ 2.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm

It worked as expected before pulling and compiling the new version of libuv.

@JeffBezanson JeffBezanson added this to the 0.3 milestone Feb 25, 2014
@alsam

ok, thanks for libuv hint.

see where assert occurred:

https://github.com/joyent/libuv/blob/master/src/unix/stream.c

int uv_write2(uv_write_t* req,
              uv_stream_t* stream,
              const uv_buf_t bufs[],
              unsigned int nbufs,
              uv_stream_t* send_handle,
              uv_write_cb cb) {
  int empty_queue;

  assert(nbufs > 0);
  assert((stream->type == UV_TCP ||
          stream->type == UV_NAMED_PIPE ||
          stream->type == UV_TTY) &&
         "uv_write (unix) does not yet support other types of streams");
@Keno Keno added a commit that closed this issue Feb 25, 2014
@Keno Keno Fix #5951 991cf2f
@Keno Keno closed this in 991cf2f Feb 25, 2014
@alsam

I'm confirming that the issue has been resolved - there are no assertion failures anymore.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment