ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
can any one help me to solve this _int_malloc() hangs issue. please see the gdb back-trace it shows _int_malloc() is hanging, i waited so much of time still _int_malloc taking time, can anybody help me to solve this issue?
(gdb) bt
#0 0x001babcc in _int_malloc () from /lib/tls/libc.so.6
#1 0x001b9ecd in malloc () from /lib/tls/libc.so.6
#2 0x001aa4f3 in popen@@GLIBC_2.1 () from /lib/tls/libc.so.6
#3 0x080599d2 in Function1() at c1.cxx:281
#4 0x08061c1d in main (argc=13, argv=0xfeffd874) at main.cxx:172
(gdb) quit
Are you absolutely positive that you don't have an infinite loop in there somewhere?
If malloc cannot call brk() successfully (if it needs to) it immediately returns NULL. If you check the return code of malloc you will find out if malloc is the problem.
It is slightly possible, if you are using an alternate malloc package, that it has a bug in it.
Are you absolutely positive that you don't have an infinite loop in there somewhere?
If malloc cannot call brk() successfully (if it needs to) it immediately returns NULL. If you check the return code of malloc you will find out if malloc is the problem.
It is slightly possible, if you are using an alternate malloc package, that it has a bug in it.
What distibution are you on?
Hi Jim,
please see the back-trace, after the popen call, it internally calls malloc function and malloc calls _int_malloc() when i was debugging the code, it works fine before i reach popen(), exactly on popen() i did next in gdb, that is it and it was waiting so much of time then i pressed Ctrl-C, then i did back-trace.
please help me to understand and solve this issue.
If popen works in the sample code but not in your project, it's conceivable that in the latter something else corrupts the heap before you get to popen. I've had good experience using valgrind for finding many kinds of not-so-clean memory use. So you could try running your project under valgrind.
I don’t see the point of providing us with working code (or am I misreading?)…
How is this supposed to help us solve the bug? Give us as short a code sample as possible that does experience the problem.
Hello All,
thank you for every body who responded to my mail. we fixed and the issue is with malloc(), we allocated less no of bytes for the variable so popen() functions waits.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.