[mercury-users] Deep profiler data corrupted: unwritten nodes

Ondrej Bojar obo at cuni.cz
Tue Jan 2 21:50:08 AEDT 2007

Hi and Happy New Year to everyone.

So the deep profiler problem is indeed caused by missing calls to 
initialization (and finalization) procedures of modules that come from a 
custom library. And the error was of mine.

I did not know that I must include --init-file flag for main program 
compilation, so that mmc would include the library's init procedures to 
the main initializers. However, this mistake is observed only with deep 
profiling grade (or possibly library modules that do need some 
initialization), as the linking of the main program always succeeds and 
the executable runs.

For those interested, a working testcase is included to demonstrate 
both: using an 'installed' and 'non-installed' library. In the testcase 
directory type either 'make testinst' or 'make testnoninst'. In either 
case, the library 'mylib' is prepared and the program 'mylib' is 
compiled in asm_fast.gc.profdeep grade. See the main Makefile for the 
two options of correct linking against the library.


Zoltan Somogyi wrote:
>>The _init.c file for my program indeed does not contain any calls to 
>>save deep profiler data for my libtools modules. (But it contains such 
>>calls for mercury standard library modules, though.)
> That would be the problem.
>>In fact, I am surprised to see no _init.c files in the 
>>tools/obomerclib/Mercury/<grade>/ at all. So there are no _init.c files 
>>generated for the library modules?
> No. The installed system should have .init files in the grade-specific
> directories. Each program's _init.c file is derived (in part) from these files.
> Zoltan.
> --------------------------------------------------------------------------
> mercury-users mailing list
> Post messages to:       mercury-users at csse.unimelb.edu.au
> Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
> Subscriptions:          mercury-users-request at csse.unimelb.edu.au
> --------------------------------------------------------------------------

Ondrej Bojar (mailto:obo at cuni.cz)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testnoninstlib.tgz
Type: application/gzip
Size: 906 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/users/attachments/20070102/14e5c333/attachment.gz>

More information about the users mailing list