Modify

Opened 7 years ago

Closed 7 years ago

#8305 closed defect (fixed)

lsqlite3 Segmentation Fault

Reported by: Dmitry Krylov <dmalkr@…> Owned by: developers
Priority: high Milestone: Backfire 10.03.1
Component: packages Version: Backfire 10.03.1 RC3
Keywords: lua sqlite sqlite3 Cc:

Description

I had installed lsqlite3:

opkg update
opkg install lsqlite3

then I has wrote this program:

require('lsqlite3')
db=sqlite3.open('test.db')
db:close()

and try to run this:

# lua test.lua
Segmentation fault

then I try to do this in lua interpreter:

# lua 
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio (float int32)
> require('lsqlite3')
> sqlite3.version()
Segmentation fault
#

This is strace (strace lua test.lua):

# strace lua test.lua 
execve("/usr/bin/lua", ["lua", "test.lua"], [/* 8 vars */]) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
stat("/etc/ld.so.cache", 0x7fff7a50)    = -1 ENOENT (No such file or directory)
open("/lib/liblua.so.5.1.4", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/lib/liblua.so.5.1.4", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/usr/lib/liblua.so.5.1.4", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=207815, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaaf000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0pB\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 274432, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aabf000
old_mmap(0x2aabf000, 203284, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aabf000
old_mmap(0x2ab00000, 7111, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x31000) = 0x2ab00000
close(3)                                = 0
munmap(0x2aaaf000, 4096)                = 0
open("/lib/libm.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=103307, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaaf000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\360\24\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 172032, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab02000
old_mmap(0x2ab02000, 102828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab02000
old_mmap(0x2ab2b000, 907, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x19000) = 0x2ab2b000
close(3)                                = 0
munmap(0x2aaaf000, 4096)                = 0
open("/lib/libcrypt.so.0", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=9970, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaaf000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0p\4\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 147456, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab2c000
old_mmap(0x2ab2c000, 9896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab2c000
old_mmap(0x2ab3e000, 1778, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x2ab3e000
old_mmap(0x2ab3f000, 68048, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ab3f000
close(3)                                = 0
munmap(0x2aaaf000, 4096)                = 0
open("/lib/libdl.so.0", O_RDONLY)       = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=8374, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaaf000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0`\10\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 77824, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab50000
old_mmap(0x2ab50000, 6512, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab50000
old_mmap(0x2ab61000, 4278, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x2ab61000
close(3)                                = 0
munmap(0x2aaaf000, 4096)                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=58778, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaaf000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0p\26\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 126976, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab63000
old_mmap(0x2ab63000, 56100, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab63000
old_mmap(0x2ab81000, 1434, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe000) = 0x2ab81000
close(3)                                = 0
munmap(0x2aaaf000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=413699, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaaf000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\240\251\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 499712, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab82000
old_mmap(0x2ab82000, 408192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab82000
old_mmap(0x2abf5000, 8195, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x63000) = 0x2abf5000
old_mmap(0x2abf8000, 15408, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2abf8000
close(3)                                = 0
munmap(0x2aaaf000, 4096)                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=58778, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=413699, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=413699, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=413699, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=413699, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=413699, ...}) = 0
close(3)                                = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=24802, ...}) = 0
mprotect(0x2ab61000, 4096, PROT_READ)   = 0
mprotect(0x2abf5000, 4096, PROT_READ)   = 0
mprotect(0x2aabd000, 4096, PROT_READ)   = 0
ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
brk(0)                                  = 0x414440
brk(0x415440)                           = 0x415440
brk(0x416000)                           = 0x416000
brk(0x417000)                           = 0x417000
brk(0x418000)                           = 0x418000
brk(0x419000)                           = 0x419000
brk(0x41a000)                           = 0x41a000
brk(0x41b000)                           = 0x41b000
open("test.lua", O_RDONLY)              = 3
ioctl(3, TIOCNXCL, 0x7fff6a48)          = -1 ENOTTY (Inappropriate ioctl for device)
brk(0x41c000)                           = 0x41c000
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0003')\ndb=sqlite3.o"..., 4096) = 58
read(3, "", 4038)                       = 0
close(3)                                = 0
rt_sigaction(SIGINT, {0x10000000, ~[HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ RT_0 RT_1 RT_2 RT_3 RT_4 RT_5 RT_6 RT_7 RT_8 RT_9 RT_10 RT_11 RT_12 RT_13 RT_14 RT_15 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_29 RT_30 RT_31 RT_32 RT_33 RT_34 RT_35 RT_36 RT_37 RT_38 RT_39 RT_40 RT_41 RT_42 RT_43 RT_44 RT_45 RT_46 RT_47 RT_48 RT_49 RT_50 RT_51 RT_52 RT_53 RT_54 RT_55 RT_56 RT_57 RT_58 RT_59 RT_60 RT_61 RT_62 RT_63 RT_64 RT_65 RT_66 RT_67 RT_68 RT_70 RT_71 RT_73 RT_75 RT_80], SA_SIGINFO|0x401010}, {SIG_DFL, [RT_68 RT_69 RT_72 RT_74 RT_75 RT_79 RT_81 RT_87], 0}, 16) = 0
open("./lsqlite3.lua", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/usr/share/lua/lsqlite3.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lua/lsqlite3/init.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/lua/lsq", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/usr/lib/lua/lsqlite3/init.lua", O_RDONLY) = -1 ENOENT (No such file or directory)
open("./lsqlite3.so", O_RDONLY)         = -1 ENOENT (No such file or directory)
open("/usr/lib/lua/lsqlite3.so", O_RDONLY) = 3
ioctl(3, TIOCNXCL, 0x7fff76d8)          = -1 ENOTTY (Inappropriate ioctl for device)
brk(0x41d000)                           = 0x41d000
close(3)                                = 0
open("/usr/lib/lua/lsqlite3.so", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0775, st_size=40846, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaaf000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\340\34\0\0004\0\0\0"..., 4096) = 4096
old_mmap(NULL, 106496, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2abfc000
old_mmap(0x2abfc000, 39332, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2abfc000
old_mmap(0x2ac15000, 3982, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x9000) = 0x2ac15000
close(3)                                = 0
munmap(0x2aaaf000, 4096)                = 0
open("/lib/liblua.so.5.1.4", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/lib/liblua.so.5.1.4", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/usr/lib/liblua.so.5.1.4", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=207815, ...}) = 0
close(3)                                = 0
open("\310v\377\177\350\256\252*gcc_s.so.1", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=58778, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=0, st_size=413699, ...}) = 0
close(3)                                = 0
open("/lib/lib\210v\377\177\350\256\252*\230n\377\177pw\377\177xn\377\177\337\324\277*/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=58778, ...}) = 0
close(3)                                = 0
open("/lib/libXn\377\177\355\324\277*/lib/libgcc_s.so.1", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=413699, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=0, st_size=0, ...})   = 0
close(3)                                = 0
open("/lib/ld-uClibc.so.0", O_RDONLY)   = 3
fstat(3, {st_mode=0, st_size=9, ...})   = 0
close(3)                                = 0
brk(0x41e000)                           = 0x41e000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault

How can I fix this??

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by jow

Was lsqlite linked with -lpthread ?

comment:2 Changed 7 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with r27263

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.