Re: some bugs in function "reg_multlin"

From: Heavenly Avenger - NCL <avenger-ncl_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 28 2012 - 09:51:47 MST

By changin values I¡¯ve changed the error as well. On my system, the same code and values from Cenlin He just gave me a bare segfault. With new values, I¡¯ve got double free() error:

Values I used:
x(0,:) = 1.0
x(1,:) = (/2.2,2.4,1.1,3.2,5.3/)
x(2,:) = (/1.2, 4.3, 3.0,2.1,0.89/)
x(3,:) = (/ 2.3,1.1,2.2,3.1,2.3/)
x(4,:) = (/1.2,3.4,3.2,3.3, 2.0/)
x(5,:) = (/2.1, 3.0, 7.0,8.7,8.8/)
x(6,:) = (/3.2, 3.0,3.5,1.23,3.0/)

--- snippet of the error ---
*** glibc detected *** ncl: double free or corruption (out): 0x0000000007cf9f60 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x75605)[0x7fa6d3eb0605]
/lib64/libc.so.6(cfree+0x6c)[0x7fa6d3eb556c]
ncl(dzregr1_+0x420)[0x885f86]
ncl(reg_multlin_W+0x3e5)[0x7bb3d5]
ncl(CallINTRINSIC_FUNC_CALL+0x43)[0x69ad78]
ncl(_NclExecute+0x3d4)[0x6a1635]
ncl(yyparse+0x82f)[0x5a5e51]
ncl(main+0xb45)[0x5a1223]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7fa6d3e5ce9d]
ncl[0x5a05d9]
======= Memory map: ========
00400000-01a36000 r-xp 00000000 09:03 47975892 /usr/ncl/bin/ncl
01c36000-01e3b000 rw-p 01636000 09:03 47975892 /usr/ncl/bin/ncl
01e3b000-02f44000 rw-p 00000000 00:00 0
048d6000-07d06000 rw-p 00000000 00:00 0 [heap]
7fa6cc000000-7fa6cc021000 rw-p 00000000 00:00 0
7fa6cc021000-7fa6d0000000 ---p 00000000 00:00 0
7fa6d2dd7000-7fa6d2de3000 r-xp 00000000 09:03 13002369 /lib64/libnss_files-2.12.2.so
7fa6d2de3000-7fa6d2fe2000 ---p 0000c000 09:03 13002369 /lib64/libnss_files-2.12.2.so
7fa6d2fe2000-7fa6d2fe3000 r--p 0000b000 09:03 13002369 /lib64/libnss_files-2.12.2.so
7fa6d2fe3000-7fa6d2fe4000 rw-p 0000c000 09:03 13002369 /lib64/libnss_files-2.12.2.so
7fa6d2fe4000-7fa6d2fee000 r-xp 00000000 09:03 13002407 /lib64/libnss_nis-2.12.2.so
7fa6d2fee000-7fa6d31ed000 ---p 0000a000 09:03 13002407 /lib64/libnss_nis-2.12.2.so
7fa6d31ed000-7fa6d31ee000 r--p 00009000 09:03 13002407 /lib64/libnss_nis-2.12.2.so
7fa6d31ee000-7fa6d31ef000 rw-p 0000a000 09:03 13002407 /lib64/libnss_nis-2.12.2.so
7fa6d31ef000-7fa6d3204000 r-xp 00000000 09:03 13002332 /lib64/libnsl-2.12.2.so
7fa6d3204000-7fa6d3403000 ---p 00015000 09:03 13002332 /lib64/libnsl-2.12.2.so
7fa6d3403000-7fa6d3404000 r--p 00014000 09:03 13002332 /lib64/libnsl-2.12.2.so
7fa6d3404000-7fa6d3405000 rw-p 00015000 09:03 13002332 /lib64/libnsl-2.12.2.so
7fa6d3405000-7fa6d3407000 rw-p 00000000 00:00 0
7fa6d3407000-7fa6d340e000 r-xp 00000000 09:03 13002431 /lib64/libnss_compat-2.12.2.so
7fa6d340e000-7fa6d360d000 ---p 00007000 09:03 13002431 /lib64/libnss_compat-2.12.2.so
7fa6d360d000-7fa6d360e000 r--p 00006000 09:03 13002431 /lib64/libnss_compat-2.12.2.so
7fa6d360e000-7fa6d360f000 rw-p 00007000 09:03 13002431 /lib64/libnss_compat-2.12.2.so
7fa6d360f000-7fa6d3810000 rw-p 00000000 00:00 0
7fa6d3810000-7fa6d3816000 r-xp 00000000 09:03 6029722 /usr/lib64/libXdmcp.so.6.0.0
7fa6d3816000-7fa6d3a15000 ---p 00006000 09:03 6029722 /usr/lib64/libXdmcp.so.6.0.0
7fa6d3a15000-7fa6d3a16000 r--p 00005000 09:03 6029722 /usr/lib64/libXdmcp.so.6.0.0
7fa6d3a16000-7fa6d3a17000 rw-p 00006000 09:03 6029722 /usr/lib64/libXdmcp.so.6.0.0
7fa6d3a17000-7fa6d3a1a000 r-xp 00000000 09:03 6029703 /usr/lib64/libXau.so.6.0.0
7fa6d3a1a000-7fa6d3c19000 ---p 00003000 09:03 6029703 /usr/lib64/libXau.so.6.0.0
7fa6d3c19000-7fa6d3c1a000 r--p 00002000 09:03 6029703 /usr/lib64/libXau.so.6.0.0
7fa6d3c1a000-7fa6d3c1b000 rw-p 00003000 09:03 6029703 /usr/lib64/libXau.so.6.0.0
7fa6d3c1b000-7fa6d3c3a000 r-xp 00000000 09:03 6034995 /usr/lib64/libxcb.so.1.1.0
7fa6d3c3a000-7fa6d3e39000 ---p 0001f000 09:03 6034995 /usr/lib64/libxcb.so.1.1.0
7fa6d3e39000-7fa6d3e3a000 r--p 0001e000 09:03 6034995 /usr/lib64/libxcb.so.1.1.0
7fa6d3e3a000-7fa6d3e3b000 rw-p 0001f000 09:03 6034995 /usr/lib64/libxcb.so.1.1.0
7fa6d3e3b000-7fa6d3f9c000 r-xp 00000000 09:03 13002430 /lib64/libc-2.12.2.so
7fa6d3f9c000-7fa6d419c000 ---p 00161000 09:03 13002430 /lib64/libc-2.12.2.so
7fa6d419c000-7fa6d41a0000 r--p 00161000 09:03 13002430 /lib64/libc-2.12.2.so
7fa6d41a0000-7fa6d41a1000 rw-p 00165000 09:03 13002430 /lib64/libc-2.12.2.so
7fa6d41a1000-7fa6d41a6000 rw-p 00000000 00:00 0
7fa6d41a6000-7fa6d41bb000 r-xp 00000000 09:03 2097183 /lib64/libgcc_s.so.1
7fa6d41bb000-7fa6d43ba000 ---p 00015000 09:03 2097183 /lib64/libgcc_s.so.1
7fa6d43ba000-7fa6d43bb000 r--p 00014000 09:03 2097183 /lib64/libgcc_s.so.1
7fa6d43bb000-7fa6d43bc000 rw-p 00015000 09:03 2097183 /lib64/libgcc_s.so.1
7fa6d43bc000-7fa6d44a7000 r-xp 00000000 09:03 13775617 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6.0.14
7fa6d44a7000-7fa6d46a6000 ---p 000eb000 09:03 13775617 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6.0.14
7fa6d46a6000-7fa6d46ae000 r--p 000ea000 09:03 13775617 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6.0.14
7fa6d46ae000-7fa6d46b0000 rw-p 000f2000 09:03 13775617 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6.0.14
7fa6d46b0000-7fa6d46c5000 rw-p 00000000 00:00 0
7fa6d46c5000-7fa6d46c7000 r-xp 00000000 09:03 13002322 /lib64/libdl-2.12.2.so
7fa6d46c7000-7fa6d48c7000 ---p 00002000 09:03 13002322 /lib64/libdl-2.12.2.so
7fa6d48c7000-7fa6d48c8000 r--p 00002000 09:03 13002322 /lib64/libdl-2.12.2.so
7fa6d48c8000-7fa6d48c9000 rw-p 00003000 09:03 13002322 /lib64/libdl-2.12.2.so
7fa6d48c9000-7fa6d4949000 r-xp 00000000 09:03 13002379 /lib64/libm-2.12.2.so
7fa6d4949000-7fa6d4b48000 ---p 00080000 09:03 13002379 /lib64/libm-2.12.2.so
7fa6d4b48000-7fa6d4b49000 r--p 0007f000 09:03 13002379 /lib64/libm-2.12.2.so
7fa6d4b49000-7fa6d4b4a000 rw-p 00080000 09:03 13002379 /lib64/libm-2.12.2.so
7fa6d4b4a000-7fa6d4b62000 r-xp 00000000 09:03 6030436 /usr/lib64/libXext.so.6.4.0
7fa6d4b62000-7fa6d4d61000 ---p 00018000 09:03 6030436 /usr/lib64/libXext.so.6.4.0
7fa6d4d61000-7fa6d4d62000 r--p 00017000 09:03 6030436 /usr/lib64/libXext.so.6.4.0
7fa6d4d62000-7fa6d4d63000 rw-p 00018000 09:03 6030436 /usr/lib64/libXext.so.6.4.0
7fa6d4d63000-7fa6d4eed000 r-xp 00000000 09:03 12866107 /usr/lib64/libX11.so.6.3.0
7fa6d4eed000-7fa6d50ed000 ---p 0018a000 09:03 12866107 /usr/lib64/libX11.so.6.3.0
7fa6d50ed000-7fa6d50ee000 r--p 0018a000 09:03 12866107 /usr/lib64/libX11.so.6.3.0
7fa6d50ee000-7fa6d50f3000 rw-p 0018b000 09:03 12866107 /usr/lib64/libX11.so.6.3.0
7fa6d50f3000-7fa6d510b000 r-xp 00000000 09:03 13001825 /lib64/libpthread-2.12.2.so
7fa6d510b000-7fa6d530a000 ---p 00018000 09:03 13001825 /lib64/libpthread-2.12.2.so
7fa6d530a000-7fa6d530b000 r--p 00017000 09:03 13001825 /lib64/libpthread-2.12.2.so
7fa6d530b000-7fa6d530c000 rw-p 00018000 09:03 13001825 /lib64/libpthread-2.12.2.so
7fa6d530c000-7fa6d5310000 rw-p 00000000 00:00 0
7fa6d5310000-7fa6d532e000 r-xp 00000000 09:03 13002424 /lib64/ld-2.12.2.so
7fa6d5438000-7fa6d5505000 rw-p 00000000 00:00 0
7fa6d5507000-7fa6d552d000 rw-p 00000000 00:00 0
7fa6d552d000-7fa6d552e000 r--p 0001d000 09:03 13002424 /lib64/ld-2.12.2.so
7fa6d552e000-7fa6d552f000 rw-p 0001e000 09:03 13002424 /lib64/ld-2.12.2.so
7fa6d552f000-7fa6d5530000 rw-p 00000000 00:00 0
7fffada0e000-7fffada70000 rw-p 00000000 00:00 0 [stack]
7fffadbff000-7fffadc00000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted
--- snippet end ---

From: ºØä¹ÁØ
Sent: Saturday, February 25, 2012 2:24 AM
To: ncl-talk@ucar.edu
Subject: some bugs in function "reg_multlin"

Recently I have run into the following problems about the function "reg_multlin" in NCL.

when I used function "reg_multlin" to do the multiple linear regression, I found it could not work correctly if there are more than four independent variables (x1,x2,x3,...) in this regression process, and the system always indicated me error (which is shown in the picture "error indication" in the attachment). I do not know why and I hope you can help me solve this problem. Because I need this program to work correctly urgently.

My program file has been attached in the attachment. The system I use is Linux_RedHat (x86_64), and the NCL version I installed is 6.0.0 Linux_RedHat_x86_64_gcc412.

I am looking forward to your reply. Thank you for your time.

Best regard

--
Cenlin He
Environmental Sciences (Major)
Mathematics & Applied Mathematics (Double Major)
College of Urban and Environmental Science
Peking University
Beijing 100871
China
--------------------------------------------------------------------------------
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 28 09:52:16 2012

This archive was generated by hypermail 2.1.8 : Mon Mar 05 2012 - 14:12:07 MST