[m-dev.] Problem compiling G12 in debug grade on Saturn

Bert Van Nuffelen bvn at missioncriticalit.com
Thu Mar 20 20:25:13 AEDT 2008


Ralph Becket wrote:
> I've added `GRADE=asm_fast.gc.tr.debug' to Mercury.params in
> g12/zinc/compiler on a new workspace on saturn, and run make.
>
> I get this:
>
> Making Mercury/asm_fast.gc.tr.debug/x86_64-unknown-linux-gnu/Mercury/cs/flatzinc.c
> Making Mercury/asm_fast.gc.tr.debug/x86_64-unknown-linux-gnu/Mercury/cs/flatzinc_colgen_solver.c
> Making Mercury/asm_fast.gc.tr.debug/x86_64-unknown-linux-gnu/Mercury/cs/flatzinc_conf.c
> Uncaught Mercury exception:
> Software Error: map.lookup: key not found
>         Key Type: term.var(parse_tree.prog_data.prog_var_type)
>         Key Value: var(16)
>         Value Type: ll_backend.var_locn.var_state
> Stack dump not available in this grade.
> ** Error making `Mercury/asm_fast.gc.tr.debug/x86_64-unknown-linux-gnu/Mercury/cs/flatzinc_conf.c'.
> make: *** [install] Error 1
>
> Does that look familiar to anyone?
> --------------------------------------------------------------------------
> mercury-developers mailing list
> Post messages to:       mercury-developers at csse.unimelb.edu.au
> Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
> Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
> --------------------------------------------------------------------------
>   
Hi,

I am a developer at Mission Critical, and  I ran into the same problem 
recently twice.

It occurred me recently twice for code which uses typeclasses a lot.
Correct code did not pass (see eg. below) but after some code 
rearrangement (here below
switch 2 lines, or move a switch from the head to inside the body)
it compiles. Hope it helps.

best regards,

Bert


Bert Van Nuffelen wrote:
> Hi,
>
> I am using @ (unification statements) and when using these I get the 
> next compiler abort:
>
> clude-dir ../external/libs/include nim_tcp_xml_server
> Making Mercury/int3s/instance_selector_glue.int3
> Making Mercury/ints/instance_selector_glue.int
> Making 
> Mercury/asm_fast.gc.decldebug/i686-pc-linux-gnu/Mercury/cs/instance_selec
> tor_glue.c
> Uncaught Mercury exception:
> Software Error: map.lookup: key not found
>        Key Type: term.var(parse_tree.prog_data.prog_var_type)
>        Key Value: var(116)
>        Value Type: ll_backend.var_locn.var_state
> Stack dump not available in this grade.
> ../src/widget/instance_selector/src/instance_selector_glue.m:135: In 
> clause for
> ../src/widget/instance_selector/src/instance_selector_glue.m:135:   
> predicate
> ../src/widget/instance_selector/src/instance_selector_glue.m:135:   
> `instance_se
> lector_glue.apply_changes_widget'/11:
> ../src/widget/instance_selector/src/instance_selector_glue.m:135:   
> warning:
> ../src/widget/instance_selector/src/instance_selector_glue.m:135:   
> variable
> ../src/widget/instance_selector/src/instance_selector_glue.m:135:   
> `Static'
> ../src/widget/instance_selector/src/instance_selector_glue.m:135:   
> occurs only
> ../src/widget/instance_selector/src/instance_selector_glue.m:135:   
> once in
> ../src/widget/instance_selector/src/instance_selector_glue.m:135:   
> this scope.
> ** Error making 
> `Mercury/asm_fast.gc.decldebug/i686-pc-linux-gnu/Mercury/cs/inst
> ance_selector_glue.c'.
> make: *** [nim_tcp_xml_server] Error 1
> bvn at vdil-sleepy:~/nim_clean2/system/build$
>
>
> code extract:
>
> :- type class_selector ---> class_selector(rdf.resource).
>
> :- type range_selector --->
>                      % instance     property
>        range_selector(rdf.resource, rdf.predicate).
>
> :- type instance_selector_widget --->
>            rs(range_selector)
>        ;   cs(class_selector).
>
>
> apply_changes_widget(rs(range_selector(Instance, Property)) @ Widget, _,
>        some_open_rdfStore(Store0), 'new some_open_rdfStore'(Store1),
>        Static, !Session, !Dynamic, !IO):-
>    [...]
>   apply_changes_widget(cs(_) @ _Widget, _,
>        some_open_rdfStore(Store0), 'new some_open_rdfStore'(Store0),
>        _Static, !Session, !Dynamic, !IO):-    true.
>   _______________________________________________
> mct mailing list
> mct at missioncriticalit.com
> http://mail.missioncriticalit.com/cgi-bin/mailman/listinfo/mct


I did some more testing, but it is *NOT* the @ syntax but the fact that 
the last call in my predicate
is not properly treated by the compiler.

This compiles:

- pred apply_changes_widget(
           instance_selector_widget::in,
           runtime::in,
           some_open_rdfStore::in, some_open_rdfStore::out,
           static_ws::in, session_ws::in, session_ws::out,
           dynamic_ws::in, dynamic_ws::out, io::di, io::uo) is det.

apply_changes_widget(rs(R), _,
       some_open_rdfStore(Store0), 'new some_open_rdfStore'(Store1),
       Static, !Session, !Dynamic, !IO):-
     Widget = rs(R),
   R = range_selector(Instance, Property),

   get_contentid(Widget, ContentId, Store0, StoreA, !IO),
   promise_det_out(query_dataid(ContentId, ['selected_instance_uri']), 
Answer, StoreA, StoreB, !IO),
   only_resource_answers(Answer, SelectedInstances, !IO),

   list.map(
       (pred(O::in, T::out) is det:-
           T = rdf.triple(Instance, Property, resource(O))
       ), SelectedInstances, Triples),

   transaction_without_userdata_promise_det(
       rdfStore.assert_triples(Triples),
       SResult,
       StoreB, StoreC, !IO),

   test_result_exception(module_context("apply_changes_widget"), SResult),
   Store1 = StoreC,

   true.
  This produces the compiler abort:

- pred apply_changes_widget(
           instance_selector_widget::in,
           runtime::in,
           some_open_rdfStore::in, some_open_rdfStore::out,
           static_ws::in, session_ws::in, session_ws::out,
           dynamic_ws::in, dynamic_ws::out, io::di, io::uo) is det.

apply_changes_widget(rs(R), _,
       some_open_rdfStore(Store0), 'new some_open_rdfStore'(Store1),
       Static, !Session, !Dynamic, !IO):-
     Widget = rs(R),
   R = range_selector(Instance, Property),

   get_contentid(Widget, ContentId, Store0, StoreA, !IO),
   promise_det_out(query_dataid(ContentId, ['selected_instance_uri']), 
Answer, StoreA, StoreB, !IO),
   only_resource_answers(Answer, SelectedInstances, !IO),

   list.map(
       (pred(O::in, T::out) is det:-
           T = rdf.triple(Instance, Property, resource(O))
       ), SelectedInstances, Triples),

   transaction_without_userdata_promise_det(
       rdfStore.assert_triples(Triples),
       SResult,
       StoreB, StoreC, !IO),

  Store1 = StoreC,
   test_result_exception(module_context("apply_changes_widget"), SResult).

 
  The only difference is that the predicate test_result is at the end 
while in the first case it is not.
This is very strange as in many cases where I used the same predicate it 
is also at the end!



Bert


--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list