http://www.webtoolkit.eu/wt/doc/tutorial/dbo.html言う
このチュートリアルで使用される例の完全なソース コードは、すぐに実行できるプログラムとして、
examples/feature/dbo/
Wt のフォルダーにあります。
そのディレクトリから実行しようとするとtutorial1.C
、次の出力が得られます。
(gdb) run
Starting program: /home/lawsa/sources/memory/dist/flashcard --docroot . --http-address 0.0.0.0 --http-port 9090
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
begin transaction
create table "user" (
"id" integer primary key autoincrement,
"version" integer not null,
"name" text not null,
"password" text not null,
"role" integer not null,
"karma" integer not null
)
commit transaction
created tables
ending transaction
Program received signal SIGSEGV, Segmentation fault.
0x000000000041a4a8 in void std::vector<Wt::Dbo::ptr_base*, std::allocator<Wt::Dbo::ptr_base*> >::emplace_back<Wt::Dbo::ptr_base*>(Wt::Dbo::ptr_base*&&) ()
(gdb) bt
#0 0x000000000041a4a8 in void std::vector<Wt::Dbo::ptr_base*, std::allocator<Wt::Dbo::ptr_base*> >::emplace_back<Wt::Dbo::ptr_base*>(Wt::Dbo::ptr_base*&&) ()
#1 0x0000000000419c8e in std::vector<Wt::Dbo::ptr_base*, std::allocator<Wt::Dbo::ptr_base*> >::push_back(Wt::Dbo::ptr_base*&&) ()
#2 0x0000000000419682 in void Wt::Dbo::Session::implSave<User>(Wt::Dbo::MetaDbo<User>&) ()
#3 0x0000000000418c4e in Wt::Dbo::MetaDbo<User>::flush() ()
#4 0x00007ffff6c8eae2 in Wt::Dbo::Session::flush() ()
from /usr/lib/libwtdbo.so.38
#5 0x00007ffff6c9d14d in Wt::Dbo::Transaction::Impl::commit() ()
from /usr/lib/libwtdbo.so.38
#6 0x00007ffff6c9d1a9 in Wt::Dbo::Transaction::commit() ()
from /usr/lib/libwtdbo.so.38
#7 0x00000000004063d2 in run() ()
#8 0x0000000000407066 in main ()
(gdb)
参考までに、私のコードは次のとおりです: http://sprunge.us/PYSO (これがしばらく続くことを願っていますが、機能しなくなったらお知らせください)。そして、私の Makefile: http://sprunge.us/UCgeを使用して gdb を実行しました$ gdb --args ./flashcard --docroot . --http-address 0.0.0.0 --http-port 9090
行 80 からの出力を確認できますが、行 83 からの出力は確認できません。gdb からのバックトレースは、行 81 (コミット) に問題があることを示唆しています。範囲外になったためにトランザクションがコミットされるように 81 行目を削除すると、同じ問題が存在しますが、トランザクションのデストラクタが原因です。
私は、Wt 3.3.4-4、gcc 5.1.0-5 で archlinux を実行しており、-std=c++0x
.
私が想像できる唯一のことは、std::vector とのバイナリ非互換性があるかどうかです。