FTS5 bug in SQLite 3.18.0

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FTS5 bug in SQLite 3.18.0

Krzysztof Małysa
When SQLIte is compiled with sanitizers they report invalid readouts and
undefined-behavior:
```

sqlite3.c:188900:5: runtime error: index 11 out of bounds for type 'char
[8]'
SUMMARY: AddressSanitizer: undefined-behavior sqlite3.c:188900:5 in
sqlite3.c:189142:30: runtime error: index 12 out of bounds for type 'char
[8]'
SUMMARY: AddressSanitizer: undefined-behavior sqlite3.c:189142:30 in
sqlite3.c:184801:14: runtime error: null pointer passed as argument 1,
which is declared to never be null
/usr/include/string.h:62:62: note: nonnull attribute specified here
SUMMARY: AddressSanitizer: undefined-behavior sqlite3.c:184801:14 in
```
Compilation command:
```
$ clang 4.c sqlite3.c -o 4 -pthread -ldl -lm -DSQLITE_ENABLE_FTS5
-fsanitize=address -fsanitize=undefined
```


Additional information:
```
$ clang -v
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64


$ uname -a
Linux quasarHP 4.4.0-77-generic #98-Ubuntu SMP Wed Apr 26 08:34:02 UTC 2017
x86_64 x86_64 x86_64 GNU/Linux
```


This behaviour appeared in the earlier versions of SQLite, for sure in


Hope this helps,
Krzysztof Małysa
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...