dlclose crashing in 64bit


 
Thread Tools Search this Thread
Top Forums Programming dlclose crashing in 64bit
# 1  
Old 12-04-2006
dlclose crashing in 64bit

Hi

I have a 64bit C++ dynamic component built using Sun Forte compiler(CC) on one server.

I am opening this shared component using dlopen and checking if a particular function is defined or not. After that, when I am closing the component using dlclose, the program is crashing.


The crash occurs only on some systems, more specifically when I run the program on another system where the shared object was not built

When I do the dlclose on the system on which the shared object was built, the application does not crash ??

I get the following error message :

Fault signal: SIGBUS (10), invalid address alignment.
At instruction address 0xffffffff7e64f4a8, faulting access address is 0x4e5352532eb264cc
Symbolic location: "realloc + 0x474 [/usr/lib/sparcv9/libc.so.1]"

------ Concluding frames leaf call (n=1) ------
# 0 0x7e64f4a8 realloc + 0x474 [/usr/lib/sparcv9/libc.so.1]
[0x1,0x1f3620,0x1,0x1f3620,0x1,....]
# 1 0x7e64f444 realloc + 0x410 [/usr/lib/sparcv9/libc.so.1]


Thanks in advance
# 2  
Old 12-04-2006
AS a guess, I would say the void *handle in dlclose(handle) is corrupted - not pointing to a valid address.

Try setting a break, or placing a print statement just before the dlclose -
Code:
printf ("void *handle= %p\n",handle);

If you have a similar one for the other time(s) your code encounters it, you can see if it has been changed.
# 3  
Old 12-05-2006
Hi,

I had printed the value of the handle. The result is given below :

Calling dlclose , handle is : 0x7d4014c8

Fault signal: SIGBUS (10), invalid address alignment.
At instruction address 0xffffffff7e64f4a8, faulting access address is 0x4e5352532eb267cc
Symbolic location: "realloc + 0x474 [/usr/lib/sparcv9/libc.so.1]"

------ Concluding frames leaf call (n=1) ------
# 0 0x7e64f4a8 realloc + 0x474 [/usr/lib/sparcv9/libc.so.1]
[0x1,0x1f3920,0x1,0x1f3920,0x1,....]
# 1 0x7e64f444 realloc + 0x410 [/usr/lib/sparcv9/libc.so.1]

How do I find if the handle is corrupted or not ? Also, the program runs fine on some systems , on only on a few systems it crashes ??
# 4  
Old 12-05-2006
If it is on different hardware platforms then it's possible. SIGBUS usually means alignment problems - instead of a pointer being aligned on a page boundary or a longword boundary, it's off by a few bytes. Or, more likely, it references an address that is off.

The reason I suggested corruption (or something is changing the value) is because
the code obviously worked earlier in the code - dlclose is called after you're done.
The pointer "worked" earlier.

I'm guessing you are probably overwriting the stack somewhere earlier in the code.

Now, if you suspect the compilation issue, then compile locally, and do a test run. If problems go away, then you have runtime library differences from box to box that are trashing the pointer.

See the post by driver about tracking down mysterious corruption:
https://www.unix.com/programming/20704-memory-stack-problem.html
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Solaris V440 keeps crashing

Hi, I have Sun Solaris V440, every two days or so, the system crashes and it's at OK prompt. After that I do the FSCK and clear all the bad sectors. Then system stays up for close to 48 hours. Then it crashes again. I checked the logs and I don't see anything under /var/adm/messages file. ... (1 Reply)
Discussion started by: samnyc
1 Replies

2. UNIX for Dummies Questions & Answers

Random Crashing

Over the last month or so my CentOS server has been crashing for reasons I do not know. It has been running for over a year with regular yum updates without problems. The load on the server is perfectly normal with CPU usage at 5-6% and RAM usage at less than half of 32GB of RAM (multiple smaller... (3 Replies)
Discussion started by: spinner0205
3 Replies

3. UNIX and Linux Applications

Firefox crashing

Firefox keeps on crashing every time I try to run it. I tried to create a new profile with no luck. When I try to open up the profile manager firefox crashes. I even deleted my profile folder and tried to start with a new profile. That did not work either. I don't know what the problem could be. I... (6 Replies)
Discussion started by: cokedude
6 Replies

4. Web Development

MySQL Server Crashing need Help

Hi, we have some problem with mysql high cpu , would like some help with MySQL Tuning here are the mysqltuner & tuning-primer details mysqltuner: # mysqltuner >> MySQLTuner 1.1.1 - Major Hayden <major@mhtx.net> >> Run with '--help' for additional options and output filtering --------... (1 Reply)
Discussion started by: cataplexy
1 Replies

5. Programming

Why this C program is crashing?

Hi, Why I am getting 'SIGSEGV' in the following code? char* p="abcde"; printf("%s", 3); // Segmentation Fault (core dump) Kindly help me to understand what exactly makes the program to crash or the reason for the crashing. (7 Replies)
Discussion started by: royalibrahim
7 Replies

6. Red Hat

Fedora 11 crashing help

Using Fedora 11, just about every day the system started crashing. Becomes unresponsive to keyboard/mouse, nothing appears on screen but box is still running. Still responds to ping, arp address stays alive in the firewall, other than that its unresponsive Where can I look to find out... (1 Reply)
Discussion started by: ippy98
1 Replies

7. Solaris

Solaris 10 crashing

Hi, My system is crashing with following error .. i tried to boot from the network and unencapsulated the root disk from SVM .. but still not able to boot the box , can any one point me to some direction .. i do not want to build the box new as of now just want to troubleshoot if possible.. ... (3 Replies)
Discussion started by: fugitive
3 Replies

8. Programming

c++ class keeps crashing

i just started learning to prog in c++, im using netbeans. i tryed to make a class and i keep getting this error. what am i doing wrong ? ----------------------------- class test { public: int funtime(); private: int time; }; int test::funtime()... (4 Replies)
Discussion started by: akira300
4 Replies

9. Programming

dlclose on FreeBSD

Anyone knows how to use dynamic module loading through dlopen/dlsym/dlclose properly on FreeBSD? I wrote a tiny program to learn KDE programming. Perhaps I give you a small snippet to look at int IPTablesApp::Start(int argc, char* argv) { typedef void (*init_t)(int, char*); init_t init;... (0 Replies)
Discussion started by: cbkihong
0 Replies
Login or Register to Ask a Question