sometimes for this code i get a segmentation fault for codes llike this
:
int main{
int * a= 0;
int b;
a = (int*)malloc(sizeof(int));
///some code using these variable but no freeing of a
if(a){
free(a);
a = 0;
}
return... (3 Replies)
I have written a program which takes a directory as command line arguments and displays all the dir and files in it.
I don't know why I have a problem with the /etc directory.It displays all the directories and files untill it reaches a sub directory called peers which is in /etc/ppp/peers.the... (4 Replies)
If I do this.
Assume
struct life
{
char *nolife;
}
struct life **life;
// malloc initialization & everything
if(life->nolife == 0)
Would I get error at life->nolife if it is equal to 0.
wrong accession? (3 Replies)
Hello,
I am running on a AIX5.2 server with Oracle 10g and 9i. My code compiles and works fine in 32-bit mode. The
same code compiles in 64-bit and runs good. The program catches CNTRL-C signal to terminate. Only on 64-bit code
when i hit CNTRL-C, the program exits with segmentation... (0 Replies)
Hi,
I am having this segmentation fault not in the following program, bt. in my lab program . My lab program is horrible long so cannot post it here bt. I am using the following logic in my program which is giving the segmentation fault. Bt. if I run this sample program as it is it dosen't give... (3 Replies)
I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this :
i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
I keep getting this fault on a lot of the codes I write, I'm not exactly sure why so I'd really appreciate it if someone could explain the idea to me.
For example this code
#include <stdio.h>
main()
{
unsigned long a=0;
unsigned long b=0;
int z;
{
printf("Enter two... (2 Replies)
Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1...
I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one.
Below are two very condensed snippets of which I have added the results inside the each code section.
IMPORTANT!... (11 Replies)
Apologies for any typos...
Well guys, been researching 'goto' in C and they say that you can't 'goto' labels in another function as a segmentation fault will occur.
However I have found a way to 'goto' a label in another function that is NOT main() using the asm() function.
As you know I... (14 Replies)
Discussion started by: wisecracker
14 Replies
LEARN ABOUT OSF1
__fstart
end(3) Library Functions Manual end(3)NAME
end, _end, _ebss, etext, _etext, edata, _edata, eprol, _ftext, _fdata, _fbss, _procedure_table, _procedure_table_size, _proce-
dure_string_table, __istart, __fstart, _DYNAMIC, _DYNAMIC_LINK, _BASE_ADDRESS, _GOT_OFFSET, _cobol_main - locations in program and defini-
tions in runtime procedure table
SYNOPSIS
extern unsigned long end; extern unsigned long _end; extern unsigned long _ebss;
/* First address above a program's */
/* uninitialized data region */
extern unsigned long etext; extern unsigned long _etext;
/* First address above the text region */
extern unsigned long edata; extern unsigned long _edata;
/* First address above the initialized */
/*data region */
extern unsigned long eprol;
/* First instruction of the user's program */
/* that follows the runtime startup routine */
extern unsigned long _ftext;
/* Start address of the text region */
extern unsigned long _fdata;
/* First address of the initialized data */
/* region */
extern unsigned long _fbss;
/* Start address of the uninitialized data */
/* region */
extern unsigned long _procedure_table; extern unsigned long _procedure_table_size; extern unsigned long _procedure_string_table;
/* See under DESCRIPTION */
extern unsigned long __istart;
/* Start address of the program's */
/* initialization function driver routine */
extern unsigned long __fstart;
/* Start address of the program's */
/* termination function driver routine */
extern unsigned long _DYNAMIC;
/* Address of a shared object's dynamic */
/* header table */
extern unsigned long _DYNAMIC_LINK;
/* Identifies the link type of a program */
/* or shared library. 0 for non_shared, */
/* 1 for call_shared and 2 for shared */
extern unsigned long _BASE_ADDRESS;
/* First mapped address of a program or */
/* shared library */
extern unsigned long _GOT_OFFSET;
/* Address of the global offset table in */
/* a shared program or shared library */
extern unsigned long _cobol_main
/* Address of the main routine in a cobol */
/* program */
DESCRIPTION
These names refer neither to routines nor to locations with interesting contents except for _procedure_table, _procedure_string_table, and,
for Tru64 UNIX, __istart and __fstart. Except for eprol, these are all names of linker-defined symbols.
Note that the end, etext, and edata symbols are not defined when you compile in ANSI mode.
When execution begins, the program break coincides with _end, but it is reset by the routines brk(2), malloc(3), standard input/output, the
profile (-p) option of cc(1), etc. The current value of the program break is reliably returned by "sbrk(0)"; (see brk(2)).
The linker-defined symbols _procedure_table, _procedure_table_size, and _procedure_string_table refer to the data structures of the runtime
procedure table. Because these are linker-defined symbols, the data structures are built by ld(1) only if they are referenced.
See the include file sym.h for the definition of the runtime procedure table, and see the include file exception.h for its uses.
These symbols are all absolute symbols; the value of each symbol is its address (for example, "&_procedure_table_size"). Any reference to
the symbol itself will attempt to access the symbol's value as if it were a valid address and will most likely result in an access viola-
tion.
All of these symbols except for end, _end, eprol, __istart, and _cobol_main are defined as local symbols in an executable or shared
library's dynamic symbol table. Consequently, an executable or shared library can only reference its own definitions of these local sym-
bols.
RELATED INFORMATION brk(2), malloc(3). delim off
end(3)