Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jun 2001 13:26:27 +0300 (EEST)
From:      Maxim Sobolev <sobomax@mail-in.net>
To:        current@FreeBSD.org
Subject:   sscanf(3) is broken in 5-CURRENT [SIGBUS]
Message-ID:  <200106021026.f52AQQo50360@mail.uic-in.net>

next in thread | raw e-mail | index | archive | help
Hi,

It seems that something is wrong with sscanf(3) in -current - in
some cases it may cause SIGBUS. I failed to reproduce the
problem on 4-STABLE, so it is a -current specific bug. Attached
please find small showcase that exposes the bug in question
and a backtrace after SIGBUS.

Please fix.

-Maxim

#include <stdio.h>
int
main()
{
	float sub;
	sscanf("59e", "%f", &sub);
	exit(0);
}

(gdb) r
Starting program: /tmp/bug/a.out 
Program received signal SIGBUS, Bus error.
0x280b3ad8 in __ungetc () from /usr/lib/libc.so.5
(gdb) bt
#0  0x280b3ad8 in __ungetc () from /usr/lib/libc.so.5
#1  0x280b36b1 in __svfscanf () from /usr/lib/libc.so.5
#2  0x280b25a3 in sscanf () from /usr/lib/libc.so.5
#3  0x80484c0 in main () at bug.c:8
#4  0x80483f5 in _start ()

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106021026.f52AQQo50360>