Project

General

Profile

Actions

Bug #905

closed

dbo::FixedSqlConnectionPool with size=1 seems to cause dead lock

Added by Boris Nagaev over 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
07/17/2011
Due date:
% Done:

0%

Estimated time:

Description

After applying patch

 #include <Wt/Dbo/Dbo>
+#include <Wt/Dbo/FixedSqlConnectionPool>
 #include <Wt/Dbo/backend/Sqlite3>
 #include <string>

@@ -81,10 +82,11 @@ void run()
   /*
    * Setup a session, would typically be done once at application startup.
    */
-  dbo::backend::Sqlite3 sqlite3(":memory:");
-  sqlite3.setProperty("show-queries", "true");
+  dbo::backend::Sqlite3* sqlite3 = new dbo::backend::Sqlite3(":memory:");
+  sqlite3->setProperty("show-queries", "true");
   dbo::Session session;
-  session.setConnection(sqlite3);
+  dbo::FixedSqlConnectionPool pool(sqlite3, 1);
+  session.setConnectionPool(pool);

to examples/feature/dbo/tutorial2.C, the application freezes.

With size=2, it works

Actions #1

Updated by Koen Deforche over 13 years ago

  • Status changed from New to Feedback
  • Assignee set to Koen Deforche

Hey,

I just tried on my Mac but could not reproduce this...

What platform are you on and could you check where it is blocking using gdb ?

Regards,

koen

Actions #2

Updated by Boris Nagaev over 13 years ago

Hello!

Ubuntu 11.04, 64-bit.

Wt from Wt ppa, 3.1.10.

Compile command:

g++ tutorial2.C -o t -lwtdbo -lwtdbosqlite3

gdb session:

(gdb) ru
Starting program: /tmp/wt/examples/feature/dbo/t 
[Thread debugging using libthread_db enabled]
^C
Program received signal SIGINT, Interrupt.
pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
162     ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
(gdb) bt
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007ffff7ba9d53 in wait<boost::mutex> (this=0x7fffffffdfe0)
    at /usr/include/boost/thread/pthread/condition_variable.hpp:84
#2  Wt::Dbo::FixedSqlConnectionPool::getConnection (this=0x7fffffffdfe0)
    at /build/buildd/witty-3.1.10/src/Wt/Dbo/FixedSqlConnectionPool.C:56
#3  0x00007ffff7bc14f0 in Wt::Dbo::Session::prepareStatements (this=0x7fffffffde60, mapping=0x649920)
    at /build/buildd/witty-3.1.10/src/Wt/Dbo/Session.C:253
#4  0x00007ffff7bc3e04 in Wt::Dbo::Session::initSchema (this=0x7fffffffde60)
    at /build/buildd/witty-3.1.10/src/Wt/Dbo/Session.C:203
#5  0x00007ffff7bc6507 in Wt::Dbo::Session::createTables (this=0x7fffffffde60)
    at /build/buildd/witty-3.1.10/src/Wt/Dbo/Session.C:574
#6  0x00000000004066d5 in run() ()
#7  0x0000000000406de8 in main ()
(gdb) 

It freezes after printing [Thread debugging using libthread_db enabled].

Then I pressed Ctrl+C

Actions #3

Updated by Koen Deforche over 13 years ago

  • Status changed from Feedback to Resolved
  • Target version set to 3.1.11

Hey,

Interestingly, I could indeed reproduce this on ubuntu. It's fixed in git.

Regards,

koen

Actions #4

Updated by Koen Deforche about 13 years ago

  • Status changed from Resolved to Closed

Resolved in Wt 3.1.11

Actions

Also available in: Atom PDF