-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime crash #2
Comments
[jan@lenovo examples]$ ./003_bairstow2
Roots found by Bairstow's method.
i ex nat x y
1 2 -1 -0.9706389700 1.005807589
2 1 -1 2.470638970 4.640533161
Roots found by Bairstow's method.
i ex nat x y
1 1 -1 0.5000000000 0.8660254037
2 1 -1 -1.000000000 1.000000000
3 1 -1 1.500000000 1.322875655
Program end.
If these are the correct output then the error is repaired. Simple error,
had nothing to do with the 32 -> 64 bit transfer, but an incorrect counter
Op do 27 dec. 2018 om 09:09 schreef lukacsarpad <notifications@github.com>:
… The attached code (ACM Algorithm 003: Finding roots of polynomials by the
Bairstow-Hitchcock method) crashes on linux (ubuntu 16.04) with:
*** Error in `./001_bairstow2': free(): invalid next size (fast):
0x0000000000f8c0b0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f97f2ecf7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f97f2ed837a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f97f2edc53c]
./001_bairstow2[0x402010]
./001_bairstow2[0x401815]
./001_bairstow2[0x400c78]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f97f2e78830]
./001_bairstow2[0x400e49]
======= Memory map: ========
00400000-00405000 r-xp 00000000 09:00 7869045
/home/arpi/programming/a60/toms/001_bairstow2
00605000-00606000 r--p 00005000 09:00 7869045
/home/arpi/programming/a60/toms/001_bairstow2
00606000-00607000 rw-p 00006000 09:00 7869045
/home/arpi/programming/a60/toms/001_bairstow2
00f8c000-00fad000 rw-p 00000000 00:00 0 [heap]
7f97ec000000-7f97ec021000 rw-p 00000000 00:00 0
7f97ec021000-7f97f0000000 ---p 00000000 00:00 0
7f97f2c42000-7f97f2c58000 r-xp 00000000 08:21 5247481
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f97f2c58000-7f97f2e57000 ---p 00016000 08:21 5247481
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f97f2e57000-7f97f2e58000 rw-p 00015000 08:21 5247481
/lib/x86_64-linux-gnu/libgcc_s.so.1
7f97f2e58000-7f97f3018000 r-xp 00000000 08:21 5254184
/lib/x86_64-linux-gnu/libc-2.23.so
7f97f3018000-7f97f3218000 ---p 001c0000 08:21 5254184
/lib/x86_64-linux-gnu/libc-2.23.so
7f97f3218000-7f97f321c000 r--p 001c0000 08:21 5254184
/lib/x86_64-linux-gnu/libc-2.23.so
7f97f321c000-7f97f321e000 rw-p 001c4000 08:21 5254184
/lib/x86_64-linux-gnu/libc-2.23.so
7f97f321e000-7f97f3222000 rw-p 00000000 00:00 0
7f97f3222000-7f97f332a000 r-xp 00000000 08:21 5244227
/lib/x86_64-linux-gnu/libm-2.23.so
7f97f332a000-7f97f3529000 ---p 00108000 08:21 5244227
/lib/x86_64-linux-gnu/libm-2.23.so
7f97f3529000-7f97f352a000 r--p 00107000 08:21 5244227
/lib/x86_64-linux-gnu/libm-2.23.so
7f97f352a000-7f97f352b000 rw-p 00108000 08:21 5244227
/lib/x86_64-linux-gnu/libm-2.23.so
7f97f352b000-7f97f3551000 r-xp 00000000 08:21 5254182
/lib/x86_64-linux-gnu/ld-2.23.so
7f97f371f000-7f97f3723000 rw-p 00000000 00:00 0
7f97f374f000-7f97f3750000 rw-p 00000000 00:00 0
7f97f3750000-7f97f3751000 r--p 00025000 08:21 5254182
/lib/x86_64-linux-gnu/ld-2.23.so
7f97f3751000-7f97f3752000 rw-p 00026000 08:21 5254182
/lib/x86_64-linux-gnu/ld-2.23.so
7f97f3752000-7f97f3753000 rw-p 00000000 00:00 0
7ffd774af000-7ffd774d0000 rw-p 00000000 00:00 0 [stack]
7ffd775a5000-7ffd775a8000 r--p 00000000 00:00 0 [vvar]
7ffd775a8000-7ffd775aa000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
The same code (with fabs replaced by abs and using # instead of e for
scientific form constants) runs with MARST and generates the output
provided in the certification of the algorithm.
003_bairstow2.txt
<https://github.com/JvanKatwijk/algol-60-compiler/files/2711886/003_bairstow2.txt>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AITzwEvIk_oQAuyKMwEL4oltkz5LkOOCks5u9IAdgaJpZM4Zid5S>
.
--
Jan van Katwijk
+31 (0)15 3698980
+31 (0) 628260355
|
Yes, this seems correct, thank you. Also, I wanted to ask you if you are sure that fabs() shall be used for floating point numbers. MARST seems to accept abs(), and the original TOMS algorithms use abs() too. |
I really have to consult the RR for that, technically is is not an issue.
Op do 27 dec. 2018 om 14:44 schreef lukacsarpad <notifications@github.com>:
… Yes, this seems correct, thank you.
Also, I wanted to ask you if you are sure that fabs() shall be used for
floating point numbers. MARST seems to accept abs(), and the original TOMS
algorithms use abs() too.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AITzwE5kkhiDSwFdjcEtc42T-BDbvou-ks5u9M7ZgaJpZM4Zid5S>
.
--
Jan van Katwijk
+31 (0)15 3698980
+31 (0) 628260355
|
fabs changed in abs, seems to work
Op do 27 dec. 2018 om 15:02 schreef jan van katwijk <j.vankatwijk@gmail.com
…:
I really have to consult the RR for that, technically is is not an issue.
Op do 27 dec. 2018 om 14:44 schreef lukacsarpad ***@***.***
>:
> Yes, this seems correct, thank you.
>
> Also, I wanted to ask you if you are sure that fabs() shall be used for
> floating point numbers. MARST seems to accept abs(), and the original TOMS
> algorithms use abs() too.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#2 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AITzwE5kkhiDSwFdjcEtc42T-BDbvou-ks5u9M7ZgaJpZM4Zid5S>
> .
>
--
Jan van Katwijk
+31 (0)15 3698980
+31 (0) 628260355
--
Jan van Katwijk
+31 (0)15 3698980
+31 (0) 628260355
|
Somehow I cannot reproduce the correct results with the new version. I get |
Thanks
The problem was caused by the mapping of the algol "abs" onto the c "abs",
the latter operating on int's
The solution was to create a "fabs" in the runtime, and an "abs" in the
prelude that just calls the fabs
The results I get now, are the correct results
Op zo 6 jan. 2019 om 17:53 schreef lukacsarpad <notifications@github.com>:
… Somehow I cannot reproduce the correct results with the new version. I get
Roots found by Bairstow's method.
i ex nat x y
1 1 -1 -1.012085580 1.008068111
2 1 -1 2.512085580 4.671048047
Roots found by Bairstow's method.
i ex nat x y
1 3 -1 0.5073488146 0.8601905079
2 1 1 -2.926409128e-3 -632542.6365
3 1 -1 316271.8123 547798.2775
Program end.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AITzwChhrB8QmBoQQyO_TbWnCOHoU3QRks5vAioXgaJpZM4Zid5S>
.
--
Jan van Katwijk
+31 (0)15 3698980
+31 (0) 628260355
|
The attached code (ACM Algorithm 003: Finding roots of polynomials by the Bairstow-Hitchcock method) crashes on linux (ubuntu 16.04) with:
*** Error in `./001_bairstow2': free(): invalid next size (fast): 0x0000000000f8c0b0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f97f2ecf7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f97f2ed837a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f97f2edc53c]
./001_bairstow2[0x402010]
./001_bairstow2[0x401815]
./001_bairstow2[0x400c78]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f97f2e78830]
./001_bairstow2[0x400e49]
======= Memory map: ========
00400000-00405000 r-xp 00000000 09:00 7869045 /home/arpi/programming/a60/toms/001_bairstow2
00605000-00606000 r--p 00005000 09:00 7869045 /home/arpi/programming/a60/toms/001_bairstow2
00606000-00607000 rw-p 00006000 09:00 7869045 /home/arpi/programming/a60/toms/001_bairstow2
00f8c000-00fad000 rw-p 00000000 00:00 0 [heap]
7f97ec000000-7f97ec021000 rw-p 00000000 00:00 0
7f97ec021000-7f97f0000000 ---p 00000000 00:00 0
7f97f2c42000-7f97f2c58000 r-xp 00000000 08:21 5247481 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f97f2c58000-7f97f2e57000 ---p 00016000 08:21 5247481 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f97f2e57000-7f97f2e58000 rw-p 00015000 08:21 5247481 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f97f2e58000-7f97f3018000 r-xp 00000000 08:21 5254184 /lib/x86_64-linux-gnu/libc-2.23.so
7f97f3018000-7f97f3218000 ---p 001c0000 08:21 5254184 /lib/x86_64-linux-gnu/libc-2.23.so
7f97f3218000-7f97f321c000 r--p 001c0000 08:21 5254184 /lib/x86_64-linux-gnu/libc-2.23.so
7f97f321c000-7f97f321e000 rw-p 001c4000 08:21 5254184 /lib/x86_64-linux-gnu/libc-2.23.so
7f97f321e000-7f97f3222000 rw-p 00000000 00:00 0
7f97f3222000-7f97f332a000 r-xp 00000000 08:21 5244227 /lib/x86_64-linux-gnu/libm-2.23.so
7f97f332a000-7f97f3529000 ---p 00108000 08:21 5244227 /lib/x86_64-linux-gnu/libm-2.23.so
7f97f3529000-7f97f352a000 r--p 00107000 08:21 5244227 /lib/x86_64-linux-gnu/libm-2.23.so
7f97f352a000-7f97f352b000 rw-p 00108000 08:21 5244227 /lib/x86_64-linux-gnu/libm-2.23.so
7f97f352b000-7f97f3551000 r-xp 00000000 08:21 5254182 /lib/x86_64-linux-gnu/ld-2.23.so
7f97f371f000-7f97f3723000 rw-p 00000000 00:00 0
7f97f374f000-7f97f3750000 rw-p 00000000 00:00 0
7f97f3750000-7f97f3751000 r--p 00025000 08:21 5254182 /lib/x86_64-linux-gnu/ld-2.23.so
7f97f3751000-7f97f3752000 rw-p 00026000 08:21 5254182 /lib/x86_64-linux-gnu/ld-2.23.so
7f97f3752000-7f97f3753000 rw-p 00000000 00:00 0
7ffd774af000-7ffd774d0000 rw-p 00000000 00:00 0 [stack]
7ffd775a5000-7ffd775a8000 r--p 00000000 00:00 0 [vvar]
7ffd775a8000-7ffd775aa000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
The same code (with fabs replaced by abs and using # instead of e for scientific form constants) runs with MARST and generates the output provided in the certification of the algorithm.
003_bairstow2.txt
The text was updated successfully, but these errors were encountered: