#41 Segmentation fault: 11 (core dumped) on large log files

Oleg S.

beta can't parse large log files

i got an issue on freebsd8.1. i'm using the latest freebsd port of free-sa/devel
it parses small date intevrals just fine (lets say from 10 till 22 of sept.), but fails on a bigger intervals (1.5 months)

...alot of w_internal.c:124 stuff removed...

SADEBUG: [w_internal.c:124] 110-8-17->09/17/10
SADEBUG: [w_internal.c:124] 110-8-18->09/18/10
SADEBUG: [w_internal.c:124] 110-8-19->09/19/10
SADEBUG: [w_internal.c:124] 110-8-20->09/20/10
SADEBUG: [w_internal.c:124] 110-8-21->09/21/10
SADEBUG: [w_internal.c:124] 110-8-22->09/22/10
SADEBUG: [w_fs.c:19] (2) /usr/local/www/apache22/data/free-sa/08_18_10-09_22_10-1/g_.average.html
SADEBUG: [w_system.c:59] Executing '/usr/bin/sort' with next arguments:
SADEBUG: [w_system.c:61] 0. '/usr/bin/sort'
SADEBUG: [w_system.c:61] 1. '-k'
SADEBUG: [w_system.c:61] 2. '1,2'
SADEBUG: [w_system.c:61] 3. '-o'
SADEBUG: [w_system.c:61] 4. '/var/cache/free-sa/r22537/topsites'
SADEBUG: [w_system.c:61] 5. '/var/cache/free-sa/r22537/topsites.uns'
SADEBUG: [w_fs.c:19] (1) /var/cache/free-sa/r22537/topsites
SADEBUG: [w_fs.c:19] (2) /var/cache/free-sa/r22537/topsites.uns
Segmentation fault: 11 (core dumped)

when i run
sort -k 1,2 -o ./topsites ./topsites.uns
manually, it seems to run just fine - output topsites file is sorted to the very end without any errors.


  • Vladimir Nikiforov

    turning on\off compilation optimizations dont have any effect, neither do changing standart conf. file

  • Oleg S.

    Oleg S. - 2010-09-24

    Please kindly provide output of following two commands:
    1. free-sa -V
    2. uname -a

    I need this data to investigate this case further.

  • Oleg S.

    Oleg S. - 2010-09-24
    • assigned_to: nobody --> xsaper
  • Vladimir Nikiforov

    you may speak russian if you wish!
    here ya go:

    ]# free-sa -V
    SADEBUG: [free-sa.c:9] Entering
    SADEBUG: [w_config.c:766] Selected localisation file: internal English
    SADEBUG: [w_internal.c:111] 1135976400->12/31/05
    Free-SA 2.0.0b3 (http://free-sa.sourceforge.net)
    Copyright (C) 1997, 2006-2010 Oleg Sapon <xsov@mail.ru>
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This program comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it under certain conditions.
    For details please read the file named COPYING.

    PREFIX /usr/local
    ETCDIR /usr/local/etc/free-sa
    WWWDIR /usr/local/www/free-sa
    CACHEDIR /var/cache/free-sa
    LOCDIR /usr/local/share/free-sa
    DOCDIR /usr/local/share/doc/free-sa-2.0.0b3
    LOGFILE /var/log/squid/access.log
    CFLAGS -I. -I.. -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing -fomit-frame-pointer -std=c99 -W -Wall -Wextra -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wreturn-type -Wswitch -Wshadow -Wcast-align -Wuninitialized -Wchar-subscripts -Wuninitialized -Wbad-function-cast -Wwrite-strings
    LDFLAGS --relax -mrelax
    LIBS -lm
    Thousands separator yes
    Large file support yes
    Debug level 7
    C compiler cc
    Install command /usr/bin/install
    Sort command /usr/bin/sort

    # uname -a
    FreeBSD xxx.xxx.ru 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Wed Aug 18 11:58:24 YEKST 2010 xxx@xxx.xxx.ru:/usr/obj/usr/src/sys/xxx_kern i386

  • Vladimir Nikiforov

    i got the following when trying to patch -u free-sa-2.0.0b3p8x.patch
    over the downloaded from here free-sa-2.0.0b3p8.tar.gz

    [root@gate ~/free-sa]# patch < ./1.patch
    Hmm... Looks like a unified diff to me...
    The text leading up to this was:
    |diff -urN free-sa-2.0.0b3p8/global.mk free-sa-2.0.0b3p8x/global.mk
    |--- free-sa-2.0.0b3p8/global.mk 2010-04-21 21:12:39.000000000 +0400
    |+++ free-sa-2.0.0b3p8x/global.mk 2010-07-20 04:36:40.914300606 +0400
    Patching file free-sa-2.0.0b3p8/global.mk using Plan A...
    Reversed (or previously applied) patch detected! Assume -R? [y] n
    Apply anyway? [n] n
    Hunk #1 ignored at 25.
    1 out of 1 hunks ignored--saving rejects to free-sa-2.0.0b3p8/global.mk.rej
    Hmm... The next patch looks like a unified diff to me...
    The text leading up to this was:
    |diff -urN free-sa-2.0.0b3p8/src/work/w_log_operations.c free-sa-2.0.0b3p8x/src/work/w_log_operations.c
    |--- free-sa-2.0.0b3p8/src/work/w_log_operations.c 2010-04-20 22:24:10.000000000 +0400
    |+++ free-sa-2.0.0b3p8x/src/work/w_log_operations.c 2010-07-20 04:30:29.386299966 +0400
    Patching file free-sa-2.0.0b3p8/src/work/w_log_operations.c using Plan A...
    Hunk #1 failed at 231.
    1 out of 1 hunks failed--saving rejects to free-sa-2.0.0b3p8/src/work/w_log_operations.c.rej

    [root@gate ~/free-sa/free-sa-2.0.0b3p8/src/work]# cat ./w_log_operations.c.rej
    *** 231,236 ****

    if (cfg.users_report || cfg.top_sites_report) {
    /* Shorten URL (we jump over "http://" or "ftp://" here) */
    if (!cfg.users_fullurl_report && tmethod != 'C') {
    for (t = &turl[7]; t[0] != '\0' && t[0] != '/'; t++);
    --- 231,241 ----

    if (cfg.users_report || cfg.top_sites_report) {
    + if (tmethod == 'C') {
    + memmove(&turl[8], turl, strlen(turl) + 1L);
    + memcpy(turl, "https://", 8L);
    + }
    /* Shorten URL (we jump over "http://" or "ftp://" here) */
    if (!cfg.users_fullurl_report && tmethod != 'C') {
    for (t = &turl[7]; t[0] != '\0' && t[0] != '/'; t++);
    [root@gate ~/free-sa/free-sa-2.0.0b3p8/src/work]# ^C

  • Oleg S.

    Oleg S. - 2010-11-09

    Perharps something is wrong with your source code. I just download both patch and free-sa-2.0.0b3p8.tar.gz from URL provided below and Files section and was able to patch.

    Could you try following set of commands:
    1. Download free-sa-2.0.0b3p8.tar.gz from Files section.
    2. Download free-sa-2.0.0b3p8x.patch from https://sourceforge.net/tracker/?func=detail&aid=2993405&group_id=191513&atid=937679
    3. Put above 2 files into same directory
    4. tar xvfz free-sa-2.0.0b3p8.tar.gz
    5. patch -p0 < free-sa-2.0.0b3p8x.patch
    Hope it helps.

  • Oleg S.

    Oleg S. - 2011-04-22

    Vladimir, could you please try just released 2.0.0b4 and tell if it fixes error you seen before? If it not helps then put comment about this here (I keep comment posting enabled for this ticket).

  • Oleg S.

    Oleg S. - 2011-04-22
    • priority: 5 --> 1
    • status: open --> closed-duplicate

Log in to post a comment.