From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: TP_NUM_C_BUFS too small
Date: Tue, 03 Nov 2015 13:02:00 -0000 [thread overview]
Message-ID: <20151103130154.GD18567@calimero.vinschen.de> (raw)
In-Reply-To: <op.x7hw6yifofd6j1@frascati.upc.de>
[-- Attachment #1: Type: text/plain, Size: 2483 bytes --]
On Nov 3 00:07, Helmut Karlowski wrote:
> Am 02.11.2015, 12:15 Uhr, schrieb Corinna Vinschen:
>
> >>Glad it's fixed! For the record, could you say what sort of bug would
> >>cause
> >>a fatal internal error like that?
> >>Just curious,
> >
> >Me too. Sounds like some kind of recursion.
>
> It all happened after I had replaced all strcpy/strcat by strlcpy like this:
>
> strcpy(t,s) -> pos = strlcpy(t,s,size)
> strcat(t,s) -> pos += strlcpy(t+pos,s,size-pos)
>
> At some point the pos-parameter was wrong and the resulting string became
> something undesired. And that string probably was passed to fopen, maybe pos
> became very large way beyond the boundaries of the string which is from the
> stack.
>
> It's hard to reproduce what happened in a simple case, and I was in some
> hurry then, but I saved the strace-output:
> [...]
> fhandler_base::open(\??\C:\cygwin\usr\src\ue314\bin\u, 0x108000)
> 41 4266380 [main] ue 460 fhandler_base::open_fs: 1 =
> fhandler_disk_file::open(\??\C:\cygwin\usr\src\ue314\bin\u, 0x8000)
> 34 4266414 [main] ue 460 open: 3 = open(u, 0x8000)
> 186 4266600 [main] ue 460 _cygwin_istext_for_stdio: fd 3: opened as binary
> 232 4266832 [main] ue 460 close: close(3)
> 32 4266864 [main] ue 460 fhandler_base::close: closing
> '/usr/src/ue314/bin/u' handle 0x170
> 49 4266913 [main] ue 460 close: 0 = close(3)
> 460 4267373 [main] 20 460 open: open(u, 0x0)
^^
!!
> This loops some 100 times, then:
> [...]
>
> Note the process-name gets overwritten by a number of increasing length, the
> last being 254 bytes long before the process exits.
Yuk.
> Don't know if that's of any use. It crashed not only on cygwin.
>
> BTW: Is there a documentation about the columns of the strace-output
> somewhere?
Uhm, I don't think so. From left to right:
- usecs since last trace output
- usecs since process start
- [name of thread] (this only makes sense for the named threads,
mainly the "main" thread, the "sig" thread, and a few short-lived
helper threads in the DLL. Pthreads don't have a name, they are called
"unknown ($thread_id)"
- process name
- pid
- function/method name:
- last but not least the actual output string.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-11-03 13:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-01 17:46 Helmut Karlowski
2015-11-01 19:35 ` Helmut Karlowski
2015-11-02 2:32 ` Mark Geisert
2015-11-02 11:15 ` Corinna Vinschen
2015-11-02 23:07 ` Helmut Karlowski
2015-11-03 13:02 ` Corinna Vinschen [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-02-07 21:38 marco atzeri
2011-02-08 11:59 ` Corinna Vinschen
2011-02-08 12:14 ` marco atzeri
2011-02-08 12:25 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151103130154.GD18567@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).