Discussion:
A5P4 Weird Error
(too old to reply)
Patrick Hannigan
2010-02-10 20:16:34 UTC
Permalink
Hey,

I seem to have a working solution to A5P4 but marmoset seems to be
causing some havoc that I can't figure out.

I have tried ilength with the following configurations.

ilength(iempty());
ilength(icons(1, icons(2, icons(3, iempty())))); (and similar larger lists)
ilength(irest(icons(3,icons(4, iempty())))); (and similar larger lists)

Me and the tutor have looked at it a long while but couldn't seem to
replicate the error... here's what I'm seeing in marmoset in full:


Running p4.c -- input from p4.in.1 -- output to p4.out.1 = Invalid write
of size 4 = at 0x8049168: irest (ilist.c:67) = by 0x8049281: main
(p4.c:17) = Address 0x4 is not stack'd, malloc'd or (recently) free'd =
Process terminating with default action of signal 11 (SIGSEGV) = Access
not within mapped region at address 0x4 = at 0x8049168: irest
(ilist.c:67) = by 0x8049281: main (p4.c:17) Program finished with errors
-- see p4.err.1 = Invalid write of size 4 = at 0x8049168: irest
(ilist.c:67) = by 0x8049281: main (p4.c:17) = Address 0x4 is not
stack'd, malloc'd or (recently) free'd = Process terminating with
default action of signal 11 (SIGSEGV) = Access not within mapped region
at address 0x4 = at 0x8049168: irest (ilist.c:67) = by 0x8049281: main
(p4.c:17) = ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from
1) = malloc/free: in use at exit: 24,000 bytes in 2,000 blocks. =
malloc/free: 2,000 allocs, 0 frees, 24,000 bytes allocated. = For counts
of detected errors, rerun with: -v = searching for pointers to 2,000
not-freed blocks. = checked 95,076 bytes. = LEAK SUMMARY: = definitely
lost: 0 bytes in 0 blocks. = possibly lost: 0 bytes in 0 blocks. = still
reachable: 24,000 bytes in 2,000 blocks. = suppressed: 0 bytes in 0
blocks. = Reachable blocks (those to which a pointer was found) are not
shown. Try again.


Somewhere irest is getting passed a NULL or iempty() it looks like...



Any help, ideas, or other tests I might be missing would be incredibly
helpful!

Patrick
Gordon V. Cormack
2010-02-10 20:29:25 UTC
Permalink
Try

irest(icons(10,iempty()))
Patrick Hannigan
2010-02-10 20:52:21 UTC
Permalink
Post by Gordon V. Cormack
Try
irest(icons(10,iempty()))
this return what I believe to be correct:

ilength(irest(icons(10,iempty()))) returns 0
Gordon V. Cormack
2010-02-10 21:20:52 UTC
Permalink
Post by Patrick Hannigan
Post by Gordon V. Cormack
Try
irest(icons(10,iempty()))
ilength(irest(icons(10,iempty()))) returns 0
You tested this with RunC? Are you sure
you tested the same program you submitted
to Marmoset?
Adrian Duong
2010-02-10 22:05:18 UTC
Permalink
Post by Patrick Hannigan
Hey,
I seem to have a working solution to A5P4 but marmoset seems to be
causing some havoc that I can't figure out.
I have tried ilength with the following configurations.
ilength(iempty());
ilength(icons(1, icons(2, icons(3, iempty())))); (and similar larger lists)
ilength(irest(icons(3,icons(4, iempty())))); (and similar larger lists)
Me and the tutor have looked at it a long while but couldn't seem to
Running p4.c -- input from p4.in.1 -- output to p4.out.1 = Invalid write
of size 4 = at 0x8049168: irest (ilist.c:67) = by 0x8049281: main
(p4.c:17) = Address 0x4 is not stack'd, malloc'd or (recently) free'd =
Process terminating with default action of signal 11 (SIGSEGV) = Access
not within mapped region at address 0x4 = at 0x8049168: irest
(ilist.c:67) = by 0x8049281: main (p4.c:17) Program finished with errors
-- see p4.err.1 = Invalid write of size 4 = at 0x8049168: irest
(ilist.c:67) = by 0x8049281: main (p4.c:17) = Address 0x4 is not
stack'd, malloc'd or (recently) free'd = Process terminating with
default action of signal 11 (SIGSEGV) = Access not within mapped region
at address 0x4 = at 0x8049168: irest (ilist.c:67) = by 0x8049281: main
(p4.c:17) = ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from
1) = malloc/free: in use at exit: 24,000 bytes in 2,000 blocks. =
malloc/free: 2,000 allocs, 0 frees, 24,000 bytes allocated. = For counts
of detected errors, rerun with: -v = searching for pointers to 2,000
not-freed blocks. = checked 95,076 bytes. = LEAK SUMMARY: = definitely
lost: 0 bytes in 0 blocks. = possibly lost: 0 bytes in 0 blocks. = still
reachable: 24,000 bytes in 2,000 blocks. = suppressed: 0 bytes in 0
blocks. = Reachable blocks (those to which a pointer was found) are not
shown. Try again.
Somewhere irest is getting passed a NULL or iempty() it looks like...
Any help, ideas, or other tests I might be missing would be incredibly
helpful!
Patrick
It's also possible something is freeing memory and irest is getting
passed a pointer to unallocated memory (i.e. an idelete-ed ilist).
Loading...