[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
| Title: | DIGITAL UNIX (FORMERLY KNOWN AS DEC OSF/1) | 
| Notice: | Welcome to the Digital UNIX Conference | 
| Moderator: | SMURF::DENHAM | 
|  | 
| Created: | Thu Mar 16 1995 | 
| Last Modified: | Fri Jun 06 1997 | 
| Last Successful Update: | Fri Jun 06 1997 | 
| Number of topics: | 10068 | 
| Total number of notes: | 35879 | 
8607.0. "Need on on pthread library." by HGOVC::SIUKEUNGLEE () Tue Jan 28 1997 01:41
Hi,
    
    Customer report some problem when there program link with pthread
    library. The program will crash and core file generated. Could someone
    help me to take a look of the problem  ?
    
    
    # ./test
    Data Address:0x14000d7c0
    Entry Address:0x140024440
    Entry Address:0x140024280
    Key"12345"found,Entry Address:0x140024440
            Data=hello
    Key"abcde"found,Entry Address:0x140024280
    CDummy data:999
    DECthreads Last Chance handler: thread 2 exiting on status exception
    0x177db005
    Exception: Invalid memory address (dce / thd)
    Resources lost(coredump)
    
    # decladebug ./test ./core
    Welcome to the Ladebug Debugger Version 4.0-25
    ------------------ 
    object file name: ./test 
    core file name: ./core
    Reading symbolic information ...done
    Core file produced from executable test
    Thread 0x2 terminated at PC 0x3ff8053eab0 by signal IOT
    (ladebug) t
    >0  0x3ff8053eab0 in nxm_thread_kill(0x3ffc0081e10, 0x3ffc0080338, 0x2,
    0x3ffc0080310, 0x2, 0x0) DebugInformationStrippedFromFile19:???
    #1  0x3ff8056f1dc in pthread_kill(0x3ffc0082590, 0x140018030,
    0x2130455, 0x3ff8055beb8, 0x0, 0x14002fe78)
    DebugInformationStrippedFromFile100:???
    #2  0x3ff80575b8c in UnknownProcedure10FromFile104(0x2130455,
    0x3ff8055beb8, 0x0, 0x14002fe78, 0x3ff8010fb24, 0x3ffc0080c50)
    DebugInformationStrippedFromFile104:???
    #3  0x3ff8010fb20 in /usr/shlib/libc.so
    #4  0x3ff80159f70 in raise(0x3ff8010fb24, 0x3ffc0080c50, 0x3ff80159f74,
    0x3ff80575ab8, 0x3ff80170aac, 0x0)
    DebugInformationStrippedFromFile441:???
    #5  0x3ff80170aa8 in abort(0x14002f438, 0x0, 0x0, 0x0,
    0xffffffff00000000, 0x177db005) DebugInformationStrippedFromFile329:???
    #6  0x3ff80565c74 in errAbort(0x0, 0x0, 0xffffffff00000000, 0x177db005,
    0x3ff8056650c, 0x3ffc00802a0) DebugInformationStrippedFromFile90:???
    #7  0x3ff80566508 in UnknownProcedure2FromFile91(0x14002f6f8,
    0x3ff805669d4, 0x14002f9d8, 0x3ff8055beb8, 0x14002fa80, 0x3ff807b3488)
    DebugInformationStrippedFromFile91:???
    #8  0x3ff807b220c in UnknownProcedure4FromFile1(0x3ff807b3624, 0x0,
    0x14002f6f8, 0x3ff80574930, 0x14002fa48, 0x3ff805669d4)
    DebugInformationStrippedFromFile1:???
    #9  0x3ff807b3620 in UnknownProcedure16FromFile1(0x0, 0x14002fe78,
    0x14002fe78, 0x14002ef18, 0xabadabad00beed00, 0x0)
    DebugInformationStrippedFromFile1:???
    #10 0x3ff807b3664 in exc_unwind(0x14002fe78, 0x14002ef18,
    0xabadabad00beed00, 0x0, 0x3ff807b254c, 0x35)
    DebugInformationStrippedFromFile1:???
    #11 0x3ff807b2548 in exc_raise_exception(0x120001a50, 0x0, 0x14002f9d8,
    0x0, 0x120002138, 0x120002214) DebugInformationStrippedFromFile1:???
    #12 0x3ff805669d4 in pthread_exc_raise_np(0x0, 0x0, 0x3ff80574718,
    0x120002214, 0x0, 0x0) DebugInformationStrippedFromFile91:???
    #13 0x3ff80574930 in thdBase(0x0, 0x0, 0x0, 0x0, 0x45586732, 0x3)
    DebugInformationStrippedFromFile102:???
    
    
    
    The test program are attached follow.
    
    Welcome any suggestion !
    
    David Lee.
    
    =========================================================================
    
    Digital UNIX 4.0b with all latest patches installed.
    DCE for UNIX 2.0a
    
    
