#177 memory violation error on a simple program

Core Dump
closed
nobody
None
1
2010-03-20
2010-02-25
Xinming Ou
No

Load the file xsb_bug.P in XSB, and issue the following query:

counter_init(nodeNum), L = [because(int(skol(exchangeCtlMessage('172.16.9.20',_h282)),p,range(1039209130,1904834156)),intRule_4f,[int(compromised('172.16.9.20'),l,range(1039209130,1039209227))]),because(int(skol(exchangeCtlMessage('172.16.9.20',_h327)),p,range(0,1904834156)),intRule_4f,[int(compromised('172.16.9.20'),l,range(0,1039209227))])], list_apply(L, outputArc).

You will see a memory violation error:

Partial Forward Continuation...
... nodeMap/2
... getNodeNum/2
... call/1
... _$call/1
... call_query/1
... call_expose/1
... catch/3
... interpreter/0
... ll_code_call/3
... call_expose/1
... catch/3

++Memory violation occurred during evaluation.
++Please report this problem using the XSB bug tracking system accessible from
++ http://sourceforge.net/projects/xsb
++Please supply the steps necessary to reproduce the bug.

Exiting XSB abnormally...

*****************************************************************************
* However, if you uncomment line 58, a write_canonical command *
* to print some information, the program will run normally. *
*****************************************************************************

Testing platform:

XSB Version 3.2 (Kopi Lewak) of March 15, 2009
on both Ubuntu and Mac OS X

Discussion

  • Xinming Ou
    Xinming Ou
    2010-02-25

    Prolog source code that manifests the bug

     
    Attachments
  • Xinming Ou
    Xinming Ou
    2010-02-25

    • priority: 5 --> 9
     
  • Barry J Evans
    Barry J Evans
    2010-02-26

    The problem seems to be fixed in the latest CVS version of XSB on source forge...
    At least using OS X...

    Transcript follows:

    [Katana:/Development/XSB/xsb bug testing] barry% ls
    xsb_bug.P
    [Katana:/Development/XSB/xsb bug testing] barry% xsb
    [xsb_configuration loaded]
    [sysinitrc loaded]

    XSB Version 3.2 (Kopi Lewak) of March 15, 2009
    [i386-apple-darwin10.2.0; mode: optimal; engine: multi-threading; scheduling: local; word size: 64]

    | ?- [xsb_bug].
    [Compiling ./xsb_bug]
    [xsb_bug compiled, cpu time used: 0.0110 seconds]
    [xsb_bug loaded]

    yes
    | ?- counter_init(nodeNum), L = [because(int(skol(exchangeCtlMessage('172.16.9.20',_h282)),p,range(1039209130,1904834156)),intRule_4f,[int(compromised('172.16.9.20'),l,range(1039209130,1039209227))]),because(int(skol(exchangeCtlMessage('172.16.9.20',_h327)),p,range(0,1904834156)),intRule_4f,[int(compromised('172.16.9.20'),l,range(0,1039209227))])], list_apply(L, outputArc).

    L = [because(int(skol(exchangeCtlMessage(172.16.9.20,_h233)),p,range(1039209130,1904834156)),intRule_4f,[int(compromised(172.16.9.20),l,range(1039209130,1039209227))]),because(int(skol(exchangeCtlMessage(172.16.9.20,_h423)),p,range(0,1904834156)),intRule_4f,[int(compromised(172.16.9.20),l,range(0,1039209227))])];

    no
    | ?- listing.
    arc(1,0,intRule_4f).
    arc(3,2,intRule_4f).

    nodeMap(0,int(skol(exchangeCtlMessage(172.16.9.20,A)),p,range(1039209130,1904834156))).
    nodeMap(1,int(compromised(172.16.9.20),l,range(1039209130,1039209227))).
    nodeMap(2,int(skol(exchangeCtlMessage(172.16.9.20,A)),p,range(0,1904834156))).
    nodeMap(3,int(compromised(172.16.9.20),l,range(0,1039209227))).

    nodeNum(4).

    library_directory(/Development/XSB/XSB/packages).
    library_directory(/Development/XSB/XSB/site/lib).
    library_directory(/Development/XSB/XSB/site/config/i386-apple-darwin10.2.0-mt/lib).
    library_directory(/Development/XSB/XSB/config/i386-apple-darwin10.2.0-mt/lib).
    library_directory(/Users/barry/.xsb/config/i386-apple-darwin10.2.0-mt).

    yes
    | ?- halt.

    End XSB (cputime 0.03 secs, elapsetime 474.85 secs)
    [Katana:/Development/XSB/xsb bug testing] barry% cat xsb_bug.P
    /*
    Load this file in XSB, and issue the following query:

    counter_init(nodeNum), L = [because(int(skol(exchangeCtlMessage('172.16.9.20',_h282)),p,range(1039209130,1904834156)),intRule_4f,[int(compromised('172.16.9.20'),l,range(1039209130,1039209227))]),because(int(skol(exchangeCtlMessage('172.16.9.20',_h327)),p,range(0,1904834156)),intRule_4f,[int(compromised('172.16.9.20'),l,range(0,1039209227))])], list_apply(L, outputArc).

    You will see a memory violation error:

    Partial Forward Continuation...
    ... nodeMap/2
    ... getNodeNum/2
    ... call/1
    ... _$call/1
    ... call_query/1
    ... call_expose/1
    ... catch/3
    ... interpreter/0
    ... ll_code_call/3
    ... call_expose/1
    ... catch/3

    ++Memory violation occurred during evaluation.
    ++Please report this problem using the XSB bug tracking system accessible from
    ++ http://sourceforge.net/projects/xsb
    ++Please supply the steps necessary to reproduce the bug.

    Exiting XSB abnormally...

    ******************************************************************
    * However, if you uncomment line 58, the error will not occur. *
    ******************************************************************

    Testing platform:

    XSB Version 3.2 (Kopi Lewak) of March 15, 2009
    on both Ubuntu and Mac OS X

    */

    :-dynamic arc/3.
    :-dynamic nodeMap/2.

    list_apply([], _Function).

    list_apply([A|As], Function) :-
    Call ^=.. [Function, A],
    Call,
    list_apply(As, Function).

    outputArc(because(Result, RuleID, [Cause])) :-
    getNodeNum(Result, NResult),
    getNodeNum(Cause, NCause),
    assert(arc(NCause, NResult, RuleID)).

    getNodeNum(Fact, N) :-
    %Uncomment the line below.
    % write_canonical('-'),
    nodeMap(N, Fact),
    !.

    getNodeNum(Fact, N) :-
    counter_next(nodeNum, N),
    assert(nodeMap(N, Fact)).

    /* Counter operations */

    counter_init(Counter) :-
    CounterLiteral =.. [Counter, _],
    retractall(CounterLiteral),
    CounterInitLiteral =.. [Counter, 0],
    assert(CounterInitLiteral).

    counter_next(Counter, N) :-
    CounterLiteral =.. [Counter, N],
    CounterLiteral,
    retract(CounterLiteral),
    NNext is N + 1,
    NextCounterLiteral =.. [Counter, NNext],
    assert(NextCounterLiteral).

    [Katana:/Development/XSB/xsb bug testing] barry%

     
  • Xinming Ou
    Xinming Ou
    2010-03-05

    • priority: 9 --> 1
    • status: open --> pending
     
  • Xinming Ou
    Xinming Ou
    2010-03-05

    I will wait for the next release to further test this. thx.

     
    • status: pending --> closed
     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).