TRY THIS sqlite2 in PIAF

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,534
Reaction score
727
What's the purpose of sqlite2 being included in PIAF (CentOS)?

Code:
sqlite2.x86_64                          2.8.17-10.el6                  @piaf64
sqlite2-devel.x86_64                    2.8.17-10.el6                  @piaf64

darmock, wardmundy

I'm trying to track down a bug that is causing Asterisk to crash. With a good backtrace we are starting to point the finger at sqlite. I filed a bug report and stated that we're using the libraries included with the Linux distro, until I found out that's not entirely true.

https://issues.asterisk.org/jira/browse/ASTERISK-23680
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
SQLite 2 is now used by Asterisk. SQLite is the culprit.
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,534
Reaction score
727
Had a quick chat on irc:
Code:
12:33:52          me | Isn't the asterisk keystore using sqlite?  
12:34:04    @mjordan | no problem. And no, we use SQLite3 (there's a difference)

Still lacking clarity on this one.
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,381
Reaction score
436
Any risk in just disabling it through the no load modules option?
 

tm1000

Schmoozecom INC/FreePBX
Joined
Dec 1, 2009
Messages
1,360
Reaction score
78
Asterisk would be unable to function. SQLITE is used as the Asterisk Internal Database.

Any risk in just disabling it through the no load modules option?
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
No idea. we can use any version of sqlite and v2 has been with us for a while Looking at your traceback it appears that you are using 64 bit OS right?

I am away from my linux dev system so I will have to see if the sqllite3 libraries are about


Tom
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,534
Reaction score
727
It looks to me like Asterisk is building its core against sqlite3 (corresponds with the comment mjordan made on IRC) and some other module(s) are building against the sqlite2 that is being installed from the piaf repo.

sqlite2 dates back to 2007 so I sure *hope* nothing in the system still need it.
 
Joined
Aug 3, 2013
Messages
10
Reaction score
9
Hey everyone:

The crash that occurred indicated that there was a memory corruption in libsqlite, hence why it got closed. As I mentioned in IRC, there isn't much Asterisk can do in that kind of situation - we asked the library to execute a SQL statement, and in response, the library blew up. There's even a fair amount of defensive code around that particular statement - res_config_sqlite uses a mutex around the database to prevent concurrent attempts to the database (making this some rather unperformant code, but at least as "safe" as we can make it). You can try running Asterisk under valgrind, but again, the memory corruption is in an external library - so even if valgrind catches something, it is highly unlikely that we'd be able to do anything about it.

As billsimon pointed out, Asterisk does not use SQLite as its internal database - it uses SQLite3. SQLite (which is actually version 2) and SQLite3 are fundamentally different beasts, as noted here: http://www.sqlite.org/version3.html

If you want to use SQLite3 as a backend for CDRs or as a configuration backend data store, res_config_sqlite3 is the module you need, *not* res_config_sqlite. The AstDB code doesn't need res_config_sqlite3, as it interfaces with the SQLite3 APIs directly.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
billsimon: Adding the following entries to /etc/asterisk/modules.conf and restarting Asterisk reportedly resolves the lockup problems. This mod is included in current downloads of PIAF-Green, and SQLite 3 is automatically installed as part of all new builds. Sorry for the confusion.

Code:
; Don't load SQLite modules because of crashes with heavy call volumes
; SQLite is only used for the PIAF Registry and isn't needed for Asterisk
noload => cdr_sqlite.so
noload => res_config_sqlite.so
;
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,381
Reaction score
436
Thanks wardmundy that was what I was looking for because some of my builds are a bit older. I have not seen this problem but would prefer not to.
 

Capstone Works

New Member
Joined
Apr 1, 2014
Messages
24
Reaction score
0
We were having this exact problem, and we've excluded the modules just now... we'll see if our issue goes away. In the mean time, I have a questions re: Ward's comment that "SQLite is only used for the PIAF Registry and isn't needed for Asterisk" If we do not load the res_config_sqlite.so, are updates through the PBXiaf process unavailable?
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
one has nothing to do with the other. Updates are *independent* of the sqlite.so
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top