NetBSD Problem Report #34870
From kalevi.suominen@helsinki.fi Fri Oct 20 15:45:02 2006
Return-Path: <kalevi.suominen@helsinki.fi>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 96B6D63BC6A
for <gnats-bugs@gnats.NetBSD.org>; Fri, 20 Oct 2006 15:45:02 +0000 (UTC)
Message-Id: <200610201437.k9KEbQHY012349@weber.home>
Date: Fri, 20 Oct 2006 17:37:26 +0300 (EEST)
From: K Suominen <kalevi.suominen@helsinki.fi>
Reply-To: kalevi.suominen@helsinki.fi
To: gnats-bugs@NetBSD.org
Subject: Incorrect patch in textproc/jade
X-Send-Pr-Version: 3.95
>Number: 34870
>Category: pkg
>Synopsis: Incorrect patch in textproc/jade
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: rh
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 20 15:50:00 +0000 2006
>Last-Modified: Fri Oct 20 16:30:32 +0000 2006
>Originator: K Suominen
>Release: NetBSD 2.0
>Organization:
>Environment:
System: NetBSD weber.home 2.0 NetBSD 2.0 (WEBER_SB) #9: Sat Mar 18 14:36:03 EET 2006 jks@weber.home:/usr/src/sys/arch/i386/compile/WEBER_SB i386
Architecture: i386
Machine: i386
>Description:
Some classes based on Resource (such as AttributeValue) contain
virtual functions. An object of such a class begins with the vtable
pointer, and the Resource object (counter) is offset by the size
of the pointer (4). Hence the cast of (a pointer to) such an object
to (a pointer to) Resource, introduced in "patch-ap", is wrong.
(It typically leads to the corruption of the vtable pointer with
ensueing SIGSEGV and core dump.)
>How-To-Repeat:
>Fix:
Remove "patch-ap". The remaining compilation problems can be
solved by delaying the instantiation of some templates in
"parser_inst.cxx": replace "patch-ai" with the following
(and corresponding changes in "patch-aj")
--- parser_inst.cxx.orig_dist 1998-10-07 13:04:12.000000000 +0300
+++ parser_inst.cxx 2006-10-07 22:22:20.000000000 +0300
@@ -13,9 +13,9 @@
#ifdef SP_MANUAL_INST
-#define SP_DEFINE_TEMPLATES
#include "Owner.h"
#include "CopyOwner.h"
+#define SP_DEFINE_TEMPLATES
#include "Vector.h"
#include "NCVector.h"
#include "Ptr.h"
@@ -72,6 +72,9 @@
#include "types.h"
#include "Id.h"
+#include "Owner.cxx"
+#include "CopyOwner.cxx"
+
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
@@ -1324,6 +1327,7 @@
#endif
#endif
#endif
+#if defined(_LP64) || defined(__arm__)
#ifdef __DECCXX
#pragma define_template Vector<size_t>
#else
@@ -1337,6 +1341,7 @@
#endif
#endif
#endif
+#endif
#ifdef __DECCXX
#pragma define_template Vector<unsigned int>
#else
and by changing the order of AttributeValue and
AttributeDefinitionDesc in Attribute.h:
--- Attribute.h.orig 1998-10-07 08:15:48.000000000 +0300
+++ Attribute.h 2006-10-07 21:09:06.000000000 +0300
@@ -31,6 +31,27 @@
class AttributeContext;
class Syntax;
+class SP_API AttributeValue : public Resource {
+public:
+ enum Type {
+ implied,
+ cdata,
+ tokenized
+ };
+ AttributeValue();
+ virtual ~AttributeValue();
+ virtual AttributeSemantics *makeSemantics(const DeclaredValue *,
+ AttributeContext &,
+ const StringC &,
+ unsigned &,
+ unsigned &) const;
+ virtual Type info(const Text *&, const StringC *&) const = 0;
+ virtual const Text *text() const;
+ virtual Boolean recoverUnquoted(const StringC &, const Location &,
+ AttributeContext &, const StringC &);
+ static Boolean handleAsUnterminated(const Text &, AttributeContext &);
+};
+
class SP_API AttributeDefinitionDesc {
public:
AttributeDefinitionDesc() { }
@@ -373,27 +394,6 @@
ConstPtr<Notation> notation_;
};
-class SP_API AttributeValue : public Resource {
-public:
- enum Type {
- implied,
- cdata,
- tokenized
- };
- AttributeValue();
- virtual ~AttributeValue();
- virtual AttributeSemantics *makeSemantics(const DeclaredValue *,
- AttributeContext &,
- const StringC &,
- unsigned &,
- unsigned &) const;
- virtual Type info(const Text *&, const StringC *&) const = 0;
- virtual const Text *text() const;
- virtual Boolean recoverUnquoted(const StringC &, const Location &,
- AttributeContext &, const StringC &);
- static Boolean handleAsUnterminated(const Text &, AttributeContext &);
-};
-
class SP_API ImpliedAttributeValue : public AttributeValue {
public:
ImpliedAttributeValue();
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->rh
Responsible-Changed-By: obache@netbsd.org
Responsible-Changed-When: Fri, 20 Oct 2006 16:30:32 +0000
Responsible-Changed-Why:
Over to maintainer.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.36 2007/11/24 03:27:39 kano Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.