Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

traceback not working on Mac

nooj
Beginner
1,720 Views
I have some example code which gives traceback information on a severe error under linux (ifort v10.1), but not Mac (ifort v10.0):

Linux box is running Ubuntu. uname -a says
Linux xxx.xxx.xxx.xxx 2.6.24-24-generic #1 SMP Wed Apr 15 15:11:35 UTC 2009 x86_64 GNU/Linux
ifort --version: ifort (IFORT) 10.1 20080602

Mac box is OSX 10.5. uname -a says
Darwin yyy.yyy.yyy.yyy 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386
ifort --version: ifort (IFORT) 10.0 20070809



The make line for both is:

ifort -O3 -traceback -C uninit.f -o a.out

output for mac is:

init: val 5
init: vec 1 2
call to init succeeded.
noinit: vec 0 0
forrtl: severe (193): Run-Time Check Failure. The variable 'noinit_$VAL' is being used without being defined


output for linux is:

init: val 5
init: vec 1 2
call to init succeeded.
noinit: vec 0 0
forrtl: severe (193): Run-Time Check Failure. The variable 'noinit_$VAL' is being used without being defined
Image PC Routine Line Source
a.out-C 000000000045C46A Unknown Unknown Unknown
a.out-C 000000000045B4C4 Unknown Unknown Unknown
a.out-C 000000000041D69A Unknown Unknown Unknown
a.out-C 0000000000404079 Unknown Unknown Unknown
a.out-C 00000000004056EE Unknown Unknown Unknown
a.out-C 0000000000402C82 MAIN__ 17 uninit.f
a.out-C 00000000004029E2 Unknown Unknown Unknown
libc.so.6 00002ABBFAED41C4 Unknown Unknown Unknown
a.out-C 0000000000402929 Unknown Unknown Unknown


the source code is (feel free to correct my claims in the comments below):

C This program tests compile and run-time errors with
C initialization. The "noinit" call will fail with -CU,
C But play around with things.
C
C The takeaway is that "-check uninit" (aka "-CU") ONLY works with
C SCALARS, NOT VECTORS OR ARRAYS. And "-ftrapuv" doesn't seem to
C work at all.

program uninit_test
integer a(2)
a=(/1,2/)

call init
write(*,*) "call to init succeeded."
write(*,*) ""

call noinit
write(*,*) "call to noinit succeeded."
write(*,*) ""

write(*,*) 'before intentout: a=',a
call intentout(a)
write(*,*) 'after intentout: a=',a
end


subroutine init()
integer val, vec(2)
val = 5
vec = (/1,2/)
write(*,*) "init: val ",val
write(*,*) "init: vec ",vec
end


subroutine noinit()
integer val, vec(2)
write(*,*) "noinit: vec ",vec
write(*,*) "noinit: val ",val
end


subroutine intentout(a)
integer, intent(out) :: a(2)
write(*,*) 'before setting a(2): a=',a
a(2)=3
write(*,*) 'after setting a(2): a=',a
end

