Hi there,
consider the following code:
#include "stdafx.h"
int main(int argc, char* argv[]) {
const int Xres = 600;
const int Yres = 600;
std::pair<float,floatdispFNabla[Yres][Xres];
std::pair<float,floatdispFNabla2[Yres][Xres];
std::pair<float,floatdispFNabla3[Yres][Xres];
std::pair<float,floatdispFNabla4[Yres][Xres];
std::pair<float,floatdispFNabla5[Yres][Xres];
std::pair<float,floatdispFNabla6[Yres][Xres];
std::pair<float,floatdispFNabla7[Yres][Xres];
std::pair<float,floatdepthFNablaZ[Yres][Xres];
float depthHessZ[Yres][Xres][4];
return 0;
}
Why in the world could it generate a segmentation fault? :
(gdb) run
Starting program: /local/home/neo/BT/P/MicroDepth
Failed to read a valid object file image from memory.
Program received signal SIGSEGV, Segmentation fault.
0x08048e0c in main () at src/MicroDepth.cxx:6
6 std::pair<float,floatdispFNabla[Yres][Xres];
(gdb) print dispFNabla
$1 = {{{first = 0, second = 0} <repeats 600 times>} <repeats 599
times>, {{
first = 0, second = 0} <repeats 277 times>, {first =
-2.67723372e-05,
second = -1.70868349}, {first = -2.89307955e-05,
second = -2.45322353e-05}, {first = -2.6772359e-05,
<snip>
second = 1.40129846e-45}...}}
(gdb) print dispFNabla2
$2 = {{{first = 0, second = 0} <repeats 600 times>} <repeats 600
times>}
(gdb) print dispFNabla3
Cannot access memory at address 0xbf66030c
(gdb) print dispFNabla4
Cannot access memory at address 0xbf3a110c
Regards,
Marc
--
DO NOT REPLY TO THIS EMAIL ADDRESS, IT WILL NOT WORK
ACTUALLY YOU WILL AUTOMATICALLY BE BLACKLISTED 4 1217
Marc R. wrote:
Hi there,
consider the following code:
#include "stdafx.h"
What's this?
int main(int argc, char* argv[]) {
const int Xres = 600;
const int Yres = 600;
std::pair<float,floatdispFNabla[Yres][Xres];
std::pair<float,floatdispFNabla2[Yres][Xres];
std::pair<float,floatdispFNabla3[Yres][Xres];
std::pair<float,floatdispFNabla4[Yres][Xres];
std::pair<float,floatdispFNabla5[Yres][Xres];
std::pair<float,floatdispFNabla6[Yres][Xres];
std::pair<float,floatdispFNabla7[Yres][Xres];
std::pair<float,floatdepthFNablaZ[Yres][Xres];
float depthHessZ[Yres][Xres][4];
return 0;
}
Why in the world could it generate a segmentation fault? :
Overflowed your stack?
--
Ian Collins.
Marc R. wrote:
Hi there,
consider the following code:
float depthHessZ[Yres][Xres][4];
Cannot access memory at address 0xbf3a110c
Almost 1.5 meg of automatic data? I'm not surprised. Use a vector or
dynamic array.
Brian
"Default User" <de***********@yahoo.comwrote in message
news:5b*************@mid.individual.net...
Marc R. wrote:
>Hi there,
consider the following code:
> float depthHessZ[Yres][Xres][4];
>Cannot access memory at address 0xbf3a110c
Almost 1.5 meg of automatic data? I'm not surprised. Use a vector or
dynamic array.
1.5? For that one definition, yes. But you forgot a few:
std::pair<float,floatdispFNabla[Yres][Xres];
std::pair<float,floatdispFNabla2[Yres][Xres];
std::pair<float,floatdispFNabla3[Yres][Xres];
std::pair<float,floatdispFNabla4[Yres][Xres];
std::pair<float,floatdispFNabla5[Yres][Xres];
std::pair<float,floatdispFNabla6[Yres][Xres];
std::pair<float,floatdispFNabla7[Yres][Xres];
That's about 23.3 megs in total, assuming 4 bytes per float and 8 bytes per
std::pair<float, float>, which seems a pretty reasonable assumption :)
- Sylvester
"Ian Collins" <ia******@hotmail.comwrote in message
news:5b*************@mid.individual.net...
Marc R. wrote:
>Hi there,
consider the following code:
#include "stdafx.h"
What's this?
That's a header file automatically generated for you when creating a new
Visual C++ project. It sets some platform-related macro values, and
#includes windows.h.
I suspect most novices don't pay any attention to it at all. I usually
remove it (and set the project to not use precompiled headers).
-Howard This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: marko |
last post by:
I'm having big problems with php and mysql. php segfaults on certain
mysql calls, with the following logs in apache error log:
child pid 60386 exit signal
Segmentation fault (11)
and in the...
|
by: Naveen Parihar |
last post by:
I've a binary that runs on most of our servers but segfaults on one of
the servers. Further, even on this specific machine, the binary runs
successfully sometimes but segfaults most of the time....
|
by: Matthias Kaeppler |
last post by:
Hi,
I thought it'd be a better idea to start a new thread dealing directly
with my problem. Okay, here's again what's happening:
I'm storing boost::shared_ptrS in an std::set. I supposed that on...
|
by: Stefan Mueller |
last post by:
Why do I get the following error message in Mozilla if I press a key in the
input box?
================================
Error: " nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" ...
|
by: David Douthitt |
last post by:
I have a binary statically linked application that was compiled against
Red Hat 7.3 (presumably glibc 2.2.5). The application SegFaults when
run in a Red Hat Advanced Server environment - with...
|
by: Grant Richard |
last post by:
Using the TcpListener and TcpClient I created a program that just sends and
receives a short string - over and over again. The program is fine until it
gets to around 1500 to 1800 messages. At...
|
by: Frank Millman |
last post by:
Hi all
I am using Python 2.4.1. I have machines running FC4, RH9, and MSW
Server 2003 for testing.
If I call sax.make_parser() from the interpreter or from a stand-alone
program, it works...
|
by: Josh Zenker |
last post by:
I've been working on an implementation of Dijkstra's algorithm on and
off for the past few days. I thought I was close to being finished,
but clearly I've done something wrong. I'm not a very...
|
by: Stefan Braumeister |
last post by:
Hi NG,
I got some difficult problem that drives me nuts.
I wrote a relatively simple extension that reads binary files and
extracts some data. If I call the script, that uses my extension via...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |