tbaederr wrote:
Thanks for all the help with this issue. I think I figured it out - there was
an unsigned wraparound some time before doing the actual allocation, which
caused us to write over the bounds of the allocation. I've pushed
https://github.com/llvm/llvm-project/commit/72b3d7bc87019ba
luporl wrote:
In my debug build, clang is receiving a SIGSEGV in frame 7 below (that is
actually frame 0, as the frames below it are from a gdb call that received a
signal). In it, `this` holds an invalid address.
In frame 8, `NE` is 0x3fff, which probably caused the invalid access.
In fram
luporl wrote:
I have been able to reproduce the issue on ARM hardware and collected the info
below.
This was with a release build. I'll check if I can get more details with a
debug build.
```
Program received signal SIGSEGV, Segmentation fault.
memset () at ../sysdeps/arm/memset.S:51
51 .
tbaederr wrote:
> I know there is UB in there
> (https://github.com/llvm/llvm-project/issues/94741) so this is not
> unsurprising.
Ah, interesting. Didn't know about that issue
https://github.com/llvm/llvm-project/pull/70306
___
cfe-commits mailing
DavidSpickett wrote:
I know there is UB in there (https://github.com/llvm/llvm-project/issues/94741)
so this is not unsurprising. Though so far none of that has been the cause of
failures natively.
Let's see what Leandro finds.
https://github.com/llvm/llvm-project/pull/70306
_
tbaederr wrote:
> You can also try it under qemu -
> https://linaro.atlassian.net/wiki/spaces/TCWGPUB/pages/29360783374/How+to+Reproduce+32+bit+Arm+Builds+Without+Hardware.
https://github.com/llvm/llvm-project/pull/70306
___
cfe-commits mailing list
c
DavidSpickett wrote:
@luporl please help reproduce the bot failure
https://lab.llvm.org/buildbot/#/builders/39/builds/528.
You can also try it under qemu -
https://linaro.atlassian.net/wiki/spaces/TCWGPUB/pages/29360783374/How+to+Reproduce+32+bit+Arm+Builds+Without+Hardware.
https://github.co
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `clang-x64-windows-msvc`
running on `windows-gcebot2` while building `clang` at step 4 "annotate".
Full details are available at:
https://lab.llvm.org/buildbot/#/builders/63/builds/509
Here is the relevant piece of the build l
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `lldb-aarch64-windows`
running on `linaro-armv8-windows-msvc-05` while building `clang` at step 4
"build".
Full details are available at:
https://lab.llvm.org/buildbot/#/builders/141/builds/764
Here is the relevant piece of t
https://github.com/tbaederr closed
https://github.com/llvm/llvm-project/pull/70306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 8825030bcb7f2249fbc37a9911b8b5a7afc56d15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATCH] [clang][Interp] Implement dynamic memory allocat
@@ -2771,6 +2771,109 @@ bool Compiler::VisitCXXInheritedCtorInitExpr(
return this->emitCall(F, 0, E);
}
+template
+bool Compiler::VisitCXXNewExpr(const CXXNewExpr *E) {
+ assert(classifyPrim(E->getType()) == PT_Ptr);
+ const Expr *Init = E->getInitializer();
+ QualType E
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 0731875f41bff19e228b0c31700293ed3379 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATCH] [clang][Interp] Implement dynamic memory allocat
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From a2213c595637d63b48658d2532e00b08fd05427f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Thu, 4 Jul 2024 07:26:27 +0200
Subject: [PATCH
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 34b15ca688eef0fd0c23298957faaa6342d15cfd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATCH] [clang][Interp] Implement dynamic memory allocat
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From c36e40f5454ebb50e8ec6b83d50ac988f8aa780c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATCH] [clang][Interp] Implement dynamic memory allocat
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
@@ -2544,6 +2544,85 @@ bool
ByteCodeExprGen::VisitCXXInheritedCtorInitExpr(
return this->emitCall(F, 0, E);
}
+template
+bool ByteCodeExprGen::VisitCXXNewExpr(const CXXNewE
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 02256cbbd7860d788d86864e83ec2ddcedb9f0ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Da
@@ -2544,6 +2544,85 @@ bool
ByteCodeExprGen::VisitCXXInheritedCtorInitExpr(
return this->emitCall(F, 0, E);
}
+template
+bool ByteCodeExprGen::VisitCXXNewExpr(const CXXNewExpr *E) {
+ assert(classifyPrim(E->getType()) == PT_Ptr);
+ const Expr *Init = E->getInitializer();
https://github.com/tbaederr edited
https://github.com/llvm/llvm-project/pull/70306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,119 @@
+//== DynamicAllocator.cpp - Dynamic allocations --*- C++
-*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
@@ -2544,6 +2544,85 @@ bool
ByteCodeExprGen::VisitCXXInheritedCtorInitExpr(
return this->emitCall(F, 0, E);
}
+template
+bool ByteCodeExprGen::VisitCXXNewExpr(const CXXNewExpr *E) {
+ assert(classifyPrim(E->getType()) == PT_Ptr);
+ const Expr *Init = E->getInitializer();
@@ -2544,6 +2544,85 @@ bool
ByteCodeExprGen::VisitCXXInheritedCtorInitExpr(
return this->emitCall(F, 0, E);
}
+template
+bool ByteCodeExprGen::VisitCXXNewExpr(const CXXNewExpr *E) {
+ assert(classifyPrim(E->getType()) == PT_Ptr);
+ const Expr *Init = E->getInitializer();
@@ -2544,6 +2544,85 @@ bool
ByteCodeExprGen::VisitCXXInheritedCtorInitExpr(
return this->emitCall(F, 0, E);
}
+template
+bool ByteCodeExprGen::VisitCXXNewExpr(const CXXNewExpr *E) {
+ assert(classifyPrim(E->getType()) == PT_Ptr);
AaronBallman wrote:
I do
@@ -2544,6 +2544,85 @@ bool
ByteCodeExprGen::VisitCXXInheritedCtorInitExpr(
return this->emitCall(F, 0, E);
}
+template
+bool ByteCodeExprGen::VisitCXXNewExpr(const CXXNewExpr *E) {
+ assert(classifyPrim(E->getType()) == PT_Ptr);
+ const Expr *Init = E->getInitializer();
@@ -2544,6 +2544,85 @@ bool
ByteCodeExprGen::VisitCXXInheritedCtorInitExpr(
return this->emitCall(F, 0, E);
}
+template
+bool ByteCodeExprGen::VisitCXXNewExpr(const CXXNewExpr *E) {
+ assert(classifyPrim(E->getType()) == PT_Ptr);
+ const Expr *Init = E->getInitializer();
@@ -0,0 +1,119 @@
+//== DynamicAllocator.cpp - Dynamic allocations --*- C++
-*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
tbaederr wrote:
Ping
https://github.com/llvm/llvm-project/pull/70306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tbaederr wrote:
Rebased and updated with a lot more tests.
https://github.com/llvm/llvm-project/pull/70306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 471d7a14b6475c4d06365b01ac35847276a464ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATCH] [clang][Interp] Implement dynamic memory allocat
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From bf3dd8a13a2ed61d2cc9b2e49a7ff271f29c2ba9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATCH] [clang][Interp] Implement dynamic memory allocat
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 29270191a209af2d8bcf270c84a87d6fa456fa0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATCH] [clang][Interp] Implement dynamic memory allocat
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
tbaederr wrote:
FYI, this needs https://github.com/llvm/llvm-project/pull/70763,
https://github.com/llvm/llvm-project/pull/70763 and
https://github.com/llvm/llvm-project
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From b7af057b1e8cd56ce1151d6232244c137d349ea9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From f1bb89bf7cfe8940726a1c51edaaf73d5bd74c4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 33d24cd22642d2a6f9b00aaa3826472381e93d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 33d24cd22642d2a6f9b00aaa3826472381e93d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Da
Timm =?utf-8?q?Bäder?= ,
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 33d24cd22642d2a6f9b00aaa3826472381e93d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:3
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
@@ -1990,6 +2011,79 @@ inline bool OffsetOf(InterpState &S, CodePtr OpPC, const
OffsetOfExpr *E) {
return true;
}
+inline bool Alloc(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
+ assert(Desc);
+
+ if (!CheckDy
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 33d24cd22642d2a6f9b00aaa3826472381e93d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATC
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From abc2a0b7c5beefc28e6d88f9718c5aefe1fbf044 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATC
@@ -0,0 +1,91 @@
+//== DynamicAllocator.cpp - Types for the constexpr VM ---*- C++
-*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/tbaederr updated
https://github.com/llvm/llvm-project/pull/70306
>From 8ec689511d266576bd792ee8731baff9ec0e7143 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?=
Date: Wed, 25 Oct 2023 08:33:30 +0200
Subject: [PATCH] [clang][Interp] Implement dynamic memory allocat
@@ -0,0 +1,91 @@
+//== DynamicAllocator.cpp - Types for the constexpr VM ---*- C++
-*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -1990,6 +2011,79 @@ inline bool OffsetOf(InterpState &S, CodePtr OpPC, const
OffsetOfExpr *E) {
return true;
}
+inline bool Alloc(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
+ assert(Desc);
+
+ if (!CheckDynamicMemoryAllocation(S, OpPC))
+return false;
@@ -0,0 +1,91 @@
+//== DynamicAllocator.cpp - Types for the constexpr VM ---*- C++
-*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -1990,6 +2011,79 @@ inline bool OffsetOf(InterpState &S, CodePtr OpPC, const
OffsetOfExpr *E) {
return true;
}
+inline bool Alloc(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
+ assert(Desc);
+
+ if (!CheckDynamicMemoryAllocation(S, OpPC))
+return false;
@@ -0,0 +1,91 @@
+//== DynamicAllocator.cpp - Types for the constexpr VM ---*- C++
-*-==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -1990,6 +2011,79 @@ inline bool OffsetOf(InterpState &S, CodePtr OpPC, const
OffsetOfExpr *E) {
return true;
}
+inline bool Alloc(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
+ assert(Desc);
+
+ if (!CheckDynamicMemoryAllocation(S, OpPC))
+return false;
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
Changes
Implement handling for new/delete/new[]/delete[] expressions via a new
`DynamicAllocator` class.
This introduces four new opcodes:
- `Alloc` - Allocates one element (`new int(14)`)
- `AllocN` - Allocates N
https://github.com/tbaederr created
https://github.com/llvm/llvm-project/pull/70306
Implement handling for new/delete/new[]/delete[] expressions via a new
`DynamicAllocator` class.
This introduces four new opcodes:
- `Alloc` - Allocates one element (`new int(14)`)
- `AllocN` - Allocates N el
51 matches
Mail list logo