Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 2010 18:55:30 +0200
From:      Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de>
To:        freebsd-current@freebsd.org
Cc:        gabor@FreeBSD.org
Subject:   dc(1) -e "6 2 / p" is still broken as of r207919
Message-ID:  <20100512165530.GA40826@wep4035.physik.uni-wuerzburg.de>

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

--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello!

Just to remind that still:

~> dc -e "6 2 / p"
Segmentation fault (core dumped)

This was already mentioned on this list:
http://lists.freebsd.org/pipermail/freebsd-current/2010-April/016560.html
and there is a patch proposed in the same thread:
http://lists.freebsd.org/pipermail/freebsd-current/2010-April/016603.html

Note, however, that reverting r203438 also fixes the problem (gabor@ CC-ed),
so I'm not sure what is the right way to fix it.
Attached is slightly modified reverse patch to revert 203438.

Thanks,
Alexey.

--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch

--- dc.c	2010/01/20 21:30:52	202719
+++ dc.c	2010/02/03 19:13:41	203438
@@ -82,15 +82,7 @@
 {
 	int ch;
 	bool extended_regs = false, preproc_done = false;
-	char		*buf;
 
-	if ((buf = strdup("")) == NULL)
-		err(1, NULL);
-
-	init_bmachine(extended_regs);
-	setlinebuf(stdout);
-	setlinebuf(stderr);
-
 	/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
 	while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) {
 		switch (ch) {
@@ -123,6 +115,10 @@
 	argc -= optind;
 	argv += optind;
 
+	init_bmachine(extended_regs);
+	setlinebuf(stdout);
+	setlinebuf(stderr);
+
 	if (argc > 1)
 		usage();
 	if (argc == 1) {

--LQksG6bCIzRHxTLp--



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