Modify

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#10204 closed defect (fixed)

uci segfault on import -m

Reported by: avlis.onurb@… Owned by: nbd
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: uci segfault import merge Cc:

Description

uci segfaults trying to import with merge.

happened on a x86_generic Backfire (10.03.1-RC6, r28369) compiled by me and running on a virtualbox.
but it also happens on a official image (10.03.1-rc5 r27608), downloaded from openwrt.org and running on a TP-LINK TL-WR1043ND.

It also happens if stdin (cat file | uci import system -m ) is used.

Please let me know if I can help any further.

Best Regards,
Bruno Silva

--

root@OpenWrt:/tmp$ strace uci import system -m -f system 
execve("/sbin/uci", ["uci", "import", "system", "-m", "-f", "system"], [/* 11 vars */]) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77c5000
stat("/etc/ld.so.cache", 0xbff280c8)    = -1 ENOENT (No such file or directory)
open("/lib/libuci.so.12012009", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=37566, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77c4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \30\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 40960, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77ba000
mmap2(0xb77ba000, 36524, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb77ba000
mmap2(0xb77c3000, 702, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x9) = 0xb77c3000
close(3)                                = 0
munmap(0xb77c4000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=287943, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77c4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P\252\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 315392, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb776d000
mmap2(0xb776d000, 285568, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb776d000
mmap2(0xb77b3000, 5319, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x45) = 0xb77b3000
mmap2(0xb77b5000, 16784, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb77b5000
close(3)                                = 0
munmap(0xb77c4000, 4096)                = 0
open("/lib/libdl.so.0", O_RDONLY)       = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=8238, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77c4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0|\7\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 16384, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7769000
mmap2(0xb7769000, 4862, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7769000
mmap2(0xb776b000, 4142, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1) = 0xb776b000
close(3)                                = 0
munmap(0xb77c4000, 4096)                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=38070, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77c4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\24\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 45056, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb775e000
mmap2(0xb775e000, 37688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb775e000
mmap2(0xb7768000, 1206, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x9) = 0xb7768000
close(3)                                = 0
munmap(0xb77c4000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=287943, ...}) = 0
close(3)                                = 0
open("/lib/libdl.so.0", O_RDONLY)       = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=8238, ...}) = 0
close(3)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=38070, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=287943, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=287943, ...}) = 0
close(3)                                = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=16390, ...}) = 0
mprotect(0xb77b3000, 4096, PROT_READ)   = 0
mprotect(0xb776b000, 4096, PROT_READ)   = 0
mprotect(0xb77ca000, 4096, PROT_READ)   = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
brk(0)                                  = 0xa043000
brk(0xa044000)                          = 0xa044000
open("system", O_RDONLY)                = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbff28290) = -1 ENOTTY (Inappropriate ioctl for device)
brk(0xa045000)                          = 0xa045000
open("/usr/lib", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=2048, ...}) = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
getdents64(4, /* 28 entries */, 1024)   = 1008
getdents64(4, /* 27 entries */, 1024)   = 1000
getdents64(4, /* 9 entries */, 1024)    = 336
getdents64(4, /* 0 entries */, 1024)    = 0
close(4)                                = 0
stat("/etc/config/system", {st_mode=S_IFREG|0644, st_size=96, ...}) = 0
open("/etc/config/system", O_RDONLY)    = 4
flock(4, LOCK_SH)                       = 0
lseek(4, 0, SEEK_SET)                   = 0
fcntl(4, F_GETFL)                       = 0 (flags O_RDONLY)
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbff280b0) = -1 ENOTTY (Inappropriate ioctl for device)
brk(0xa046000)                          = 0xa046000
read(4, "config system\n\toption hostname\tO"..., 4096) = 96
read(4, "", 4096)                       = 0
brk(0xa047000)                          = 0xa047000
ioctl(2147483647, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbff28050) = -1 EBADF (Bad file descriptor)
brk(0xa048000)                          = 0xa048000
stat("/tmp/.uci/system", 0xbff28044)    = -1 ENOENT (No such file or directory)
flock(4, LOCK_UN)                       = 0
close(4)                                = 0
read(3, "config system\n\toption test 1\n\n", 4096) = 31
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault

from logread:

Oct  8 20:14:00 OpenWrt user.info kernel: uci[24902]: segfault at 0 ip b76f6a52 sp bfcc6bb8 error 4 in libuClibc-0.9.30.1.so[b76ce000+46000]

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by jow

  • Owner changed from developers to nbd
  • Status changed from new to assigned

comment:2 Changed 6 years ago by avlis.onurb@…

noticed a patern with more testing:
It looks like it crashes when the config line only has 2 columns.

root@OpenWrt:/tmp$ cat test1
config 'route'
        option 'interface' 'dc'
        option 'target' '192.168.100.0'
        option 'netmask' '255.255.255.0'

root@OpenWrt:/tmp$ cat test1 | uci -m import network
Segmentation fault
root@OpenWrt:/tmp$ cat test2
config interface wan
        option ifname   eth1
        option proto    dhcp

root@OpenWrt:/tmp$ cat test2 | uci -m import network
root@OpenWrt:/tmp$ uci changes
network.wan=interface
root@OpenWrt:/tmp$ uci commit

comment:3 Changed 6 years ago by nbd

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

fixed in r28507

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

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.