- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have a very large structure ~10GB. GCC does not seem to have a problem with it but ICC is seg faulting. I've boiled it down to simple assignment statements. Any ideas? Files attached. If we don't allocate but declare the structure it works fine. Any problems with Intel allocating large amounts of memory? We've tried moving things around in the structure definition but it continues to seg fault.
icc -mcmodel=medium -shared-intel -g test.c -o test
gcc -mcmodel=medium -g test.c -o test
icc: Version 12.1.5.339 Build 20120612
gcc: gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
GCC output:
Allocate the grid struct
sizeof of grids 9.393871GB
Address of grids->G2.rain.count 0x7f5d05143190
Address of grids->G2.d0.count 0x7f5d61d35190
Address of grids->G2.Nt.count 0x7f5d96d2d190
Address of grids->G2.dBZm.count 0x7f5f079a0190
location: 0
G2.dBZ.stdev[ii][jj][kk][ll][mm] = 2.001000
Address of grids->G2.dBZm.count 0x7f5f079a0190
assigned G2.dBZm.count
assigend G2.dBZm.mean
assigned G2.dBZm.stdev
Address of G2.d0.count 0x7f5d61d35190
Going to assign d0.count
assigned G2.d0.count
Going to assign d0.mean
assigned G2.d0.mean
Going to assign d0.stdev
assigned G2.d0.stdev
Successful write
Intel ICC:
Allocate the grid struct
sizeof of grids 9.393871GB
Address of grids->G2.rain.count 0x7fc9e070f190
Address of grids->G2.d0.count 0x7fca3d301190
Address of grids->G2.Nt.count 0x7fca722f9190
Address of grids->G2.dBZm.count 0x7fcbe2f6c190
location: 0
G2.dBZ.stdev[ii][jj][kk][ll][mm] = 2.001000
Address of grids->G2.dBZm.count 0x7fcbe2f6c190
assigned G2.dBZm.count
assigend G2.dBZm.mean
assigned G2.dBZm.stdev
Address of G2.d0.count 0x7fca3d301190
Going to assign d0.count
Segmentation fault
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you set maximum stack limit?
If you want to avoid generated code bloat, you may require -O1 or -Os.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you run a simple test to verify if sizeof returns 32-bit or 64-bit?
printf("%d\n", sizeof(sizeof(L3DPR_GRIDS ) ));
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the responses. I did add the exit if malloc failed but it always did succeed as the printf was never executed.
I also added the printf of the sizeof pointer and it is 8 bytes. Still same situation, GCC works, ICC fails. New code and output attached. As far as I can tell this is pretty basic and no clue why Intel compiler is doing this. I also added output from an older 11.1 version of ICC (Version 11.1 Build 20100806 Package ID: l_cproc_p_11.1.073) check out the addresses of some of the elements of the structure (they are the same address!!) This makes no sense to me.
Info on machine:
cputime unlimited
filesize unlimited
datasize unlimited
stacksize unlimited
coredumpsize unlimited
memoryuse unlimited
vmemoryuse unlimited
descriptors 1024
memorylocked unlimited
maxproc 266240
Linux 2.6.32-220.17.1.el6.621g0000.x86_64 #1 SMP Wed May 16 19:27:42 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
GCC output:
Allocate the grid struct
sizeof of grids 9.393871GB
sizeof pointer to grids 8
Address of grids->G2.rain.count 0x2b8154cad190
Address of grids->G2.d0.count 0x2b81b189f190
Address of grids->G2.Nt.count 0x2b81e6897190
Address of grids->G2.dBZm.count 0x2b835750a190
location: 0
G2.dBZ.stdev[ii][jj][kk][ll][mm] = 2.001000
Address of grids->G2.dBZm.count 0x2b835750a190
assigned G2.dBZm.count
assigend G2.dBZm.mean
assigned G2.dBZm.stdev
Address of G2.d0.count 0x2b81b189f190
Going to assign d0.count
assigned G2.d0.count
Going to assign d0.mean
assigned G2.d0.mean
Going to assign d0.stdev
assigned G2.d0.stdev
Successful write
ICC output: Version 12.1.5.339 Build 20120612
Allocate the grid struct
sizeof of grids 9.393871GB
sizeof pointer to grids 8
Address of grids->G2.rain.count 0x2b3a9a790190
Address of grids->G2.d0.count 0x2b3a6d022010
Address of grids->G2.Nt.count 0x2b3a6d022010
Address of grids->G2.dBZm.count 0x2b3a6d022010
location: 0
G2.dBZ.stdev[ii][jj][kk][ll][mm] = 2.001000
Address of grids->G2.dBZm.count 0x2b3a6d022010
assigned G2.dBZm.count
assigend G2.dBZm.mean
assigned G2.dBZm.stdev
Address of G2.d0.count 0x2b3a6d022010
Going to assign d0.count
Segmentation fault (core dumped)
Version 11.1 Build 20100806 Package ID: l_cproc_p_11.1.073
Allocate the grid struct
sizeof of grids 9.393871GB
sizeof pointer to grids 8
Address of grids->G2.rain.count 0x7fd3e3e2b190
Address of grids->G2.d0.count 0x7fd3b66bd010
Address of grids->G2.Nt.count 0x7fd3b66bd010
Address of grids->G2.dBZm.count 0x7fd3b66bd010
location: 0
G2.dBZ.stdev[ii][jj][kk][ll][mm] = 2.001000
Address of grids->G2.dBZm.count 0x7fd3b66bd010
assigned G2.dBZm.count
assigend G2.dBZm.mean
assigned G2.dBZm.stdev
Address of G2.d0.count 0x7fd3b66bd010
Going to assign d0.count
Segmentation fault
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>I also added the printf of the sizeof pointer and it is 8 bytes.
Its not size of pointer "sizeo(void*)". its the size of the return of sizeof "sizeof(sizeof(void*))"
sizeof has a return type of size_t. I've occasionally seen size_t defined/typedefed with "unsigned int" as opposed to "unsigned intptr_t" and on x64 platform where default "int" is 32-bit.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Program was run with stack limit set to unlimited with no effect. My machine has MemTotal: 132089148 kB and I get the same result (I work with jkwi). Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Added:
printf("sizeof sizeof L3DPR_GRIDS %d\n", (int)sizeof(sizeof(L3DPR_GRIDS)));
printf("sizeof pointer to grids %d\n",(int)sizeof(grids));
Seems upload of files is changing case of filenames to all lower letters.
ICC Version 12.1.5.339 Build 20120612
Allocate the grid struct
sizeof of grids 9.393871GB
sizeof sizeof L3DPR_GRIDS 8
sizeof pointer to grids 8
Address of grids->G2.rain.count 0x7fa223056190
Address of grids->G2.d0.count 0x7fa27fc48190
Address of grids->G2.Nt.count 0x7fa2b4c40190
Address of grids->G2.dBZm.count 0x7fa4258b3190
location: 0
G2.dBZ.stdev[ii][jj][kk][ll][mm] = 2.001000
Address of grids->G2.dBZm.count 0x7fa4258b3190
assigned G2.dBZm.count
assigend G2.dBZm.mean
assigned G2.dBZm.stdev
Address of G2.d0.count 0x7fa27fc48190
Going to assign d0.count
Segmentation fault
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the problem report and all your comments. I will investigate this issue and get back to you.
--mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for verifying this and all the additional info Sergey. Hopefully the project info will help Intel.
We will be waiting for a response from Intel.
Thanks again!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sergey,
i have the code samples compile with Intel C++ 13.1 and gcc-4.6.3, then i have debug with gdb, idb, and the Allinea DDT debuggers
also i analyse with inspector XE 2013, advisor XE 2013, the tools report memory leak at line 62, i think you are right its a codeing error not
a compiler error
best regards
Franz Bernasek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page