473,378 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Segmentation fault

Hello there,
I've a question regarding segmentation fault.
When I run my C++ code on SUN Workshop 6 under UNIX Solaris 8, it compiles
correctly, but after execution it gives a segmentation fault!
The program includes declaration of a huge multidimensional array which has
a variable size for each iteration. The matrix takes its size after
execution and this size can be as high as (50,000 x 50,000).
Is the segmentation error related to the size of this matrix? If so is there
any limitations on the memory allocation in SUN Workshop 6 or Unix Solaris
8 (with 1GB RAM memory)?
Thanks.
Jul 19 '05 #1
3 14193
eenna wrote:
Hello there,
I've a question regarding segmentation fault.
When I run my C++ code on SUN Workshop 6 under UNIX Solaris 8, it compiles
correctly, but after execution it gives a segmentation fault!
The program includes declaration of a huge multidimensional array which has
a variable size for each iteration. The matrix takes its size after
execution and this size can be as high as (50,000 x 50,000).
Is the segmentation error related to the size of this matrix? If so is there
any limitations on the memory allocation in SUN Workshop 6 or Unix Solaris
8 (with 1GB RAM memory)?
Thanks.


Small code example please? Also note that this group is for standard C++
questions only. If your problem depends on the environment, it is not
topical here. But you can post the small, compilable code example, and
let's see if there is anything wrong with it.

Jul 19 '05 #2
eenna schrieb:

Hello there,
I've a question regarding segmentation fault.
When I run my C++ code on SUN Workshop 6 under UNIX Solaris 8, it compiles
correctly, but after execution it gives a segmentation fault!
The program includes declaration of a huge multidimensional array which has
a variable size for each iteration. The matrix takes its size after
execution and this size can be as high as (50,000 x 50,000).
It depends on the element size. 50,000 x 50,000 is 250 M, which is roughly 250
MBytes with chars or 1 GByte with 4-byte floats or ints. 1 such array my fit in
your virtual memory. If you have 8-byte floats (double) then you need approx. 2
Gbytes and that may exceed the architectural limits of a 32-Bit machine (don't
know whether your Sun is 64 bit)
hth
Klaus
Is the segmentation error related to the size of this matrix? If so is there
any limitations on the memory allocation in SUN Workshop 6 or Unix Solaris
8 (with 1GB RAM memory)?
Thanks.

Jul 19 '05 #3

"klaus hoffmann" <dr***********@t-online.de> wrote in message
news:3F***************@t-online.de...
eenna schrieb:

Hello there,
I've a question regarding segmentation fault.
When I run my C++ code on SUN Workshop 6 under UNIX Solaris 8, it compiles correctly, but after execution it gives a segmentation fault!
The program includes declaration of a huge multidimensional array which has a variable size for each iteration. The matrix takes its size after
execution and this size can be as high as (50,000 x 50,000).
It depends on the element size. 50,000 x 50,000 is 250 M, which is

roughly 250 MBytes with chars or 1 GByte with 4-byte floats or ints. 1 such array my fit in your virtual memory. If you have 8-byte floats (double) then you need approx. 2 Gbytes and that may exceed the architectural limits of a 32-Bit machine (don't know whether your Sun is 64 bit)
hth
Klaus


Ahem....calculator, please. Let's see...50,000 * 50,000....looks like
2,500,000,000 to me. That's 2.5 billion (or just under 2.4Gb), not 250
million. And that's just the item count. It's just too big.

-Howard

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sivignon | last post by:
Hi, I'm writing a php script which deals with 3 ORACLE databases. This script is launch by a script shell on an linux machine like this : /../php/bin/php ./MySript.php (PHP 4.3.3) My script...
3
by: diyanat | last post by:
i am writing a cgi script in C using the CGIC library, the script fails to run, i am using apache on linux error report from apache : internal server error Premature end of script headers:...
16
by: laberth | last post by:
I've got a segmentation fault on a calloc and I don'tunderstand why? Here is what I use : typedef struct noeud { int val; struct noeud *fgauche; struct noeud *fdroit; } *arbre; //for those...
3
by: Zheng Da | last post by:
Program received signal SIGSEGV, Segmentation fault. 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 (gdb) bt #0 0x40093343 in _int_malloc () from /lib/tls/libc.so.6 #1 0x40094c54 in malloc...
5
by: Fra-it | last post by:
Hi everybody, I'm trying to make the following code running properly, but I can't get rid of the "SEGMENTATION FAULT" error message when executing. Reading some messages posted earlier, I...
18
by: Digital Puer | last post by:
Hi, I'm coming over from Java to C++, so please bear with me. In C++, is there a way for me to use exceptions to catch segmentation faults (e.g. when I access a location off the end of an array)?...
27
by: Paminu | last post by:
I have a wierd problem. In my main function I print "test" as the first thing. But if I run the call to node_alloc AFTER the printf call I get a segmentation fault and test is not printed! ...
7
by: pycraze | last post by:
I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our...
3
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
6
by: DanielJohnson | last post by:
int main() { printf("\n Hello World"); main; return 0; } This program terminate just after one loop while the second program goes on infinitely untill segmentation fault (core dumped) on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.