Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - A crash in libc: (5 Items)
   
A crash in libc  
I am running one of my applications on QNX compiled using QNX momentics 6.4.0. Every time I run my application it is 
crashing at one or the other place. But the back trace of the crash ends every single time in QNX's libc.

Here is the backtrace of the same.

====================
Program terminated with signal 11, Segmentation fault.
#0  0xfe32832c in _band_get_aligned () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3

warning: Host file /opt/qnx640/target/qnx6/ppcbe/lib/libsocket.so.2 does not match target file.

warning: Host file /opt/qnx640/target/qnx6/ppcbe/lib/libsocket.so.2 does not match target file.
(gdb) bt
#0  0xfe32832c in _band_get_aligned () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
#1  0xfe3283bc in _band_get () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
#2  0xfe32b890 in __malloc_lock () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
#3  0xfe32bc94 in __malloc () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
#4  0xfe327c20 in malloc () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
====================

Another query on mine is :
Is there any limit on how much memory that can be allocated to a processes in QNX? Because my application exceeds 6MB.

Any help on these is much appreciated.

Thank you in advance.

Regards,
Amit
Re: A crash in libc  
If your application is always crashing inside heap related functions,
your application may be corrupting the heap.  The usual debugging
techniques apply.  You may be able to benefit from the various heap
debugging tools provided by Momentics and/or Neutrino.  A possibly
useful starting point - but by no means the only one - is:

http://www.qnx.com/developers/docs/6.4.0/neutrino/prog/hat.html

Regards,
Neil

On Tue, 2009-03-24 at 14:48 -0400, Amit Gourgonda wrote:
> I am running one of my applications on QNX compiled using QNX momentics 6.4.0. Every time I run my application it is 
crashing at one or the other place. But the back trace of the crash ends every single time in QNX's libc.
> 
> Here is the backtrace of the same.
> 
> ====================
> Program terminated with signal 11, Segmentation fault.
> #0  0xfe32832c in _band_get_aligned () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
> 
> warning: Host file /opt/qnx640/target/qnx6/ppcbe/lib/libsocket.so.2 does not match target file.
> 
> warning: Host file /opt/qnx640/target/qnx6/ppcbe/lib/libsocket.so.2 does not match target file.
> (gdb) bt
> #0  0xfe32832c in _band_get_aligned () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
> #1  0xfe3283bc in _band_get () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
> #2  0xfe32b890 in __malloc_lock () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
> #3  0xfe32bc94 in __malloc () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
> #4  0xfe327c20 in malloc () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
> ====================
> 
> Another query on mine is :
> Is there any limit on how much memory that can be allocated to a processes in QNX? Because my application exceeds 6MB.

> 
> Any help on these is much appreciated.
> 
> Thank you in advance.
> 
> Regards,
> Amit
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post25123
> 
Re: A crash in libc  
There is no limit to the amount of memory allocated other than the usual total memory available and rlimit limits 
imposed like vmem and data if any
 Do u know how much memory is available. Out of memory would result in a NULL from malloc with ENOMEM set


Shiv



Shiv Nagarajan
Kernel developer, QNX Software Systems
Canada

----- Original Message -----
From: Amit Gourgonda <community-noreply@qnx.com>
To: ostech-core_os <post25123@community.qnx.com>
Sent: Tue Mar 24 14:48:04 2009
Subject: A crash in libc

I am running one of my applications on QNX compiled using QNX momentics 6.4.0. Every time I run my application it is 
crashing at one or the other place. But the back trace of the crash ends every single time in QNX's libc.

Here is the backtrace of the same.

====================
Program terminated with signal 11, Segmentation fault.
#0  0xfe32832c in _band_get_aligned () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3

warning: Host file /opt/qnx640/target/qnx6/ppcbe/lib/libsocket.so.2 does not match target file.

warning: Host file /opt/qnx640/target/qnx6/ppcbe/lib/libsocket.so.2 does not match target file.
(gdb) bt
#0  0xfe32832c in _band_get_aligned () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
#1  0xfe3283bc in _band_get () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
#2  0xfe32b890 in __malloc_lock () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
#3  0xfe32bc94 in __malloc () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
#4  0xfe327c20 in malloc () from /opt/qnx640/target/qnx6/ppcbe/lib/libc.so.3
====================

Another query on mine is :
Is there any limit on how much memory that can be allocated to a processes in QNX? Because my application exceeds 6MB.

Any help on these is much appreciated.

Thank you in advance.

Regards,
Amit

_______________________________________________
OSTech
http://community.qnx.com/sf/go/post25123

Re: A crash in libc  
Thank you Neil and Shiv.

This application has been working fine on Linux for quite sometime. So do you people think that it can still cause some 
memory corruption on QNX?

The output of 'pidin info' says free memory is 323Mb/512Mb.

Regards,
Amit
Re: A crash in libc  
its very hard to say whether there can be memory corruption. What sort
of code are you porting over. Is is multi-threaded, does it use fork?,
does it use brk/sbrk? The crash is occuring on an allocation, and this
is most likely due to the heap already being corrupted. (maybe by a
previous free). Is it possible that there is a double free happening?
or that you are accessing already freed memory in some part of your
application? 

shiv
Tue Mar 24 15:43:40 EDT 2009

 --> According to Amit Gourgonda <--
	Thank you Neil and Shiv.
	
	This application has been working fine on Linux for quite sometime. So
	do you people think that it can still cause some memory corruption on
	QNX?
	
	The output of 'pidin info' says free memory is 323Mb/512Mb.
	
	Regards,
	Amit
	
	_______________________________________________
	OSTech
	http://community.qnx.com/sf/go/post25132
	

-- 
****
Shiv Nagarajan,
Kernel Developer, QNX Software Systems,
Ottawa, Canada
****