Mercury Bugs - mercury
View Issue Details
0000585mercuryBugpublic2026-05-12 17:102026-05-12 17:11
Reporterwangp 
Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000585: liveness bug involving TypeClassInfo
DescriptionThe compiler aborts when compiling the attached test case in a debug grade:

% mmc -s asm_fast.gc.debug -C tci_liveness_abort.m

The module contains two similar predicates which both cause aborts at different points. (Probably the root cause is the same for both.)

With --debug-liveness 0, the Kind = k3 branch of the test1 predicate shows in the "after deadness" stage:

      % context: file "tci_liveness_abort.m", line 106
      % goal id: 12
      % nonlocals: V_16, HostOb_21, TypeClassInfo_for_host_25
      % pre-births: TypeClassInfo_for_host_14, HostOb_21, TypeClassInfo_for_host_25
      % determinism: semidet
      V_16 = tci_liveness_abort.host(TypeClassInfo_for_host_25, HostOb_21)
      % V_16 ?= tci_liveness_abort.host/1(TypeClassInfo_for_host_25, HostOb_21)
      % arg-mode 1 in = out
      % arg-mode 2 in = out
      % vars with new insts: V_16, HostOb_21, TypeClassInfo_for_host_25
      % post-deaths: V_16

The TypeClassInfo_for_host_14 variable occurring in the pre-birth set looks suspicious.
TagsNo tags attached.
Attached Files? tci_liveness_abort.m (11,099) 2026-05-12 17:10
https://bugs.mercurylang.org/file_download.php?file_id=336&type=bug
txt debug-liveness-pred-id-0.txt (49,982) 2026-05-12 17:11
https://bugs.mercurylang.org/file_download.php?file_id=337&type=bug

There are no notes attached to this issue.

Issue History
2026-05-12 17:10wangpNew Issue
2026-05-12 17:10wangpFile Added: tci_liveness_abort.m
2026-05-12 17:11wangpFile Added: debug-liveness-pred-id-0.txt