Search Results

Search: Posts Made By: cdbug
Forum: Programming 11-06-2009
34,586
Posted By cdbug
The file is large. I remove some parts which are...
The file is large. I remove some parts which are not related but the array troube changes although still exists.

I will first try to deal with it with the methods recommended by the below window
...
Forum: Programming 11-06-2009
34,586
Posted By cdbug
Here, dataset is an array of pointers to...
Here, dataset is an array of pointers to sequence. It is desctructed by the call to make_vertex.

Can we use some technique to protect this array(data)?
Forum: Programming 11-02-2009
34,586
Posted By cdbug
I change make_vertex as you showed. It appears to...
I change make_vertex as you showed. It appears to work well. But dataset is destructed. This also gives troubles since it is what the code works on

dataset[4] has a different address after a call...
Forum: Programming 10-31-2009
34,586
Posted By cdbug
Add return statement and change return type and...
Add return statement and change return type and it can work.

But it still fails after generating many vertices. Notice where failure occurs

This seems to be a general problem.

Thanks for all...
Forum: Programming 10-30-2009
34,586
Posted By cdbug
I tried this: vertex *root; ...
I tried this:

vertex *root;
make_vertex(&root, -1, 0, -1);

(gdb) p root
$1 = (vertex *) 0x0
(gdb) p *root
Cannot access memory at address 0x0

What's wrong?
Forum: Programming 10-30-2009
34,586
Posted By cdbug
where and how should this be done? Would you...
where and how should this be done? Would you please give an example?

Thanks
Forum: Programming 10-30-2009
34,586
Posted By cdbug
Linux 3.2.3-59 struct vertex { ...
Linux 3.2.3-59



struct vertex {
int id;
int seq;
int pos;
int clique;
int numOfVer;
int numOfPrev;
int numOfNext;
int...
Forum: Programming 10-30-2009
34,586
Posted By cdbug
does not make effect. should generate many...
does not make effect. should generate many vertices for a graph. but it will fail after 20 vertices.

can generate 20 vertices. after then, it fails. can't figure out.
Forum: Programming 10-30-2009
34,586
Posted By cdbug
Why does this occur? *** glibc detected *** malloc(): memory corruption: 0x10013ff8 ***
there seems not to be error in this segment. In some computers, it can work well. But in others, it will give a failure.

why it ocurrs and how to deal with it?


in a function:

if(...
Forum: Programming 10-29-2009
14,838
Posted By cdbug
Sigh!! What an error!! But the two characters are...
Sigh!! What an error!! But the two characters are the same in this shell.

Thanks
Forum: Programming 10-28-2009
14,838
Posted By cdbug
gcc version 3.2.3 20030502 (Red Hat Linux...
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-59)

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include <stdarg.h>

thanks
Forum: Programming 10-28-2009
14,838
Posted By cdbug
Thanks compile-time error. for example:...
Thanks

compile-time error.

for example:

int d (char *str1, char *str2, int n1, int n2, int len) {


if (strlen(str1) < n1+1en-1 || strlen(str2) < n2+len-1) { // Error ? ...
Forum: Programming 10-24-2009
14,838
Posted By cdbug
How to deal with this error: floating constant exponent has no digits
A conditional statement cause it:

if(strlen(str) < n1+1) {

-------

}
Forum: Programming 02-28-2009
10,296
Posted By cdbug
LD_LIBRARY_PATH can work. But it is useful to...
LD_LIBRARY_PATH can work. But it is useful to remind that the library may be corrupted or incompatible
Thanks
Forum: Programming 02-28-2009
10,296
Posted By cdbug
Is there any solution else? I am advised to avoid...
Is there any solution else? I am advised to avoid LD_LIBRARY_PATH. Can other methods be available?

Thanks
Forum: Programming 02-26-2009
10,296
Posted By cdbug
It is found in /usr/lib/, compiled but can not...
It is found in /usr/lib/, compiled but can not run

% gcc -g -o stand stand.c -I/usr/lib/ -lRmath -lm
% ./stand
./stand: error while loading shared libraries: libRmath.so: cannot open shared...
Forum: Programming 02-25-2009
10,296
Posted By cdbug
libRmath.so: cannot open shared object file: No such file or directory
% locate Rmath
/m/backup/backup/lib/R/include/Rmath.h
/usr/lib/R/include/Rmath.h
% gcc -g -o stand stand.c -I/usr/lib/R/include/ -lRmath -lm
% ./stand
./stand: error while loading shared...
Forum: Programming 02-17-2009
34,851
Posted By cdbug
Program exited with code 01: does it indicate unsuccessful compilation?
(gdb) r --------------------- enter

Breakpoint 1, 0x0000000000409d40 in main ()
(gdb) n
Single stepping until exit from function main,
which has no line number information.
Find_Cmd_Option:...
Forum: Programming 01-18-2009
29,366
Posted By cdbug
Thanks. I can understand. Let me first try to fix...
Thanks. I can understand. Let me first try to fix it.
Forum: Programming 01-16-2009
29,366
Posted By cdbug
They are pointers. This is sure. But there is...
They are pointers. This is sure. But there is some mistakes in the code I gave before. The assignment should use * before the pointers. I am sorry for carelessness when posted. But when checking with...
Forum: Programming 01-14-2009
29,366
Posted By cdbug
Right!! these are pointers. What does 'out of...
Right!! these are pointers. What does 'out of bounds' mean? More important, how to avoid it? Clearly null checking can not make effect in this respect.

Program received signal SIGSEGV,...
Forum: Programming 01-14-2009
29,366
Posted By cdbug
Let me show it here: ...
Let me show it here:

node->is_done = (int *) malloc(sizeof(int));
node->hood = (double *) malloc(sizeof(double));
node->c...
Forum: Programming 01-13-2009
29,366
Posted By cdbug
how to avoid the segfault from Address 0x1cd00000103 out of bounds
After allocating memory for some variables, segfault is often to happen, due to the same reason: Address 0x1cd00000103 out of bounds

It is welcome to recommend some treatments. Thanks

e.g.
...
Forum: Programming 01-04-2009
2,596
Posted By cdbug
You are right. I check the code and finally find...
You are right. I check the code and finally find that the error is from an assignment. but it is still strange.

list[size-2]->left = list[size-1];

the result is: list[size-2] = list[size-1];
...
Forum: Programming 01-02-2009
2,596
Posted By cdbug
malloc gives the same memory to two different nodes. How to deal with it?
When allocating memory for two different nodes, the resulting memory are the same. Clearly, this will lead to a mistake. This happened in a function. And the process must be in a function.

(gdb) p...
Showing results 1 to 25 of 52

 
All times are GMT -4. The time now is 08:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy