Menu

#142 scrollkeeper-rebuilddb segmentation fault

bug
open
nobody
5
2014-08-15
2007-10-05
Anonymous
No

When building vanilla scrollkeeper-0.3.14, the last scrollkeeper-rebuilddb got a segmentation fault.

It was found that scrollkeeper-update got segmentation fault when the database directory '/var/lib/scrollkeeper' did not exist.

The scrollkeeper-rebuilddb script removes the previous database before running scrollkeeper-update. It will cause segmentation fault.

A solution is to make the database directory again after removing the previous database. Attached a patch.

Discussion

  • Nobody/Anonymous

    nobody@nowhere.net

     
  • Nobody/Anonymous

    Logged In: NO

    A better fix is to solve the scrollkeeper-update segmentation fault.

    It seems that glibc-2.3.4 sprintf() terminates the destination string on the start. The sk_mkdir_with_parents() at database.c may call strcat() instead. See this patch.

    diff -Nur scrollkeeper-0.3.14/libs/database.c scrollkeeper-0.3.14-fixed/libs/database.c
    --- scrollkeeper-0.3.14/libs/database.c 2002-06-02 14:03:10.000000000 +0800
    +++ scrollkeeper-0.3.14-fixed/libs/database.c 2007-10-07 20:09:19.000000000 +0800
    @@ -69,9 +69,10 @@
    delim[0]=slash[0];
    while(token != NULL) {
    if (strlen(path) == 0 || ((strlen(path) == 1) && (path[0] == slash[0]))) {
    - sprintf(path, "%s%s", path, token);
    + strcat(path, token);
    } else {
    - sprintf(path, "%s/%s", path, token);
    + strcat(path, slash);
    + strcat(path, token);
    }
    if (stat(path, &buf) == -1) {
    if (sk_mkdir(path, options, outputprefs) != 0) {

     
  • Björn Felten

    Björn Felten - 2007-11-23

    Logged In: YES
    user_id=1028860
    Originator: NO

    The latest "news" about scrollkeeper is from March 18 2002, so I guess you're pretty much on your own here... :)

    My major concern is why updating Ubuntu takes so long waiting for SK to be able to restart. Anyone knows? What is it waiting for?

     

Log in to post a comment.

Auth0 Logo