[sqlite] Segmentation fault can result from setting error message parameter to NULL when calling sqlite3session_diff

2019-05-20 Thread Micah Moore
Hello, We have found a minor bug in the session extension. The problem can occur in sqlite3session_diff, when there is a table schema mismatch, if no error pointer is provided. According to the documentation of sqlite3session_diff: > ** If the operation successful, SQLITE_OK is returned.

Re: [sqlite] Segmentation fault running a query

2019-03-06 Thread Richard Hipp
This is another example of the problem described by ticket https://www.sqlite.org/src/info/df46dfb631f75694 which is fixed in version 3.27.2. On 3/5/19, Peter Hardman wrote: > If i run the following query from Python 3.7 using the sqlite3 DBAPI > adapter or from sqlitebrowser I get a

Re: [sqlite] Segmentation fault running a query

2019-03-06 Thread Richard Hipp
On 3/6/19, Peter Hardman wrote: > > I've attached the database file (300K). > Attachments are stripped by the mailing list. Please send via private email directly to me. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list

Re: [sqlite] Segmentation fault running a query

2019-03-06 Thread Peter Hardman
ma to help with debugging. -Original Message- From: sqlite-users [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Tuesday, March 05, 2019 3:14 PM To: SQLite mailing list Subject: Re: [sqlite] Segmentation fault running a query On 5 Mar 2019, at 8:06pm, Pet

Re: [sqlite] Segmentation fault running a query

2019-03-06 Thread Dan Kennedy
19 3:14 PM To: SQLite mailing list Subject: Re: [sqlite] Segmentation fault running a query On 5 Mar 2019, at 8:06pm, Peter Hardman somborneshetlands.co.uk> wrote: > If i run the following query from Python 3.7 using the sqlite3 DBAPI adapter or from sqlitebrowser I get a segmentation faul

Re: [sqlite] Segmentation fault running a query

2019-03-06 Thread Keith Medcalf
chard Hipp >Sent: Wednesday, 6 March, 2019 04:31 >To: SQLite mailing list >Subject: Re: [sqlite] Segmentation fault running a query > >On 3/6/19, Peter Hardman wrote: >> >> The schema (of a very much cut down database) is attached. > >I translated the attached sc

Re: [sqlite] Segmentation fault running a query

2019-03-06 Thread Richard Hipp
On 3/6/19, Peter Hardman wrote: > > The schema (of a very much cut down database) is attached. I translated the attached schema into SQL and appended the query. I uploaded the result to https://sqlite.org/tmp/peter-hardman-001.txt I have run the resulting script through every version of SQLite

[sqlite] Segmentation fault running a query

2019-03-06 Thread Peter Hardman
- From: sqlite-users [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Tuesday, March 05, 2019 3:14 PM To: SQLite mailing list Subject: Re: [sqlite] Segmentation fault running a query On 5 Mar 2019, at 8:06pm, Peter Hardman wrote: > If i

Re: [sqlite] Segmentation fault running a query

2019-03-05 Thread David Raymond
: [sqlite] Segmentation fault running a query On 5 Mar 2019, at 8:06pm, Peter Hardman wrote: > If i run the following query from Python 3.7 using the sqlite3 DBAPI adapter > or from sqlitebrowser I get a segmentation fault. Please find the SQLite command-line tool on your computer. If you

Re: [sqlite] Segmentation fault running a query

2019-03-05 Thread Simon Slavin
On 5 Mar 2019, at 8:06pm, Peter Hardman wrote: > If i run the following query from Python 3.7 using the sqlite3 DBAPI adapter > or from sqlitebrowser I get a segmentation fault. Please find the SQLite command-line tool on your computer. If you don't already have one you can download one for

[sqlite] Segmentation fault running a query

2019-03-05 Thread Peter Hardman
If i run the following query from Python 3.7 using the sqlite3 DBAPI adapter or from sqlitebrowser I get a segmentation fault. The query runs error free on PostgreSQL 9.6 The query fails if the 'in' list has more than two entries. Any ideas? I could create a test database but it will take a

Re: [sqlite] Segmentation fault when using window function with (nested?) subquery

2018-12-06 Thread Richard Hipp
On 12/6/18, Larry Brasfield wrote: > > The above fault and non-fault also occur on Windows 10 x64 (with a 64-bit > build) with the SQLite3 v3.26 shell. I can provide build options and > compile flags if that would be useful. Thanks, but I have no trouble reproducing the problem. It is an issue

Re: [sqlite] Segmentation fault when using window function with (nested?) subquery

2018-12-06 Thread Larry Brasfield
Gene Sacky wrote: > This query causes segmentation fault in SQLite 3.26.0 (on macOS 10.14.1). > -- > SELECT * FROM( > SELECT * FROM (SELECT 1 AS c) WHERE c IN ( > SELECT (row_number() OVER()) FROM (VALUES (0)) > ) > ) > -- > > However, no error occurs in

[sqlite] Segmentation fault when using window function with (nested?) subquery

2018-12-06 Thread Gene Sacky
This query causes segmentation fault in SQLite 3.26.0 (on macOS 10.14.1). -- SELECT * FROM( SELECT * FROM (SELECT 1 AS c) WHERE c IN ( SELECT (row_number() OVER()) FROM (VALUES (0)) ) ) -- However, no error occurs in the following queries. The only

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-09 Thread Jeremy Evans
On 11/09 09:26, Richard Hipp wrote: > On 11/7/18, Jeremy Evans wrote: > > The following SQL causes a segmentation fault on: > > Thank you for the bug report and reproducible test case. > > The problem actually had nothing to do with window functions. The use > of window functions merely made

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-09 Thread Simon Slavin
On 9 Nov 2018, at 3:35pm, Dennis Clarke wrote: > The list mail server sends this out about thirty times. I saw just one copy, so I think the problem is nearer your end of the route. Simon. ___ sqlite-users mailing list

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-09 Thread Richard Hipp
On 11/9/18, Dennis Clarke wrote: > The list mail server sends this out about thirty times. Not sure if > anyone else sees abusive duplicates from the sqlite mail list server > but I certainly do. If you will send me headers to a few of this message by private email, I will try to debug it. --

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-09 Thread Stephen Chrzanowski
I'm only seeing the one email, no duplicates. On Fri, Nov 9, 2018 at 10:35 AM Dennis Clarke wrote: > On 11/08/2018 04:05 PM, Richard Hipp wrote: > > In case you are not following the ticket at... > > > > The list mail server sends this out about thirty times. Not sure if > anyone else sees

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-09 Thread David Raymond
list Cc: c...@jeremyevans.net Subject: Re: [sqlite] Segmentation Fault When Using Window Function On 11/7/18, Jeremy Evans wrote: > The following SQL causes a segmentation fault on: Thank you for the bug report and reproducible test case. The problem actually had nothing to do with win

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-09 Thread Dennis Clarke
On 11/08/2018 04:05 PM, Richard Hipp wrote: In case you are not following the ticket at... The list mail server sends this out about thirty times. Not sure if anyone else sees abusive duplicates from the sqlite mail list server but I certainly do. Dennis

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-09 Thread Richard Hipp
On 11/7/18, Jeremy Evans wrote: > The following SQL causes a segmentation fault on: Thank you for the bug report and reproducible test case. The problem actually had nothing to do with window functions. The use of window functions merely made the bug easier to hit. The bug has gone undetected

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-08 Thread Richard Hipp
On 11/8/18, J. King wrote: > On 2018-11-08 16:05:11, "Richard Hipp" wrote: > >>In case you are not following the ticket at >>https://www.sqlite.org/src/tktview/787fa716be3a7f650cac1b1413f12f95f5e7639d, >>we have simplified the test case to the following: >> > > Richard, > My mail client appears

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-08 Thread J. King
On 2018-11-08 16:05:11, "Richard Hipp" wrote: In case you are not following the ticket at https://www.sqlite.org/src/tktview/787fa716be3a7f650cac1b1413f12f95f5e7639d, we have simplified the test case to the following: Richard, My mail client appears to have exposed a bug in Fossil. In

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-08 Thread Richard Hipp
In case you are not following the ticket at https://www.sqlite.org/src/tktview/787fa716be3a7f650cac1b1413f12f95f5e7639d, we have simplified the test case to the following: CREATE TABLE t5(a, b, c, d); CREATE INDEX t5a ON t5(a); CREATE INDEX t5b ON t5(b); CREATE TABLE t6(e); INSERT INTO t6

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-08 Thread Olivier Mascia
Hello, Without me knowing if it is related to your problem, I wonder what's the intent here? > SELECT `artists`.* > FROM `artists` > INNER JOIN `artists` AS 'b' ON (`b`.`id` = `artists`.`id`) -- Best Regards, Meilleures salutations, Met vriendelijke groeten, Olivier Mascia

Re: [sqlite] Segmentation Fault When Using Window Function

2018-11-08 Thread David Raymond
To: sqlite-users@mailinglists.sqlite.org Subject: [sqlite] Segmentation Fault When Using Window Function The following SQL causes a segmentation fault on: * OpenBSD -current (3.25.1 and 3.25.3) * MacOS 10.14 (3.25.2) No segmentation fault using the precompiled Windows binary, though. CREATE

[sqlite] Segmentation Fault When Using Window Function

2018-11-08 Thread Jeremy Evans
The following SQL causes a segmentation fault on: * OpenBSD -current (3.25.1 and 3.25.3) * MacOS 10.14 (3.25.2) No segmentation fault using the precompiled Windows binary, though. CREATE TABLE `artists` ( `id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, `name` varchar(255) ); CREATE TABLE

Re: [sqlite] segmentation fault in sqlite api call

2018-10-22 Thread Olivier Mascia
Your query string is ~ 61 characters (did not count precisely), not including the key length not the value length. Are you sure the real tests you run do not overflow the fixed buffer char query[200] which can hold no more than 199 characters? You would have huge problems as soon as

Re: [sqlite] segmentation fault in sqlite api call

2018-10-21 Thread Ratheendran R
Thanks Olivier Mascia for the tips and suggestion I will definitely try out. sorry for the code with the double pointer which has raised lot of confusion I ensured this fault raised is not beacuse of any of my pointer usage . I am having a workaround with key/value memory allocation in heap and

Re: [sqlite] segmentation fault in sqlite api call

2018-10-21 Thread Keith Medcalf
o: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] segmentation fault in sqlite api call > >Hi, > >I am a embedded engineer and new to sqlite,we want to use sqlite for >our >local storage instead of file i/o. > >I have created a table with key and value records of char type,now i

Re: [sqlite] segmentation fault in sqlite api call

2018-10-21 Thread Peter da Silva
You're passing a char * to a routine that expects a char **, and then immediately trying to indirect through it, which means it's taking the text, treating it as a pointer, and passing the random data it's pointing to as a string to sqlite. On Sun., 21 Oct. 2018, 11:55 Ratheendran R, wrote: >

Re: [sqlite] segmentation fault in sqlite api call

2018-10-21 Thread Larry Brasfield
The code you provided declares and defines a pointer, named ‘db’ in main(), which is used with the SQLite API but never made to point to a valid object in memory or even to allocated memory. Hence your segmentation fault. ___ sqlite-users mailing

Re: [sqlite] segmentation fault in sqlite api call

2018-10-21 Thread Olivier Mascia
Hi, mydef_set probably overflows your 'query' variable of which you don't show declaration but I guess it is 200 bytes seeing your memset(query,0,200); strcpy(query, ... This above and why this char** buffer in mydef_set prototype? Think about what your intent was. Compare to what you did

[sqlite] segmentation fault in sqlite api call

2018-10-21 Thread Ratheendran R
Hi, I am a embedded engineer and new to sqlite,we want to use sqlite for our local storage instead of file i/o. I have created a table with key and value records of char type,now if I try store a value with string length more than 50 char I get segmentation fault,please see the code below and

[sqlite] Segmentation fault in 3.22 eval.c under PRAGMA empty_result_callbacks=1

2018-02-14 Thread petern
sqlite> .version SQLite 3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt1 zlib version 1.2.8 gcc-4.8.4 sqlite> .load eval.so sqlite> PRAGMA empty_result_callbacks=1; sqlite> SELECT eval('SELECT 1 WHERE 0'); ... Segmentation fault If a new protection line

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread Richard Hipp
Thanks. I'm still unable to get SQLite 3.15.0 to fail, in any way, using your schema and data. Do you have any further hints on how I can cause the problem to be expressed? Is assertion fault reliably reproduced on your system? On 11/1/16, mark wrote: > On Tue Nov 01, 2016 at

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread nomad
On Tue Nov 01, 2016 at 03:15:43PM +, Simon Slavin wrote: > > On 1 Nov 2016, at 3:14pm, Rob Willett > wrote: > > > We use the Perl DBD module all the time. What I would expect to see > > is [... good stuff ...] > > Ah, thanks for the explanation. I always had

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread Simon Slavin
On 1 Nov 2016, at 3:14pm, Rob Willett wrote: > We use the Perl DBD module all the time. What I would expect to see is [... > good stuff ...] Ah, thanks for the explanation. I always had trouble understanding Perl's approach to anything. Hope the OP's problem

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread Rob Willett
Simon, We use the Perl DBD module all the time. What I would expect to see is (IGNORE THE LINE BREAKS) my $sth = $dbh->prepare("INSERT INTO func_begin_change( author, author_contact, author_contact_method, author_shortname,

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread Simon Slavin
> On 1 Nov 2016, at 2:38pm, mark wrote: > >VALUES >( >?, >?, >?, >?, >?, >?, >?, >?, >? >) >; > > At least that is what I am passing to Perl's

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread mark
On Tue Nov 01, 2016 at 09:21:04AM -0400, Richard Hipp wrote: > > The text of the SQL that is being prepared got cut off. Can you > please send me the complete SQL statement that is being run at the > point of the error? INSERT INTO func_begin_change( author,

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread Richard Hipp
On 10/31/16, mark wrote: > #18 0x17d970826118 in sqlite3RunParser (pParse=0x7f7e9200, > zSql=0x17db9b16a600 "INSERT INTO\nfunc_begin_change(\n > author,\nauthor_contact,\nauthor_contact_method,\n > author_shortname,\nid,\n

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread Richard Hipp
On 10/31/16, mark wrote: > #3 0x17d9707fb288 in valueFromExpr (db=0x17dbbac8e808, > pExpr=0x17dc0252b288, enc=1 '\001', affinity=68 'D', > ppVal=0x7f7e7f08, > pCtx=0x7f7e7f70) at sqlite3.c:70020 > #4 0x17d9707fbaa0 in stat4ValueFromExpr

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread mark
On Tue Nov 01, 2016 at 02:21:02AM +0100, mark wrote: > assertion "0" failed: file "sqlite3.c", line 70020, function > "valueFromExpr" I read the source code a little further and found that the NEVER at line 70020 is actually a macro: if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;

Re: [sqlite] Segmentation fault on OpenBSD

2016-11-01 Thread mark
On Mon Oct 31, 2016 at 05:42:32PM -0400, Richard Hipp wrote: > On 10/31/16, mark wrote: > > On Mon Oct 31, 2016 at 04:04:00PM -0400, Richard Hipp wrote: > >> Is this reproducible? > > > > Yes... in that I can reliably get it to segfault. Duplicating the build > > and/or statements

Re: [sqlite] Segmentation fault on OpenBSD

2016-10-31 Thread Richard Hipp
On 10/31/16, mark wrote: > On Mon Oct 31, 2016 at 04:04:00PM -0400, Richard Hipp wrote: >> Is this reproducible? > > Yes... in that I can reliably get it to segfault. Duplicating the build > and/or statements leading up to the fault outside of my environment > is not so easy.

Re: [sqlite] Segmentation fault on OpenBSD

2016-10-31 Thread Richard Hipp
Is this reproducible? Can you share with us the schema of the database file that was connected when this error occurred? On 10/31/16, mark wrote: > Operating system: OpenBSD 6.0 > DBD::SQLite: 1.51_06 > sqlite:3.15.0 > > Program received signal SIGSEGV,

[sqlite] Segmentation fault on OpenBSD

2016-10-31 Thread mark
Operating system: OpenBSD 6.0 DBD::SQLite: 1.51_06 sqlite:3.15.0 Program received signal SIGSEGV, Segmentation fault. sqlite3Step (p=0xb1480c37e08) at sqlite3.c:82102 82102 pCrsr = pC->uc.pCursor; (gdb) list 82097 82098 assert( pOp->p1>=0 && pOp->p1nCursor ); 82099

Re: [sqlite] Segmentation fault in command line using aggregate function in column default value

2014-08-05 Thread Clemens Ladisch
Zsbán Ambrus wrote: > CREATE TABLE tab(amt DEFAULT (max(1))); SQLite also accepts parameters: CREATE TABLE t(x DEFAULT(?)); (Other places like CHECK constraints do check for this, so this appears to be an oversight.) Regards, Clemens ___

Re: [sqlite] Segmentation fault in command line using aggregate function in column default value

2014-08-05 Thread Richard Hipp
On Tue, Aug 5, 2014 at 4:55 PM, Richard Hipp wrote: > > > > On Tue, Aug 5, 2014 at 4:15 PM, Zsbán Ambrus wrote: > >> Dear sqlite3 maintainers, >> >> I've got a segmentation fault when trying to execute the following two >> statements in the sqlite 3.8.5

Re: [sqlite] Segmentation fault in command line using aggregate function in column default value

2014-08-05 Thread Simon Slavin
On 5 Aug 2014, at 9:15pm, Zsbán Ambrus wrote: > CREATE TABLE tab(amt DEFAULT (max(1))); INSERT INTO tab DEFAULT VALUES; How on earth did you find that ? Nice catch, by the way. If Dr. Hipp is correct, that's a bug which has existed for longer than 8 years, or probably

Re: [sqlite] Segmentation fault in command line using aggregate function in column default value

2014-08-05 Thread Richard Hipp
On Tue, Aug 5, 2014 at 4:15 PM, Zsbán Ambrus wrote: > Dear sqlite3 maintainers, > > I've got a segmentation fault when trying to execute the following two > statements in the sqlite 3.8.5 command line program: > > CREATE TABLE tab(amt DEFAULT (max(1))); INSERT INTO tab

[sqlite] Segmentation fault in command line using aggregate function in column default value

2014-08-05 Thread Zsbán Ambrus
Dear sqlite3 maintainers, I've got a segmentation fault when trying to execute the following two statements in the sqlite 3.8.5 command line program: CREATE TABLE tab(amt DEFAULT (max(1))); INSERT INTO tab DEFAULT VALUES; I believe this is a bug, because the vanilla command line should not

Re: [sqlite] Segmentation Fault With Trigger

2013-10-15 Thread Dominique Pellé
techi eth wrote: You should compile your code & sqlite3.c with -g -O0 when sending a stack trace. Most likely, the bug is in your program. Since you're on Linux, try running with valgrind memcheck tool to find bugs (access to free memory, uninitialized memory, etc.) If you compile with

Re: [sqlite] Segmentation Fault With Trigger

2013-10-15 Thread Ryan Johnson
I'm not an sqlite3 dev, but I don't think you'll get much help until you provide enough information for somebody to see what is going wrong. You were already asked to provide a backtrace from a debug-compiled sqlite3 library (the backtrace you sent is all but useless). A self-contained .c

Re: [sqlite] Segmentation Fault With Trigger

2013-10-14 Thread techi eth
Please provide me hint to solve the issue. Thanks.. On Fri, Oct 11, 2013 at 7:58 PM, techi eth wrote: > It is giving same trace what i have sent last time. > > It is possible by some one to send test code snapshot of scenario of > selecting user defined function while

Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
It is giving same trace what i have sent last time. It is possible by some one to send test code snapshot of scenario of selecting user defined function while trigger execution. Thanks a lot... On Fri, Oct 11, 2013 at 7:41 PM, Richard Hipp wrote: > On Fri, Oct 11, 2013 at

Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
Data Info is not an problem.I am passing data information for building query before passing to sqlite exec function.If i remove trigger for insert then my code is working perfectly fine. My assumption is it is due to selecting function during trigger.Please suggest hint by looking sequence

Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread Stephan Beal
On Fri, Oct 11, 2013 at 4:06 PM, techi eth wrote: > > #4 0x778e1127 in SqliteTestInsert (SQLitePrivate=0x602300, > > TableName_p=0x4019a0 "dbTestTbl", DataInfoList=0x4) > There's the problem: DataInfoList is an invalid pointer. i have no idea what that is, but it's

Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread Richard Hipp
On Fri, Oct 11, 2013 at 10:06 AM, techi eth wrote: > Please provide some hint. > Recompile with -O0 and -g and then post the stack trace after the segfault. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list

Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
Please provide some hint.I have added some more details about function definition & query. /* Create function definition */ static void Test(sqlite3_context *context, int argc, sqlite3_value **argv) { printf ("Trigger Function Called\n"); if (argc == 1) { char *text =

Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
Please find below : #0 0x7fffe0b8 in ?? () #1 0x776988f6 in ?? () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 #2 0x7769e451 in sqlite3_step () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 #3 0x776a1e4c in sqlite3_exec () from

Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread Richard Hipp
On Fri, Oct 11, 2013 at 7:57 AM, techi eth wrote: > Hi, > > I am getting segmentation fault while executing query in sqlite3. [Linux > OS]. > Can you send us a stack trace? > > Find below sequence. > > // Getting SQLiteHandler > > OpenConnection (); > > //Creating user

[sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
Hi, I am getting segmentation fault while executing query in sqlite3. [Linux OS]. Find below sequence. // Getting SQLiteHandler OpenConnection (); //Creating user defined function “Test” sqlite3_create_function(SQLiteHandler, "Test",1, SQLITE_UTF8, NULL, , NULL, NULL) //Creating table,Below

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread kenichi ishigaki
mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp > Sent: Thursday, August 29, 2013 11:58 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] segmentation fault with 3.8.0 > > On Thu, Aug 29, 2013 at 11:47 AM, Marc L. Allen <mlal...@outsitenetworks.co

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Marc L. Allen
Database Subject: Re: [sqlite] segmentation fault with 3.8.0 On Thu, Aug 29, 2013 at 11:47 AM, Marc L. Allen <mlal...@outsitenetworks.com > wrote: > Silly question.. I looked at the fix. Why ignore indexes with greater > than 4 fields? Isn't that a bit risky? Wouldn't it be better

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Dan Kennedy
To: General Discussion of SQLite Database Subject: Re: [sqlite] segmentation fault with 3.8.0 On Thu, Aug 29, 2013 at 11:32 AM, Stephen Chrzanowski <pontia...@gmail.com>wrote: My guess is single quotes instead of double quotes. Where exactly is the seg fault? Untested but other than the

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Richard Hipp
On Thu, Aug 29, 2013 at 11:47 AM, Marc L. Allen wrote: > Silly question.. I looked at the fix. Why ignore indexes with greater > than 4 fields? Isn't that a bit risky? Wouldn't it be better to ignore > the fields after the 4th one for planning? > The

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Marc L. Allen
] On Behalf Of Richard Hipp Sent: Thursday, August 29, 2013 11:38 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] segmentation fault with 3.8.0 On Thu, Aug 29, 2013 at 11:32 AM, Stephen Chrzanowski <pontia...@gmail.com>wrote: > My guess is single quotes instead of doub

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Richard Hipp
On Thu, Aug 29, 2013 at 11:38 AM, Richard Hipp wrote: > > > A patch release 3.8.0.1 that includes this fix and fixes for two other > equally obscure corner cases is currently in test and is expected to go out > later today. > > Complete set of diffs for the proposed patch

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Richard Hipp
On Thu, Aug 29, 2013 at 11:32 AM, Stephen Chrzanowski wrote: > My guess is single quotes instead of double quotes. Where exactly is the > seg fault? Untested but other than the quotes, everything looks fine. > The problem is described here:

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Stephen Chrzanowski
My guess is single quotes instead of double quotes. Where exactly is the seg fault? Untested but other than the quotes, everything looks fine. On Thu, Aug 29, 2013 at 4:07 AM, kenichi ishigaki wrote: > Hi. I've just got a segmentation fault report with SQLite 3.8.0 from

[sqlite] segmentation fault with 3.8.0

2013-08-29 Thread kenichi ishigaki
Hi. I've just got a segmentation fault report with SQLite 3.8.0 from one of the perl binding users. The following set of SQL statements should reporduce the issue. Regards, Kenichi Ishigaki CREATE TABLE "twokeys" ( "artist" integer NOT NULL, "cd" integer NOT NULL, PRIMARY KEY ("artist", "cd")

Re: [sqlite] Segmentation fault in SQLite parser

2013-05-01 Thread Richard Hipp
On Wed, May 1, 2013 at 9:27 AM, Klaas V wrote: > Eelco wrote: > Using version 3.7.16.2 > select * from ((select * from x)) y; > Segmentation fault > > > On OSX we get 'Bus error'. Thanks for the report. This bug has already been fixed. See

Re: [sqlite] Segmentation fault in SQLite parser

2013-05-01 Thread Klaas V
Eelco wrote:  Using version 3.7.16.2 select * from ((select * from x)) y; Segmentation fault On OSX we get 'Bus error'. Not a bug, because you were syntactical not exact enough. See http://www.sqlite.org/lang_select.html  You're supposed to use only one pair () not more. Before 3.7.15 or 16

[sqlite] Segmentation fault in SQLite parser

2013-04-30 Thread Eelco Dolstra
Hi, I ran into the following regression after upgrading from SQLite 3.7.14.1 to 3.7.16.2: the SQLite parser crashes when it encounters a subquery enclosed in double parentheses. For example: $ sqlite3 SQLite version 3.7.16.2 2013-04-12 11:52:43 Enter ".help" for instructions Enter SQL

Re: [sqlite] Segmentation Fault when calling sqlite3_finalize

2012-05-31 Thread Stephen Wood
That is actually how I originally wrote the function, but when I started having the segmentation faults I thought maybe I was mistaken on that count and rewrote it with the call to the step function. Thanks for the tip! On Thu, May 31, 2012 at 11:31 AM, Dan Kennedy wrote:

Re: [sqlite] Segmentation Fault when calling sqlite3_finalize

2012-05-31 Thread Dan Kennedy
On 05/31/2012 10:46 PM, Stephen Wood wrote: Hello all, I'm having some memory allocation difficulties while using the SQLite C API. The goal of the function that is currently giving me issues is just trying to read the column names from a table. Tip: Column names are available after

Re: [sqlite] Segmentation Fault when calling sqlite3_finalize

2012-05-31 Thread Stephen Wood
users-boun...@sqlite.org [mailto: > sqlite-users-boun...@sqlite.org] On Behalf Of Stephen Wood > Sent: Thursday, May 31, 2012 11:47 AM > To: sqlite-users@sqlite.org > Subject: [sqlite] Segmentation Fault when calling sqlite3_finalize > > Hello all, > I'm having some memory allocatio

Re: [sqlite] Segmentation Fault when calling sqlite3_finalize

2012-05-31 Thread Marc L. Allen
: [sqlite] Segmentation Fault when calling sqlite3_finalize Hello all, I'm having some memory allocation difficulties while using the SQLite C API. The goal of the function that is currently giving me issues is just trying to read the column names from a table. I have been having other memory

[sqlite] Segmentation Fault when calling sqlite3_finalize

2012-05-31 Thread Stephen Wood
Hello all, I'm having some memory allocation difficulties while using the SQLite C API. The goal of the function that is currently giving me issues is just trying to read the column names from a table. I have been having other memory allocation faults elsewhere, but I currently have it isolated to

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-05 Thread Marcus Grimm
>> > change this code: >> > typedef struct NiuRoutingStruct { >> > sqlite3_vtab vtab; >> > } NiuRouting; >> > to this: >> > struct NiuRouting : public sqlite3_vtab vtab { >> > ... // your implementation, eventually >> > }; >> > >> > This way, the casting is

[sqlite] Segmentation fault on sqlite3_create_module

2012-02-04 Thread larry_brasfield
> > change this code: > > typedef struct NiuRoutingStruct { > > sqlite3_vtab vtab; > > } NiuRouting; > > to this: > > struct NiuRouting : public sqlite3_vtab vtab { > > ... // your implementation, eventually > > }; > > > > This way, the casting is unnecessary

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Marcus Grimm
> Stephan Beal wrote: >> 2012/2/3 Jorge Eliécer Osorio Caro >> >> >*ppVTab = (sqlite3_vtab*) nr; >> > ((sqlite3_vtab*) nr)->zErrMsg = NULL; >> > >> >> Please try changing those to the variants from my previous post. i'm not >> 100% convinced that that cast is strictly

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Larry Brasfield
Stephan Beal wrote: 2012/2/3 Jorge Eliécer Osorio Caro >*ppVTab = (sqlite3_vtab*) nr; > ((sqlite3_vtab*) nr)->zErrMsg = NULL; > Please try changing those to the variants from my previous post. i'm not 100% convinced that that cast is strictly legal in C++. It will

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Larry Brasfield
Marcus wrote: >> So, you might have a calling convencion issue... >> >> Just a guess, though. > > The sqlite3.h header has proper, "extern "C" {" wrappers around its > declarations, guarded by "#ifdef __cplusplus", so this is not an issue. > It is perfectly reasonable to call into the SQLite

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Marcus Grimm
> Marcus wrote: >> Just a guess: >> It looks you are compiling/using c++, on Windows that wouldn't work >> if the sqlite library is compiled as C (which is the usual case). >> >> So, you might have a calling convencion issue... >> >> Just a guess, though. > > The sqlite3.h header has proper,

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Larry Brasfield
Marcus wrote: Just a guess: It looks you are compiling/using c++, on Windows that wouldn't work if the sqlite library is compiled as C (which is the usual case). So, you might have a calling convencion issue... Just a guess, though. The sqlite3.h header has proper, "extern "C" {" wrappers

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Marcus Grimm
> Hi, > > I do this: > > const char *table_structure = "CREATE TABLE network (vertex_id INTEGER);"; > if (sqlite3_declare_vtab(db, table_structure) == SQLITE_OK) { > nr = (NiuRouting*) sqlite3_malloc(sizeof (NiuRouting)); > > if (nr == NULL) { >

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Stephan Beal
2012/2/3 Jorge Eliécer Osorio Caro >*ppVTab = (sqlite3_vtab*) nr; > ((sqlite3_vtab*) nr)->zErrMsg = NULL; > Please try changing those to the variants from my previous post. i'm not 100% convinced that that cast is strictly legal in C++.

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Jorge Eliécer Osorio Caro
Hi, I do this: const char *table_structure = "CREATE TABLE network (vertex_id INTEGER);"; if (sqlite3_declare_vtab(db, table_structure) == SQLITE_OK) { nr = (NiuRouting*) sqlite3_malloc(sizeof (NiuRouting)); if (nr == NULL) { //*pzErr =

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Stephan Beal
On Fri, Feb 3, 2012 at 8:25 PM, Stephan Beal wrote: > i take that back - if that were the case then the crash would almost > certainly happen later on (after your init routine returns). But it still > can't hurt to try. > But please try this: nr = (NiuRouting*)

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Stephan Beal
On Fri, Feb 3, 2012 at 8:22 PM, Stephan Beal wrote: > sqlite3_declare_vtab()[1] does not document the lifetime requirements of > the string passed to it, and it's "conceivable" that the lifetime of the > table_structure string is the problem. > i take that back - if that

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Stephan Beal
2012/2/3 Jorge Eliécer Osorio Caro > Yes, that's my code: > > http://paste.ideaslabs.com/show/OPNHBY7xPG > > this the backtrace: > > #0 0x0001001701d3 in initialize_niurouting () > Can you try the following (but i'm just guessing here); std::cerr <<

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Jorge Eliécer Osorio Caro
Yes, that's my code: http://paste.ideaslabs.com/show/OPNHBY7xPG this the backtrace: #0 0x0001001701d3 in initialize_niurouting () #1 0x0001001709d5 in sqlite3_extension_init () #2 0x0001000499a3 in sqlite3_load_extension (db=0x100200090, zFile=0x10020f206

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Stephan Beal
2012/2/3 Jorge Eliécer Osorio Caro > OK there is the trace: > > Program received signal EXC_BAD_ACCESS, Could not access memory. > Reason: KERN_INVALID_ADDRESS at address: 0x03b8 > 0x00010017024b in initialize_niurouting () > That's the reason for

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Jorge Eliécer Osorio Caro
OK there is the trace: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x03b8 0x00010017024b in initialize_niurouting () 2012/2/3 Stephan Beal > 2012/2/3 Jorge Eliécer Osorio Caro

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Stephan Beal
2012/2/3 Jorge Eliécer Osorio Caro > Ok, tthanks Stepha, how i can do that? i compile sqlite like ./configure > --enable-debug but i cant do a trace to see what happend > Assuming you're on a Linux (or similar) platform you can try: gdb --args sqlite3 dbfile then

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Jorge Eliécer Osorio Caro
Ok, tthanks Stepha, how i can do that? i compile sqlite like ./configure --enable-debug but i cant do a trace to see what happend 2012/2/3 Stephan Beal > But finding out exactly where it fails requires either adding debug output > to the plug or running it (in this case

Re: [sqlite] Segmentation fault on sqlite3_create_module

2012-02-03 Thread Stephan Beal
But finding out exactly where it fails requires either adding debug output to the plug or running it (in this case the sqlite shell) through a debugger. - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal On Feb 3, 2012 4:35 PM, "Jorge Eliécer Osorio Caro" <

  1   2   >