Hi,
We've interposed malloc/calloc/realloc/memalign/valloc in our
application. While all of our application calls our own implementation
of these functions, there seems to be some issue with the dl.so shared
library (Windriver, ppc, linux 32 bit). The dl.so library defines a
function called - _dl_tls_setup and another one - _dl_deallocate_ tls.
When our application that linked in -ldl and -lpthread, was shutting
down, we saw a crash with the backtrace pointing to
_dl_deallocate_ tls. Upon further investigation we found that
_dl_tls_dealloc ate was calling 'free' which was our own implementation
(Not libc's) However, the chunk was got using malloc/calloc from
libc!!!!!. I put a breakpoint at _dl_tls_setup and found that it was
getting memory from the libc calloc.
I'm not sure how the dl library could have got calloc from libc and
free from our application. Please help!!!
thanks,
-Anil 5 2205
On 22 Feb, 10:30, reacha...@gmail .com wrote:
Hi,
We've interposed malloc/calloc/realloc/memalign/valloc in our
application. While all of our application calls our own implementation
of these functions, there seems to be some issue with the dl.so shared
library (Windriver, ppc, linux 32 bit). The dl.so library defines a
function called - _dl_tls_setup and another one - _dl_deallocate_ tls.
When our application that linked in -ldl and -lpthread, was shutting
down, we saw a crash with the backtrace pointing to
_dl_deallocate_ tls. Upon further investigation we found that
_dl_tls_dealloc ate was calling 'free' which was our own implementation
(Not libc's) However, the chunk was got using malloc/calloc from
libc!!!!!. I put a breakpoint at _dl_tls_setup and found that it was
getting memory from the libc calloc.
I'm not sure how the dl library could have got calloc from libc and
free from our application. Please help!!!
thanks,
-Anil
sorry for previous message. hit the wrong key
On 22 Feb, 10:30, reacha...@gmail .com wrote:
We've interposed malloc/calloc/realloc/
not sure what "interposed " means...
memalign/valloc
I'm not familiar with these. Are they new to C99?
in our
application. While all of our application calls our own implementation
of these functions,
I'm pretty sure that puts you firmly in implementation defined
territory.
I don't think you can (portable) redefine standard library functions.
there seems to be some issue with the dl.so shared
library (Windriver, ppc, linux 32 bit).
thats *really* implementaion defined! You need to try
a windows programming news group
<snip>
--
Nick Keighley
Nick Keighley said:
sorry for previous message. hit the wrong key
On 22 Feb, 10:30, reacha...@gmail .com wrote:
>We've interposed malloc/calloc/realloc/
not sure what "interposed " means...
"Interpositioni ng" means "replacing a library routine (typically but not
necessarily a standard library function) with your own function".
<snip>
--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
In article <81************ *************** *******@b29g200 0hsa.googlegrou ps.com>,
<re*******@gmai l.comwrote:
>I'm not sure how the dl library could have got calloc from libc and free from our application. Please help!!!
You really need to ask about this on a group related to Linux;
this stuff is very OS-dependent.
-- Richard
--
:wq
Nick Keighley wrote, On 22/02/08 10:47:
On 22 Feb, 10:30, reacha...@gmail .com wrote:
<snip>
>there seems to be some issue with the dl.so shared library (Windriver, ppc, linux 32 bit).
thats *really* implementaion defined!
As far as the standard is concerned it is undefined, so the
implementation may well not define it. In this case though I believe
that Linux does provide mechanisms to do this.
You need to try
a windows programming news group
I think you meant Linux programming group.
--
Flash Gordon This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Koster |
last post by:
Sorry for the re-post, but my previous question was left unanswered.
I have a question about the appropriateness of calloc. Consider an array of
pointers to structs which need to be allocated space on the heap, for example:
typedef struct myStruct *PMYSTRUCT;
struct myStruct
{
int i;
int j;
|
by: David Hill |
last post by:
Is there a difference between:
/* code 1 */
struct sample test;
test = malloc(sizeof(struct sample));
memset(&test, 0, sizeof(test));
/* code 2 */
struct sample test;
test = calloc(1, sizeof(struct sample));
|
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 who don't speak french arbre means tree.
|
by: MK |
last post by:
I am a newbie. Please help. The following warning is issued by gcc-3.2.2
compiler (pc Linux):
==================================================================
read_raw_data.c:51: warning: assignment makes pointer from integer
without a cast
==================================================================
when the following piece of...
|
by: Harsimran |
last post by:
Can any one explain what are far pointers and what is the difference
between malloc and calloc .Which is better ?
| |
by: pervinder |
last post by:
Hi,
I have a c applicaiton which uses calloc to allocate the storage from
heap.
A page is allocated (4096bytes) and then its used in smal small chunks
on need.
It works fine till some n number of pages are alloacted and used. But
it fails
to allocate a fresh page of 4096 after some m times when the prev.
block gets exhausted and new...
|
by: boris |
last post by:
Hi!
I'm seeking some answers about what seems to be a memory leak.
I have a loop that looks much like this:
double *largeArray = (double*) calloc();
for (...) {
printf("iteration #...\n");
for (...) {
double *foo = (double*) calloc();
|
by: Roka100 |
last post by:
Hi all,
I tried 2 programs :
#include <stdio.h>
#include <string.h>
1,
int main(void){
char *str = NULL;
|
by: deepu |
last post by:
Please reply...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |