[m-rev.] diff: fix failure of general/read_line_as_string in .profdeep grades

Julien Fischer juliensf at cs.mu.OZ.AU
Tue Jun 14 23:48:44 AEST 2005


On Tue, 14 Jun 2005, Julien Fischer wrote:

>
> Estimated hours taken: 9
> Branches: main, release
>
> runtime/mercury_deep_profiling.c:
> 	Fix a bug that causes general/read_line_as_string to seg fault
> 	in the .profdeep grades.  The problem was that the slots in the hash
> 	tables were not being initialised to NULL.
>
> 	The above test case triggered this problem because the start of
> 	the MR_call_site_dynamic_table was reusing memory that
> 	io.read_line_as_string_2/6 had previously used as a temporary buffer.
> 	Consequently, the initial values of many of the slots in the hash table
> 	contained rubbish; moreover they contained inaccessible rubbish which
> 	was the code that writes out the Deep.data files was seg faulting.
>
Hmmm... the end of that didn't quite come out as I expected it to.
What I meant was that the slots contained junk values that the code
that writes out the Deep.data files treated as pointers, and that
because the memory these pointers were pointing to was inaccessible
it was seg faulting.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list