C++
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
- voluntas
- @ignis_fatuus
- ブン
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- takezoh
- まろ
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- 黒澤 亮二
- I (@wx257osn2)
- @gnaggnoyil
- @mandel59
- Tommy6
- イズカワタカノブ
- @tyottyoworks
- ___shanon
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
x
23
1
2
3
4
struct Entity{
5
int id;
6
};
7
8
int main(){
9
std::vector<std::unique_ptr<Entity> > entities;
10
Entity* selectedEntity = new Entity;
11
int currentID = 0;
12
13
if (selectedEntity) {
14
Entity e = *selectedEntity;
15
16
e.id = currentID;
17
currentID++;
18
19
std::unique_ptr<Entity> uPtr{ &e };
20
21
entities.emplace_back(std::move(uPtr));
22
}
23
}
$ g++ prog.cc -Wall -Wextra -std=c++11 -pedantic
Start
*** Error in `./prog.exe': free(): invalid pointer: 0x00007ffc553d3e1c *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fcc138d07e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fcc138d937a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fcc138dd53c] ./prog.exe[0x400d55] ./prog.exe[0x400b42] ./prog.exe[0x4016ab] ./prog.exe[0x401471] ./prog.exe[0x401100] ./prog.exe[0x400cbd] ./prog.exe[0x400a95] ./prog.exe[0x40092f] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fcc13879830] ./prog.exe[0x4007f9] ======= Memory map: ======== 00400000-00403000 r-xp 00000000 fd:03 9702479 /home/jail/prog.exe 00603000-00604000 rw-p 00003000 fd:03 9702479 /home/jail/prog.exe 0161e000-01650000 rw-p 00000000 00:00 0 [heap] 7fcc0c000000-7fcc0c021000 rw-p 00000000 00:00 0 7fcc0c021000-7fcc10000000 ---p 00000000 00:00 0 7fcc13859000-7fcc13a19000 r-xp 00000000 fd:03 147125 /lib/x86_64-linux-gnu/libc-2.23.so 7fcc13a19000-7fcc13c19000 ---p 001c0000 fd:03 147125 /lib/x86_64-linux-gnu/libc-2.23.so 7fcc13c19000-7fcc13c1d000 r--p 001c0000 fd:03 147125 /lib/x86_64-linux-gnu/libc-2.23.so 7fcc13c1d000-7fcc13c1f000 rw-p 001c4000 fd:03 147125 /lib/x86_64-linux-gnu/libc-2.23.so 7fcc13c1f000-7fcc13c23000 rw-p 00000000 00:00 0 7fcc13c23000-7fcc13c3a000 r-xp 00000000 fd:03 494118 /opt/wandbox/gcc-10.1.0/lib64/libgcc_s.so.1 7fcc13c3a000-7fcc13e39000 ---p 00017000 fd:03 494118 /opt/wandbox/gcc-10.1.0/lib64/libgcc_s.so.1 7fcc13e39000-7fcc13e3a000 rw-p 00016000 fd:03 494118 /opt/wandbox/gcc-10.1.0/lib64/libgcc_s.so.1 7fcc13e3a000-7fcc13f42000 r-xp 00000000 fd:03 147128 /lib/x86_64-linux-gnu/libm-2.23.so 7fcc13f42000-7fcc14141000 ---p 00108000 fd:03 147128 /lib/x86_64-linux-gnu/libm-2.23.so 7fcc14141000-7fcc14142000 r--p 00107000 fd:03 147128 /lib/x86_64-linux-gnu/libm-2.23.so 7fcc14142000-7fcc14143000 rw-p 00108000 fd:03 147128 /lib/x86_64-linux-gnu/libm-2.23.so 7fcc14143000-7fcc142ff000 r-xp 00000000 fd:03 494142 /opt/wandbox/gcc-10.1.0/lib64/libstdc++.so.6.0.28 7fcc142ff000-7fcc144ff000 ---p 001bc000 fd:03 494142 /opt/wandbox/gcc-10.1.0/lib64/libstdc++.so.6.0.28 7fcc144ff000-7fcc1450a000 r--p 001bc000 fd:03 494142 /opt/wandbox/gcc-10.1.0/lib64/libstdc++.so.6.0.28 7fcc1450a000-7fcc1450d000 rw-p 001c7000 fd:03 494142 /opt/wandbox/gcc-10.1.0/lib64/libstdc++.so.6.0.28 7fcc1450d000-7fcc14510000 rw-p 00000000 00:00 0 7fcc14510000-7fcc14528000 r-xp 00000000 fd:03 147112 /lib/x86_64-linux-gnu/libpthread-2.23.so 7fcc14528000-7fcc14727000 ---p 00018000 fd:03 147112 /lib/x86_64-linux-gnu/libpthread-2.23.so 7fcc14727000-7fcc14728000 r--p 00017000 fd:03 147112 /lib/x86_64-linux-gnu/libpthread-2.23.so 7fcc14728000-7fcc14729000 rw-p 00018000 fd:03 147112 /lib/x86_64-linux-gnu/libpthread-2.23.so 7fcc14729000-7fcc1472d000 rw-p 00000000 00:00 0 7fcc1472d000-7fcc14753000 r-xp 00000000 fd:03 147111 /lib/x86_64-linux-gnu/ld-2.23.so 7fcc14943000-7fcc14949000 rw-p 00000000 00:00 0 7fcc14951000-7fcc14952000 rw-p 00000000 00:00 0 7fcc14952000-7fcc14953000 r--p 00025000 fd:03 147111 /lib/x86_64-linux-gnu/ld-2.23.so 7fcc14953000-7fcc14954000 rw-p 00026000 fd:03 147111 /lib/x86_64-linux-gnu/ld-2.23.so 7fcc14954000-7fcc14955000 rw-p 00000000 00:00 0 7ffc553b4000-7ffc553d5000 rw-p 00000000 00:00 0 [stack] 7ffc553e0000-7ffc553e2000 r--p 00000000 00:00 0 [vvar] 7ffc553e2000-7ffc553e4000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted
Finish