Fossil

View Ticket
Login
2013-05-01
16:05 Fixed ticket [da461aefee]: Segfault viewing file plus 3 other changes artifact: 8864239654 user: drh
16:02
Fix an off-by-one error in the binary search for file suffixes when trying to guess the mimetype of a file. Ticket [da461aefee1351] check-in: 96b09d89a1 user: drh tags: trunk
15:52 Ticket [da461aefee] Segfault viewing file status still Open with 5 other changes artifact: 8e8dff373e user: anonymous
15:28 New ticket [da461aefee]. artifact: 8a2bb01e17 user: anonymous

Ticket Hash: da461aefee1351dfaf9c340c27d1a4977b7b3434
Title: Segfault viewing file
Status: Fixed Type: Code_Defect
Severity: Important Priority:
Subsystem: Resolution: Fixed
Last Modified: 2013-05-01 16:05:33
13.35 years ago
Created: 2013-05-01 15:28:47
13.35 years ago
Version Found In: 1.25
User Comments:
nobody added on 2013-05-01 15:28:47:
Program received signal SIGSEGV, Segmentation fault.
fossil_strcmp (zA=zA@entry=0x7fffffffda20 "zshrc", zB=zB@entry=0x3e613738464947 <Address 0x3e613738464947 out of bounds>) at ./src/printf.c:908
908           b = *zB++;
(gdb) bt
#0  fossil_strcmp (zA=zA@entry=0x7fffffffda20 "zshrc", zB=zB@entry=0x3e613738464947 <Address 0x3e613738464947 out of bounds>) at ./src/printf.c:908
#1  0x0000000000433fe6 in mimetype_from_name (zName=<optimized out>) at ./src/doc.c:323
#2  0x0000000000442f25 in artifact_page () at ./src/info.c:1652
#3  0x0000000000448ec0 in process_one_web_page (zNotFound=zNotFound@entry=0x783160 "http://chiselapp.com/notfound", pFileGlob=pFileGlob@entry=0x0) at ./src/main.c:1499
#4  0x0000000000449cc6 in cmd_cgi () at ./src/main.c:1602
#5  0x0000000000416257 in main (argc=<optimized out>, argv=<optimized out>) at ./src/main.c:559
(gdb) print zB
$1 = 0x3e613738464947 <Address 0x3e613738464947 out of bounds>
(gdb)


Core file and compiled "fossil" executable available upon request

nobody (claiming to be rkeene) added on 2013-05-01 15:52:30:
Better backtrace, and additional information:

Core was generated by `fossil repository'.
Program terminated with signal 11, Segmentation fault.
#0  0x000000000045e5a2 in fossil_strcmp (zA=0x7fffffffd991 "shrc", zB=0x101010101010101 <Address 0x101010101010101 out of bounds>) at ./src/printf.c:908
908           b = *zB++;
(gdb) bt
#0  0x000000000045e5a2 in fossil_strcmp (zA=0x7fffffffd991 "shrc", zB=0x101010101010101 <Address 0x101010101010101 out of bounds>) at ./src/printf.c:908
#1  0x00000000004352fc in mimetype_from_name (zName=0x7f88f0 ".zshrc") at ./src/doc.c:323
#2  0x0000000000447c53 in artifact_page () at ./src/info.c:1652
#3  0x000000000044f1d6 in process_one_web_page (zNotFound=0x7d1160 "http://chiselapp.com/notfound", pFileGlob=0x0) at ./src/main.c:1499
#4  0x000000000044f78b in cmd_cgi () at ./src/main.c:1602
#5  0x000000000044d1cf in main (argc=2, argv=0x7fffffffdd68) at ./src/main.c:559
(gdb) up
#1  0x00000000004352fc in mimetype_from_name (zName=0x7f88f0 ".zshrc") at ./src/doc.c:323
323           c = fossil_strcmp(zSuffix, aMime[i].zSuffix);
(gdb) print zSuffix
$1 = "zshrc\000\000\000@�S\000\000\000\000\000\000\032\177"
(gdb) print aMime[i].zSuffix
$2 = 0x101010101010101 <Address 0x101010101010101 out of bounds>
(gdb) print i
$3 = 196
(gdb) print aMime[i-1].zSuffix
$4 = 0x534d53 "zip"
(gdb)