mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Re: asctime(0) Segmentation fault
Date: Sat, 19 Apr 2014 23:35:36 -0400	[thread overview]
Message-ID: <20140420033536.GW26358@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAGDMk9G_HfDTBBX6JXTU1v7Y+OVLoouvyza1R56AwWfaFbNr7g@mail.gmail.com>

On Sat, Apr 19, 2014 at 11:33:06PM -0400, John Mudd wrote:
> Yes, asctime(0) might be my bad assumption.
> 
> Does this help?
> 
> (gdb) backtrace
> #0  a_crash () at ./arch/i386/atomic.h:124
> #1  0xb7fc735b in __asctime (tm=0xbfffde64, buf=0xb7fff288 <buf.1032> "Mon
> Jan  1 00:00:00 12345") at src/time/__asctime.c:26
> #2  0xb7fc91d7 in asctime (tm=tm@entry=0xbfffde64) at src/time/asctime.c:8
> #3  0xb7c89709 in time_asctime (self=0x0, args=0xb7d05bcc) at
> /home/mudd/musl/Python-2.7.6/Modules/timemodule.c:574
> #4  0xb7e1989d in PyCFunction_Call (func=func@entry=0xb7d056cc,
> arg=arg@entry=0xb7d05bcc, kw=kw@entry=0x0) at Objects/methodobject.c:81

Yes. musl's asctime is intentionally crashing when the resulting
string would be >26 bytes rather than silently clobbering whatever
memory lies just beyond the end of the static buffer.

Rich


      reply	other threads:[~2014-04-20  3:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-19 22:16 John Mudd
2014-04-19 22:36 ` Jens Gustedt
2014-04-19 22:46 ` John Mudd
2014-04-20  1:43   ` Szabolcs Nagy
2014-04-20  1:59     ` Rich Felker
2014-04-20  2:43   ` John Mudd
2014-04-20  2:51     ` John Mudd
2014-04-20  3:15       ` Rich Felker
2014-04-20  3:33       ` John Mudd
2014-04-20  3:35         ` Rich Felker [this message]

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=20140420033536.GW26358@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).