duerst / it.aoyama.ac.jp wrote:
> normalperson (Eric Wong) wrote:
> 
> >  Is there something which shows system call traces which could be
> >  useful in diagnosing this?
> 
> `strace` seems to do that, see https://cygwin.com/cygwin-ug-net/strace.html.

OK, same as on Linux, I guess?  (`-f' to trace children should
be useful.

So, are you also confirming my two patches together do NOT work
for you?  (I somewhat expected them to, since they try to follow
the 2.5 code path...)

> strace ./ruby -ropen-uri -e 'open "http://web.mit.edu/index.html"'
> ```
> produces something like 34 thousand lines out output.

Hint #1: --disable=gems to reduce syscalls

Hint #2: add `warn' statements before and after the parts you're
interested in, which makes it easier to find the part of the
code you want to trace:

e.g.:

	warn "BEGIN FOO"
	.... # whatever you're interested in
	warn "END FOO"

You can the search for "BEGIN FOO"/"END FOO" in the strace
output from write/writev syscalls, and everything in between is
what you care about.

When I debug in C, I may also use write to a bogus FD to make
things easier-to-find:

     write(-13, "blah blah\n", 10); errno = 0;


That Cygwin manpage doesn't give strace output examples, so I
also wonder if the output is capable of showing strings (I'm
spoiled by Linux strace, which does).  Sometimes I will use
weird/uncommon syscalls or sequences if string matches don't
work; but same idea above for finding unique/rare strings.

But yeah, I also have no idea what syscalls you'd see in
Windows.  At least on Linux I would start looking for where
socket() is called along with nearby clone() syscalls for
Timeout...

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>