Thank you for explanation. I think I pinpointed a culprit code, which happen to be part of parsing config file.
The code in red was not there, so for a line that would start with # comment the code tries to access buf[-1]. How peculiar that the error lingered there and was never causing troubles before my stack shifted as a result of arrays size growth.
BTW, the segfault happen on the consequent fgetc after the line with starting # hash mark.
Hi.
Can someone to help me in a segfault problem?
I have a big C++ program that crash from time to time because it receive the SIGSEGV signal.
So my question is: Can I find, without using gdb or other debugging tools, which line from source code cause that problem? Or if exist some gdb API... (1 Reply)
Here is my initiating code:
#define NUM 20
static struct tab {
int count;
int use;
} tab;
int curtab = 0;
int tab_create(int tab_count)
{
curtab++;
tab.use = 1;
tab.count = tab_count;
kprintf("here!");
return curtab;
} (2 Replies)
Hello - I am finding difficulty in creating and allocating correct size to File Systems on solarix x86 box. Please see below contents I followed on screen and in the end It shows that /app file system is created of size 135GB , I wanted it to be 30gb as mentioned during 'format' command in 'Enter... (7 Replies)
Hi
I am getting a strange segmentation fault during the unwind
process. I am trying to throw an object of an Exception class.
During the DoThrow (in libC.a) the stack starts growing until a
Signal is received.
The object thrown is of a class that inherits from a common class,
and the signal... (0 Replies)
i wrote handler for sigsegv such that i can allocate memory for a variable to which
sigsegv generated for illlegal acces of memory.
my code is
#include <signal.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char *j;
void segv_handler(int dummy)
{
j=(char *)malloc(10);
... (4 Replies)
Hello,
One of our customer is getting segmentation fault when he runs his shell script which invokes our executable on AIX 6.1.
On AIX 5.3, there were no issues.
Here is the truss output.
811242: __loadx(0x0A040000, 0xF0D3A26C, 0x00000000, 0x00000009, 0x00000000) = 0xF026E884... (0 Replies)
I receive a sigsegv failure. I was under the impression that a core file is created everytime a sigsegv occurrs and the process is terminated. I have had two recent occurrances of a core file not being created. Does anyone know why a core file would not be created. (2 Replies)
While running script I am getting an error like
Few lines in data are not being processed.
After googling it I came to know that adding such line would give some memory to it
ini_set("memory_limit","64M");
my input file size is 1 GB.
Is that memory limit is based on RAM we have on... (1 Reply)
Hi
I want to create a SIGSEGV when program tries to access one particular area in memory. Is this possible. If so whats the command. (4 Replies)
Discussion started by: jionnet
4 Replies
LEARN ABOUT HPUX
t_alloc
t_alloc(3) Library Functions Manual t_alloc(3)NAME
t_alloc() - allocate transport function library structure
SYNOPSIS -- or --
DESCRIPTION
The function dynamically allocates memory for the various transport function argument structures as specified below. This function will
allocate memory for the specified structure and will also allocate memory for buffers referenced by the structure.
The structure to allocate is specified by struct_type and must be one of the following:
T_BIND struct t_bind
T_CALL struct t_call
T_DIS struct t_discon
T_INFO struct t_info
T_OPTMGMT struct t_optmgmt
T_UDERROR struct t_uderr
T_UNITDATA struct t_unitdata
where each of these structures may subsequently be used as an argument to one or more transport functions.
Each of the above structures, except T_INFO, contains at least one field of type For each field of this type, the user may specify that the
buffer for that field should be allocated as well. The length of the buffer allocated will be equal to or greater than the appropriate
size returned in the info argument of or The relevant fields of the info argument are described in the following list. The fields argument
specifies which buffer to allocate, where the argument is the bitwise-OR of any of the following:
The addr field of the or structures.
The opt field of the or structures.
The udata field of the or structures.
All relevant fields of the given structure.
Fields which are not supported by e transport provider specified by fd will not be allocated (info values are <= 0).
For each field specified in fields, will allocate memory for the buffer associated with the field, and initialize the len field to zero and
the buf pointer and maxlen field accordingly. Since the length of the buffer allocated will be based on the same size information that is
returned to the user on or fd must refer to the transport endpoint through which the newly allocated structure will be passed. In this way
the appropriate size information can be accessed. If the size value associated with any specified field is -1 or -2 ( see t_open(3) or
t_getinfo(3)), will be unable to determine the size of the buffer to allocate and will fail, setting to and to For any field not specified
in fields, buf will be set to a null pointer and maxlen will be set to zero.
Use of to allocate structures will help ensure the compatibility of user programs with future releases of the transport interface func-
tions.
Valid States
All, apart from
Fork Safety
is not fork-safe.
RETURN VALUE
Upon successful completion, returns a pointer to the newly allocated structure. On failure, a null pointer is returned.
ERRORS
On failure, is set to one of the following:
fd, the specified endpoint identifier, does not refer to a transport endpoint.
A system error has occurred during execution of this function.
(XTI only) This error indicates that a communication problem has been detected
between XTI and the transport provider for which there is no suitable XTI
Unsupported struct_type requested. This can include a request for a structure type which is inconsistent with the transport provider
type specified, that is, connection-oriented or connectionless.
SEE ALSO t_free(3), t_getinfo(3), t_open(3), thread_safety(5).
STANDARDS CONFORMANCE t_alloc(3)