0 Kudos
1 Solution
Kevin_D_Intel
Employee
1,720 Views
Quoting - nooj
Why is there no traceback info on Mac? Do I need -g? Does -g -O3 cause a runtime performance penalty?
I understand -traceback does not cause any performance hit (seehttp://software.intel.com/en-us/forums/showthread.php?t=66468).

The lack of the traceback on the Mac was a bug in the older 10.0 compiler you are using that's now fixed in the 11.1 Release. The traceback was fixed in the 10.1 release and then problems with symbolizationof thetraceback were fixed in 11.0. (Internal tracking id: DPD200039483)

-g is needed to symbolize the traceback with source/line number information.

Ron discussed the possible impacts for -O3 -g in the earlier post.

Here's what 11.1 produces for your test case:

$ ifort -V -O3 -traceback -g -C uninit.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20090511 Package ID: m_cprof_p_11.1.046
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Intel Fortran 11.1-2492
@(#)PROGRAM:ld PROJECT:ld64-85.2.1
Library search paths:
/usr/bin/ifort-11.1-base/lib
/usr/lib/i686-apple-darwin9/4.0.1/
/usr/lib/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/x86_64
/usr/lib/gcc/i686-apple-darwin9/4.0.1/
/usr/lib/i686-apple-darwin9/4.0.1
/usr/lib
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/


$ ./a.out
init: val 5
init: vec 1 2
call to init succeeded.

noinit: vec 0 0
forrtl: severe (193): Run-Time Check Failure. The variable 'noinit_$VAL' is being used without being defined
Image PC Routine Line Source
a.out 000000010006DEAC Unknown Unknown Unknown
a.out 000000010006C9E4 Unknown Unknown Unknown
a.out 00000001000450E7 Unknown Unknown Unknown
a.out 000000010001BB68 Unknown Unknown Unknown
a.out 000000010001C5C8 Unknown Unknown Unknown
a.out 0000000100001503 _MAIN__ 20 uninit.f
a.out 00000001000011EC Unknown Unknown Unknown
a.out 0000000100001184 Unknown Unknown Unknown

View solution in original post

0 Kudos
4 Replies
nooj
Beginner
1,720 Views
Oops. I forgot to actually ask a question.

Why is there no traceback info on Mac? Do I need -g? Does -g -O3 cause a runtime performance penalty?
I understand -traceback does not cause any performance hit (seehttp://software.intel.com/en-us/forums/showthread.php?t=66468).

Thanks, all!

- Nooj

0 Kudos
Kevin_D_Intel
Employee
1,721 Views
Quoting - nooj
Why is there no traceback info on Mac? Do I need -g? Does -g -O3 cause a runtime performance penalty?
I understand -traceback does not cause any performance hit (seehttp://software.intel.com/en-us/forums/showthread.php?t=66468).

The lack of the traceback on the Mac was a bug in the older 10.0 compiler you are using that's now fixed in the 11.1 Release. The traceback was fixed in the 10.1 release and then problems with symbolizationof thetraceback were fixed in 11.0. (Internal tracking id: DPD200039483)

-g is needed to symbolize the traceback with source/line number information.

Ron discussed the possible impacts for -O3 -g in the earlier post.

Here's what 11.1 produces for your test case:

$ ifort -V -O3 -traceback -g -C uninit.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20090511 Package ID: m_cprof_p_11.1.046
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Intel Fortran 11.1-2492
@(#)PROGRAM:ld PROJECT:ld64-85.2.1
Library search paths:
/usr/bin/ifort-11.1-base/lib
/usr/lib/i686-apple-darwin9/4.0.1/
/usr/lib/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/x86_64
/usr/lib/gcc/i686-apple-darwin9/4.0.1/
/usr/lib/i686-apple-darwin9/4.0.1
/usr/lib
/usr/lib
/usr/local/lib
Framework search paths:
/Library/Frameworks/
/System/Library/Frameworks/


$ ./a.out
init: val 5
init: vec 1 2
call to init succeeded.

noinit: vec 0 0
forrtl: severe (193): Run-Time Check Failure. The variable 'noinit_$VAL' is being used without being defined
Image PC Routine Line Source
a.out 000000010006DEAC Unknown Unknown Unknown
a.out 000000010006C9E4 Unknown Unknown Unknown
a.out 00000001000450E7 Unknown Unknown Unknown
a.out 000000010001BB68 Unknown Unknown Unknown
a.out 000000010001C5C8 Unknown Unknown Unknown
a.out 0000000100001503 _MAIN__ 20 uninit.f
a.out 00000001000011EC Unknown Unknown Unknown
a.out 0000000100001184 Unknown Unknown Unknown
0 Kudos
nooj
Beginner
1,720 Views
Ah. That's unfortunate. I'm using the latest Student version, which is about fifty times cheaper than the latest pro version. Thanks for fixing it, though! And for the info!


The lack of the traceback on the Mac was a bug in the older 10.0 compiler you are using that's now fixed in the 11.1 Release. The traceback was fixed in the 10.1 release and then problems with symbolizationof thetraceback were fixed in 11.0.

Here's what 11.1 produces for your test case:
[snip correct output]
0 Kudos
Kevin_D_Intel
Employee
1,720 Views

If your support services for your Student license are still valid then you're entitled to upgrade to the 11.1 Release for free. If it has expired, then perhaps you could purchase another new subscription (no renewals are available for Student licenses) at the current Student pricing assuming you still qualify.
0 Kudos
Reply