-
Notifications
You must be signed in to change notification settings - Fork 13
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
GSL: Bugs #573
Comments
Fixed the NAN printing issue. I'll look into the other one... it requires GSL v2.8 right? |
Yes, you don't have to install it, just make:
|
Thanks, fixed my problems there.
…On Fri, Jul 26, 2024 at 8:54 AM flexoron ***@***.***> wrote:
Yes, you don't have to install it, just make:
https://www.gnu.org/software/gsl/
$ tar xf gsl-release-2-8.tar.gz
$ cd gsl-release-2-8
$ ./autogen.sh
$ ./configure
$ make
$ export LD_LIBRARY_PATH=$HOME/tools/gsl/gsl-release-2-8/.libs:$HOME/tools/gsl/gsl-release-2-8/cblas/.libs
$
$ $ gcc -I$HOME/tools/gsl/gsl-release-2-8 x.c -L$HOME/tools/gsl/gsl-release-2-8/.libs -L$HOME/tools/gsl/gsl-release-2-8/cblas/.libs -lgsl -lgslcblas -lm
$ ldd a.out # check libs
$ tpl x.pl
?-
# check libs
$ ps ax|grep tpl
72213 ....
$ lsof -p 72213 | grep gsl
—
Reply to this email directly, view it on GitHub
<#573 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEV5OEQIKYCGHJSCQTLZOF6Z5AVCNFSM6AAAAABLOIBUKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJRGUZTCOBXGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Interesting, if in lu.c / gsl_linalg_LU_decomp() I change:
it works. Seems a bug in GSL 2.8 to me, depending on uninitialized values. |
|
The C program is simple and is allocating virgin zeroed memory from the OS.
In Trealla a lot mallocs & frees have been done.
…On Fri, Jul 26, 2024 at 11:31 AM flexoron ***@***.***> wrote:
Not sure, the C-program does not crash and for example:
$ tpl x.pl
?- between(2,128,S), tst(S,S), fail. % does not crash
?- halt.
$ tpl x.pl
?- between(124,128,S), tst(S,S), fail. % crash
FF pivi 14 i 14
FF pivi 15 i 15
FF pivi 368989664 i 16
Segmentation fault (core dumped)
—
Reply to this email directly, view it on GitHub
<#573 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEXYKFQPSLFSKUWAAY3ZOGRI3AVCNFSM6AAAAABLOIBUKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJRG44DMOJTHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
tpl with GSL v2.7.1 does not crash, too: |
You don't know what else changed that accesses that memory, maybe nothing
but ...
…On Fri, Jul 26, 2024 at 11:37 AM flexoron ***@***.***> wrote:
tpl with GSL v2.7.1 does not crash, too:
v2.7.1: gsl_vector_uint * ipiv = gsl_vector_uint_alloc(minMN);
—
Reply to this email directly, view it on GitHub
<#573 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEQS5TOG34EODYPAKJDZOGR4HAVCNFSM6AAAAABLOIBUKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJRG44TCNJZGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Added this to that function
and it shows all zero elements for x.c & some non-zero ones for x.pl GSL 2.8 is buggy. It was only released a few months ago. |
Yes but this way: non-zero,zero,no-zero,zero,non-zero,zero, or 32,0,64,0,55,0,and so on |
printf("FF pivi %u i %lu\n",pivi,i); |
LU_decomp_L3() & apply_pivots() can't work if the vector ipiv wasn't zeroed properly, so pivi can be incorrect. |
I would suggest submitting a bug report. I did one for GCC about 20 years ago, took about 6 months to get acted on. |
: You see this? The values of M and P and this pivi value are always too close. |
The memory can contain anything. If you dump the newly alloc'd vector it
contains rubbish, which is useless as it's used without ever being
initialized.
…On Fri, Jul 26, 2024 at 12:14 PM flexoron ***@***.***> wrote:
:
gsl_matrix_calloc(Rows, Cols, M),
gsl_permutation_alloc(Rows, P),
write(M/P),nl,
:
968671312 / 969277808
FF pivi 969168480 i 16
Segmentation fault (core dumped)
You see this? The values of M and P and this pivi value are always too
close.
I don't think that this is by chance.
—
Reply to this email directly, view it on GitHub
<#573 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEQ6BIZ73SRTQ37EIPDZOGWHRAVCNFSM6AAAAABLOIBUKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJRHAZTMNJRGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm talking about this...
if the values are non-zero (which they are at some points) you are bound to get errors when they are used as an array index. |
?- tst(40,40). Again pivi is nearby M and P ?- tst(127,127). |
I don't know what you want me to do... gsl_vector_uint_alloc returns unzeroed data (by design) when the following code expected zeroed data. |
Conclusion: |
URL:
|
|
|
I'd copy/paste this but maybe you should create an account an submit a
comment.
…On Sun, 28 July 2024, 01:04 flexoron, ***@***.***> wrote:
fyi
More info for if those gsl guys start a discussion:
1.) ./a.out 128 128 or 256 256 or 512 512 or 1024 1024 does not crash,
so you don't always get the fault.
2.) The problem might be the status of a singular matrix:
status = LU_decomp_L3 (&AL.matrix, ipiv);
If not singular then status = 0 and all fields of vector ipiv are valid(have been processed).
if singular then status = number of fields which have been processed.
For example: singular 127x127 status = 16
means that this is wrong:
for (i = 0; i < minMN; ++i) { # the segfault area
Better is this:
if (!status) status = minMN;
for (i = 0; i < status; ++i) {
Even better (perhaps)
if (status) { ; /* singular, do nothing */
} else {
for (i = 0; i < minMN; ++i) {
:
}
gsl_vector_uint_free(ipiv);
return status;
Performance back: no calloc and in case of singular dismiss signum as valueless.
—
Reply to this email directly, view it on GitHub
<#573 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEXXYCHJTEBRGCDP7HDZOOZIJAVCNFSM6AAAAABLOIBUKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGE3TGMJSGU>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
|
The text was updated successfully, but these errors were encountered: