2024-03-29 18:32 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000101mercuryBugpublic2009-07-28 16:45
Reporterpbone 
Assigned Tojuliensf 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000101: Deep profiling of programs compiled against G12 creates currupt Deep.data files.
DescriptionWhen running even trivial programs such as "hello world" against the G12 libraries the Mercury runtime cannot correctly write out the proc statics to the Deep.data file.
Additional Informationpbone@goliath:/home/goliath/pbone/rect_pack$ ./hello
Hello world!
Mercury runtime: MR_write_out_proc_static: seen ps
pbone@goliath:/home/goliath/pbone/rect_pack$ echo $?
1

The minimal set of G12 libraries required to trigger this problem can be linked against if Mercury.options contains:

include "/home/goliath/pbone/g12/install/G12.options"
MCFLAGS = $(G12_LIBFLAGS_ZINC_RT) $(G12_LIBFLAGS_ZINC_GENERIC_PROP) $(G12_LIBFLAGS_LAZYFD) $(G12_LIBFLAGS_COMMON)

This occurs regardless of optimization level.

mmc --grade asm_fast.gc.trseg.profdeep --rebuild hello

Note that G12 requires trailing so this cannot be tested in a non-trailed grade.

TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000178

juliensf (administrator)

That is not the minimal set of G12 libraries required to reproduce the
problem. Just linking hello world against the FD/IC backend library
produces:

    Mercury runtime: UNWRITTEN nodes: Deep.data file corrupted

Linking hello world against just the FD/IC backend library and the
G12/FD library produces the original abort, i.e.

    Mercury runtime: MR_write_out_proc_static: seen ps

~0000179

juliensf (administrator)

Last edited: 2009-07-23 22:27

The problem here is that the we are writing out the proc statics for
the G12/FD and Zinc runtime libraries twice, i.e. there are two calls to mercury__g12_fd__write_out_proc_statics() etc in the _init.c file.

This is occuring because the command lines used to invoke the compiler
contain duplicate --ml options, e.g.

   --ml g12_fd --ml g12_fd

It isn't entirely obvious because it's all hidden behind several layers of
variables and includes in Mercury.options files. It may be possible to
modify G12's library handling to avoid this, but IMO the Mercury compiler
should also be changed to remove duplicate --ml options.

~0000180

pbone (administrator)

Ahh, I was removing each of the zinc flags variables until I could remove no more without either causing the error or having link errors.

Your diagnosis makes sense fro the 'seen ps' case. After fixing this we should retest it to determine if this and the UNWRITTEN NODES errors are _both_ fixed.

~0000181

juliensf (administrator)

The compiler now removes duplicates from the list of .init files before invoking mkinit.
+Notes

-Issue History
Date Modified Username Field Change
2009-07-23 17:58 pbone New Issue
2009-07-23 22:03 juliensf Note Added: 0000178
2009-07-23 22:19 juliensf Note Added: 0000179
2009-07-23 22:20 juliensf Note Edited: 0000179
2009-07-23 22:27 juliensf Note Edited: 0000179
2009-07-23 22:28 juliensf Status new => feedback
2009-07-24 09:59 pbone Note Added: 0000180
2009-07-28 16:45 juliensf Note Added: 0000181
2009-07-28 16:45 juliensf Status feedback => resolved
2009-07-28 16:45 juliensf Resolution open => fixed
2009-07-28 16:45 juliensf Assigned To => juliensf
+Issue History