#include <cxx/iostream.hxx>
#include <search.h>
#include <stdlib.h>
#include <pthread.h>
class CDummy
{
public:
	CDummy(int val){data = val;}
	print() { cout<< "CDummy data:"<<dec<<data<<endl;}
private:
	int data;
};
void InsertTab(char*key,void*data)
{
	ENTRY cell;
	cell.key = new char[10];
	strcpy(cell.key,key);
	cell.data=(char*)data;
	ENTRY*item;
	if((item = hsearch(cell,ENTER))==NULL){
		cout <<"Hash table full";
		exit;
	}
else
	cout<<"Entry Address:"<<hex<<item<<endl;
}
void* SearchTab(char* key)
{
	ENTRY* item;
	ENTRY s={key};
	if((item = hsearch(s,FIND))==NULL)
		cout<<"Entry not Found!!"<<endl; 
	else
		cout<<"Key\""<<key<<"\"found,Entry Address:"<<hex<<item<<endl;
		return item->data;
}
void* sos(void* param)
{
	char* a=(char*)SearchTab("12345");
	cout<<"\tData="<<a<<endl;
	((CDummy*)SearchTab("abcde"))->print();
	return NULL;
}
void main(void)
{
	if(hcreate(100)==0)
	cout<<"error creating hash table";
	char* data = new char[10];
	cout<<"Data Address:"<<hex<<(ulong*)data<<endl;
	strcpy(data,"hello");
	CDummy *theDummy = new CDummy(999);
	InsertTab("12345",data);
	InsertTab("abcde",theDummy);
	char* a=(char*)SearchTab("12345");
	cout<<"\tData="<<a<<endl;
	((CDummy*)SearchTab("abcde"))->print();
	
	pthread_t m_thread;
	pthread_create(&m_thread,
		       NULL,
			sos,
		       NULL);
	pthread_join(m_thread,NULL);
}
| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|
| 8607.1 | DCE being used? | TUXEDO::CHUBB |  | Tue Jan 28 1997 11:37 | 5 | 
|  |     This looks suspiciously like Case HGOQB0091 that came into DCE
    recently.  Have they already received a patched libdce for a fix having
    to do with hsearch/hcreate?  Is DCE being linked in?
    
    -- brandon
 | 
| 8607.2 | Problem in hsearch()?  In which library?? | WTFN::SCALES | Despair is appropriate and inevitable. | Tue Jan 28 1997 14:40 | 13 | 
|  | .1> Have they already received a patched libdce for a fix having to do with 
.1> hsearch/hcreate?  
Not to be nosy or anything, but I thought hsearch(3)/hcreate(3) were implemented
in libc...is there another implmentation in libdce??
Re .0, the program is dying of a SEGV; inside sos(), either the call from to
SearchTab() is returning a NULL pointer, or there's some problem inside
SearchTab() itself.
					Webb
 | 
| 8607.3 | patches already applied. | HGOVC::SIUKEUNGLEE |  | Tue Jan 28 1997 20:37 | 11 | 
|  |     Hi Brandon,
    
    The Case HGOQB0091 are fixed by patches libdce and closed. It is a new
    problem report from customer. When they try to using a thread to
    perform  the 'SerachTab()' function then the aplication will crash. 
    
    The problem can be reproduce no matter link with DCE library or not.
    
    Welcome any suggestion!
    
    David Lee.
 | 
| 8607.4 | I suggest you use the debugger. | WTFN::SCALES | Despair is appropriate and inevitable. | Wed Jan 29 1997 18:17 | 11 | 
|  | .3> Welcome any suggestion!
My suggestion is that you try to reproduce the problem yourself using the
supplied test program; if you are successful, I suggest that you attempt to
debug it using a debugger, and stop at the point where the SEGV occurs.
Once you've done that, I suspect you'll be in a position to tell US what the
source of the problem is.
				Webb
 | 
| 8607.5 | dce & hsearch | TUXEDO::CHUBB |  | Fri Jan 31 1997 18:13 | 12 | 
|  |     Re: .2..
    Webb,
    
    the OSF's 1.1 version of DCE did indeed have its own hsearch/hcreate..
    functions included that were simplified for efficiency but couldn't
    deal with all the same inputs.  We've renamed them to DCE-specific
    names so there will no longer be conflicts for the user, but DCE itself
    can use the simplified versions.
    
    This is evidentally an entirely unrelated problem.
    
    -- brandon
 |