Installation with the debugging option

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Maria Joao Teles

Installation with the debugging option

Post by Maria Joao Teles »

Hi=)

I'm a new user of code saturne and i have installed it in version 1.3.3 with the automatic install script.  I have tested a simple test case which run well.

Now, I have a test case with mode ALE activated which it has already been run successfully, but not with me...(I'm using the same code saturne version, the same fortran subroutines and the same mesh file!!)

I'm getting an error in which the error file on the tmp directory only says: " ERREUR WHILE RUNNING THE KERNEL (SOLVER)". In the Terminal I have " *** buffer overflow detected ***: /home/maria/tmp_Saturne/SOLITAODBG.CAS1.06011800/cs13.exe terminated". I can't find the error..I have a Intel(R) Core(TM)2 Quad CPU    Q9400  @ 2.66GHz with Ubuntu 9.10 installed...might be an Ubuntu problem?

I have checked the listing file and it doesn't have any error, it simply stops in the middle of the simulation. The same happens with the compile.log file in which I can't detect any type of error. Anyway I attach the referred files.

Meanwhile I would like to use a debbuger to try to discover the problem and I saw on the practical user's guide 1.3.2 that different compilation options are available for each module (in which there is DBG option), but I can't get where I have to make the changes to have code saturne with the debugger on.

Anyone to help?

Thank you a lot in advance,

Maria
Attachments
compil.log
(33.19 KiB) Downloaded 221 times
listing.txt
(22.39 KiB) Downloaded 208 times
David Monfort

Re: Installation with the debugging option

Post by David Monfort »

Hi Maria !

I've recently talked about your problem with Olivier ;)

The first thing to do is to fix the warning you get while compiling the code. Specifically, you need to change the type of the variables IFAC2 and IND in usalcl2.f90: they are defined as double precision but should be as defined as integer (otherwise this isn't Fortran compatible). Then, you should try again to run your simulation.

If is still doesn't run properly, you should indeed compile the code with debugging information. To do this, go in the Noyau/ncs-1.3.3/bin directory and type the following:
. ./cs_profile
./lance_install -DBG
This should install the kernel package with debugging information (like variable names in debuggers). Then, you can launch the code in debug mode just by setting the variable OPTIMISATION to DBG in the lance script. That's it!

If it (still) doesn't help you... and if the test case isn't too big (here you can), install the valgrind tool through your package manager and then set the variable VALGRIND to "valgrind --tool=memcheck" in the lance script. This will launch Code_Saturne "under" valgrind and will give you many more information on potential memory issues. You can then send us the new listing file.

Hope you'll find something ;)

David
Maria Joao Teles

Re: Installation with the debugging option

Post by Maria Joao Teles »

Salut David!

Sorry for the late answer, but among other things I have been trying to resolve my problem but unsuccessfully:/  I have followed your last suggestions but i get the same error..I have
installed code saturne with the debug option but I'm facing some difficulties to understand what Valgrind is returning. I post in the following what I get:
 
*** buffer overflow detected ***: /home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x714cb87]
/lib/libc.so.6[0x714bb30]
/lib/libc.so.6[0x714af99]
/lib/libc.so.6(_IO_default_xsputn+0x98)[0x70c9968]
/lib/libc.so.6(_IO_vfprintf+0xfa7)[0x709ad47]
/lib/libc.so.6(__vsprintf_chk+0x99)[0x714b039]
/lib/libc.so.6(__sprintf_chk+0x7f)[0x714af7f]
/home/maria/Saturne_1.3.3dbg/opt/fvm-0.12.0/arch/Linux_x86_64/lib/libfvm.so.0[0x4e8edec]
/home/maria/Saturne_1.3.3dbg/opt/fvm-0.12.0/arch/Linux_x86_64/lib/libfvm.so.0(fvm_to_ensight_case_create+0x6f8)[0x4e8f8f8]
/home/maria/Saturne_1.3.3dbg/opt/fvm-0.12.0/arch/Linux_x86_64/lib/libfvm.so.0(fvm_to_ensight_init_writer+0x106)[0x4e8a156]
/home/maria/Saturne_1.3.3dbg/opt/fvm-0.12.0/arch/Linux_x86_64/lib/libfvm.so.0(fvm_writer_init+0x834)[0x4e98494]
/home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe(cs_post_ajoute_writer+0x1d2)[0x47b0d4]
/home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe(cs_post_init_pcp_writer+0x1b3)[0x47cc1b]
/home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe(main+0x270)[0x45f244]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7073abd]
/home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe[0x414569]
======= Memory map: ========
00400000-008fe000 r-xp 00000000 08:02 4179374                            /home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe
00afd000-00afe000 r--p 004fd000 08:02 4179374                            /home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe
00afe000-00aff000 rw-p 004fe000 08:02 4179374                            /home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe
00aff000-0168d000 rw-p 00000000 00:00 0
04000000-0401f000 r-xp 00000000 08:02 3940375                            /lib/ld-2.10.1.so
0401f000-04023000 rw-p 00000000 00:00 0
04023000-04024000 r--p 00000000 08:02 5801151                            /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION
04024000-0402b000 r--s 00000000 08:02 5775482                            /usr/lib/gconv/gconv-modules.cache
0402b000-0402c000 r--p 00000000 08:02 5801339                            /usr/lib/locale/en_US.utf8/LC_MEASUREMENT
0402c000-0402d000 r--p 00000000 08:02 5801153                            /usr/lib/locale/en_US.utf8/LC_TELEPHONE
0402d000-0402e000 r--p 00000000 08:02 5801148                            /usr/lib/locale/en_US.utf8/LC_ADDRESS
0402e000-0402f000 r--p 00000000 08:02 5801066                            /usr/lib/locale/en_US.utf8/LC_NAME
0402f000-04030000 r--p 00000000 08:02 5801343                            /usr/lib/locale/en_US.utf8/LC_PAPER
04030000-04031000 r--p 00000000 08:02 5808152                            /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
04031000-04032000 r--p 00000000 08:02 5801149                            /usr/lib/locale/en_US.utf8/LC_MONETARY
04032000-04033000 r--p 00000000 08:02 5801155                            /usr/lib/locale/en_US.utf8/LC_TIME
04033000-04034000 r--p 00000000 08:02 5801430                            /usr/lib/locale/en_US.utf8/LC_NUMERIC
0404e000-04055000 rw-p 00000000 00:00 0
04055000-04142000 r--p 00000000 08:02 5800940                            /usr/lib/locale/en_US.utf8/LC_COLLATE
04142000-04181000 r--p 00000000 08:02 5801315                            /usr/lib/locale/en_US.utf8/LC_CTYPE
0421e000-0421f000 r--p 0001e000 08:02 3940375                            /lib/ld-2.10.1.so
0421f000-04220000 rw-p 0001f000 08:02 3940375                            /lib/ld-2.10.1.so
04220000-04221000 rwxp 00000000 00:00 0
04a20000-04a21000 r-xp 00000000 08:02 2678789                            /usr/lib/valgrind/vgpreload_core-amd64-linux.so
04a21000-04c20000 ---p 00001000 08:02 2678789                            /usr/lib/valgrind/vgpreload_core-amd64-linux.so
04c20000-04c21000 r--p 00000000 08:02 2678789                            /usr/lib/valgrind/vgpreload_core-amd64-linux.so
04c21000-04c22000 rw-p 00001000 08:02 2678789                            /usr/lib/valgrind/vgpreload_core-amd64-linux.so
04c22000-04c29000 r-xp 00000000 08:02 2678798                            /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
04c29000-04e28000 ---p 00007000 08:02 2678798                            /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
04e28000-04e29000 r--p 00006000 08:02 2678798                            /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
04e29000-04e2a000 rw-p 00007000 08:02 2678798                            /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
04e2a000-04ea5000 r-xp 00000000 08:02 5079299                            /home/maria/Saturne_1.3.3dbg/opt/fvm-0.12.0/arch/Linux_x86_64/lib/libfvm.so.0.0.0
04ea5000-050a4000 ---p 0007b000 08:02 5079299                            /home/maria/Saturne_1.3.3dbg/opt/fvm-0.12.0/arch/Linux_x86_64/lib/libfvm.so.0.0.0
050a4000-050a5000 r--p 0007a000 08:02 5079299                            /home/maria/Saturne_1.3.3dbg/opt/fvm-0.12.0/arch/Linux_x86_64/lib/libfvm.so.0.0.0
050a5000-050a6000 rw-p 0007b000 08:02 5079299                            /home/maria/Saturne_1.3.3dbg/opt/fvm-0.12.0/arch/Linux_x86_64/lib/libfvm.so.0.0.0
050a6000-050b1000 r-xp 00000000 08:02 5079137                            /home/maria/Saturne_1.3.3dbg/opt/bft-1.0.8/arch/Linux_x86_64/lib/libbft.so.1.0.0
050b1000-052b0000 ---p 0000b000 08:02 5079137                            /home/maria/Saturne_1.3.3dbg/opt/bft-1.0.8/arch/Linux_x86_64/lib/libbft.so.1.0.0
052b0000-052b1000 r--p 0000a000 08:02 5079137                            /home/maria/Saturne_1.3.3dbg/opt/bft-1.0.8/arch/Linux_x86_64/lib/libbft.so.1.0.0
052b1000-052b2000 rw-p 0000b000 08:02 5079137                            /home/maria/Saturne_1.3.3dbg/opt/bft-1.0.8/arch/Linux_x86_64/lib/libbft.so.1.0.0
052b2000-053d0000 r-xp 00000000 08:02 5769824                            /usr/lib/libhdf5-1.6.6.so.0.0.0
053d0000-055cf000 ---p 0011e000 08:02 5769824                            /usr/lib/libhdf5-1.6.6.so.0.0.0
055cf000-055d2000 r--p 0011d000 08:02 5769824                            /usr/lib/libhdf5-1.6.6.so.0.0.0
055d2000-055d4000 rw-p 00120000 08:02 5769824                            /usr/lib/libhdf5-1.6.6.so.0.0.0
055d4000-055d5000 rw-p 00000000 00:00 0
055d5000-0571b000 r-xp 00000000 08:02 5768620                            /usr/lib/libxml2.so.2.7.5
0571b000-0591a000 ---p 00146000 08:02 5768620                            /usr/lib/libxml2.so.2.7.5
0591a000-05922000 r--p 00145000 08:02 5768620                            /usr/lib/libxml2.so.2.7.5
05922000-05924000 rw-p 0014d000 08:02 5768620                            /usr/lib/libxml2.so.2.7.5
05924000-05925000 rw-p 00000000 00:00 0
05925000-059b4000 r-xp 00000000 08:02 5081039                            /home/maria/Saturne_1.3.3dbg/opt/openmpi-1.4.1/arch/Linux_x86_64/lib/libmpi.so.0.0.1==9427==
==9427== HEAP SUMMARY:
==9427==     in use at exit: 1,037,408 bytes in 62 blocks
==9427==   total heap usage: 2,136 allocs, 2,074 frees, 2,392,466 bytes allocated
==9427==
==9427== 300 (60 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 47 of 62
==9427==    at 0x4C25153: malloc (vg_replace_malloc.c:195)
==9427==    by 0x714822A: nss_parse_service_list (nsswitch.c:622)
==9427==    by 0x7148B4D: __nss_database_lookup (nsswitch.c:164)
==9427==    by 0x79DE3BF: ???
==9427==    by 0x79DF5E4: ???
==9427==    by 0x70F876C: getpwuid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:253)
==9427==    by 0x70F803E: getpwuid (getXXbyYY.c:117)
==9427==    by 0x44ABE3: cs_base_info_systeme (cs_base.c:851)
==9427==    by 0x45F116: main (cs_main.c:294)
==9427==
==9427== LEAK SUMMARY:
==9427==    definitely lost: 60 bytes in 1 blocks
==9427==    indirectly lost: 240 bytes in 10 blocks
==9427==      possibly lost: 0 bytes in 0 blocks
==9427==    still reachable: 1,037,108 bytes in 51 blocks
==9427==         suppressed: 0 bytes in 0 blocks
==9427== Reachable blocks (those to which a pointer was found) are not shown.
==9427== To see them, rerun with: --leak-check=full --show-reachable=yes
==9427==
==9427== For counts of detected and suppressed errors, rerun with: -v
==9427== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)
/home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/localexec: line 3:  9427 Aborted                 valgrind --tool=memcheck --leak-check=full --track-origins=yes /home/maria/tmp_Saturne/SOLITAODBG.CAS1.06081448/cs13DBG.exe $@ -iasize 1000000 -rasize 5000000
 
  ********************************************
ERREUR WHILE RUNNING THE KERNEL (SOLVER)
 
Do you think you can help me? I also attach the compil.log file..
.

Thank you=)

Maria
Attachments
compil.log
(28.79 KiB) Downloaded 207 times
David Monfort

Re: Installation with the debugging option

Post by David Monfort »

Hi Maria,

I have no idea (yet !) why it fails... Could you attach the latest listing file you get (the one with the valgrind test) ? At least, you do not have anymore compilation warnings, that's better.

David
David Monfort

Re: Installation with the debugging option

Post by David Monfort »

Actually, we talked with Yvan, and it seems the error you get is in FVM and has been corrected in a newer version...

Could you try the following ?
- go to the fvm-0.12.0/src directory in the /path/to/code_saturne/src directory (or something like that)
- edit the fvm_to_ensight_case.c file
- at line 534, change the number 9 in 16 (it is the length of the character array extension)
- re-install FVM (in fvm-0.12.0/..., type make && make install) and the kernel manually
Tell us if it works afterwards.

David
Maria Joao Teles

Re: Installation with the debugging option

Post by Maria Joao Teles »

Salut David!!

It is corrected and now it works fine=D!!Thank you a lot for the help!

Maria Joao
Post Reply