compiler benchmark causes segfault

Bug #234626 reported by leppie
2
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
Medium
Abdulaziz Ghuloum

Bug Description

When running the compiler benchmark, Ikarus exits with a segfault.

BTW, are there any of the benchmarks that are known not to run?

Cheers

leppie

Related branches

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

I just ran it just fine.

[11]: ./bench.ss compiler
running stats for compile-compiler:
    41 collections
    2204 ms elapsed cpu time, including 723 ms collecting
    2271 ms elapsed real time, including 725 ms collecting
    2123 ms elapsed user time, including 647 ms collecting
    81 ms elapsed sys time, including 76 ms collecting
    168132824 bytes allocated
running stats for compiler (500):
    80 collections
    1777 ms elapsed cpu time, including 135 ms collecting
    1781 ms elapsed real time, including 136 ms collecting
    1749 ms elapsed user time, including 110 ms collecting
    28 ms elapsed sys time, including 25 ms collecting
    336352016 bytes allocated

What OS are you running it on?

Yes, there were a few benchmarks that do not run because they depend on features that are not implemented. No benchmark should be segfaulting.

Revision history for this message
leppie (leppie) wrote :

> What OS are you running it on?

Cygwin on Vista.

leppie@UBER-VISTA ~/ikarus.dev/benchmarks
$ gdb --args ikarus --r6rs-script bench.ss compiler
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) r
Starting program: /usr/local/bin/ikarus.exe --r6rs-script bench.ss compiler
[New thread 5916.0x804]
[New thread 5916.0x192c]

Program received signal SIGSEGV, Segmentation fault.
0x7efbbe12 in ?? ()
(gdb)

Revision history for this message
leppie (leppie) wrote :

Some more info:

Starting program: /usr/local/bin/ikarus.exe --r6rs-script bench.ss compiler
[New thread 1128.0x10dc]
[New thread 1128.0x1ca4]

Program received signal SIGSEGV, Segmentation fault.
0x7efbbe12 in ?? ()
(gdb) c
Continuing.
   4656 [main] ikarus 1128 _cygtls::handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
gdb: unknown target exception 0xc0000029 at 0x77af0e35

Program received signal ?, Unknown signal.
0x77af0e35 in ntdll!RtlTimeToTimeFields () from /cygdrive/c/Windows/system32/ntdll.dll
(gdb) c
Continuing.

Program exited with code 030000000051.
(gdb)

Revision history for this message
leppie (leppie) wrote :

More info (from MS debugger):

Unhandled exception at 0x77af0e35 in ikarus.exe: 0xC0000029: An invalid unwind target was encountered during an unwind operation.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

The culprit seems to be in make-string:
(let ([x (make-string 487045)]) (string-length x)) segfaults under cygwin but not under OSX. Will investigate more.

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Fixed in 1489. Thanks a bunch. (the allocation overflow check was incorrect: it was using signed comparison instead of unsigned one)

Changed in ikarus:
status: Confirmed → Fix Committed
Revision history for this message
leppie (leppie) wrote :

Cool, thanks :)

I tested it on my system, no issues.

On another note, both the 'compiler' and 'slatex' benchmarks are not strict R6RS, as it compares characters and integers with eq?, memq and assq. These benchmarks will fail if the implementation does not handle chars and ints in eq? (I know Ikarus does, as you said previously).

I have also verified this in IronScheme by implicitly allowing eq? to test equality of chars and ints. (it took me almost a day to debug the issue why those 2 werent running).

Also, when trying 'nbody', it fails with a 0 is not a flonum (fl+), however I see no mention of fl+ in the benchmark.

Cheers

leppie

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 234626] Re: compiler benchmark causes segfault

On May 27, 2008, at 7:41 AM, leppie wrote:
> Cool, thanks :)
>
> I tested it on my system, no issues.
>
> On another note, both the 'compiler' and 'slatex' benchmarks are not
> strict R6RS, as it compares characters and integers with eq?, memq and
> assq. These benchmarks will fail if the implementation does not handle
> chars and ints in eq? (I know Ikarus does, as you said previously).

I haven't written these benchmarks and it doesn't surprise me that they
have bugs.

> I have also verified this in IronScheme by implicitly allowing eq? to
> test equality of chars and ints. (it took me almost a day to debug the
> issue why those 2 werent running).

A better deal would be to fix their sources (by using memv instead of
memq and eqv? instead of eq? where appropriate). I can apply the
patch if you make one one.

> Also, when trying 'nbody', it fails with a 0 is not a flonum (fl+),
> however I see no mention of fl+ in the benchmark.

There is a mention of fl+ in the benchmark, but that benchmark never
ran in the first place since it requires complex numbers. Now it
seems to compile file as I'm adding complex numbers in Ikarus but I
can say nothing about the correctness of the benchmark or the
correctness of Ikarus's complex numbers implementation at this point.

Aziz,,,

Revision history for this message
leppie (leppie) wrote :

> A better deal would be to fix their sources (by using memv instead of
> memq and eqv? instead of eq? where appropriate). I can apply the
> patch if you make one one.

I did one for slatex, but the compiler one is a bit big, also the compiler benchmark return the incorrect result on IronScheme :( There seems to be a few places with duplicate instructions (especially after labels) that I still need to investigate.

I'll send you a patch once I have both done :)

Changed in ikarus:
milestone: none → 0.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.