strstr() in Solaris System


 
Thread Tools Search this Thread
Top Forums Programming strstr() in Solaris System
# 1  
Old 11-29-2012
Wrench strstr() in Solaris System

Can any one help with the function strstr() in Solaris unix.
The equivalent function of strstr() in Solaris Unix. This function is working in HP Unix but not in Solaris Unix.
# 2  
Old 11-29-2012
"Not working" isn't very useful.

What's your specific problem? Providing the failing source code really helps, too.
# 3  
Old 11-29-2012
The strstr interface is standardized by POSIX.1. It is available in both HP-UX and Solaris.
# 4  
Old 11-29-2012
Please post your C code that "does not work on " Solaris.
# 5  
Old 11-30-2012
Wrench

When am using return(malloc(intnumberofbytes) for a void function am getting a bus error.
I got below error list after GDB
Code:
0xffffffff75b84d38 in t_splay () from /lib/64/libc.so.1
#1  0xffffffff75b84b9c in t_delete () from /lib/64/libc.so.1
#2  0xffffffff75b84778 in realfree () from /lib/64/libc.so.1
#3  0xffffffff75b850cc in cleanfree () from /lib/64/libc.so.1
#4  0xffffffff75b840d8 in _malloc_unlocked () from /lib/64/libc.so.1
#5  0xffffffff75b83fc8 in malloc () from /lib/64/libc.so.1
#6  0x00000001000168c4 in mallocX (vintNumberOfBytes=3312) at Malloc.c:97
#7  0x000000010000f5bc in IncreaseAListSize (robjAlist=0x1001692b0, vlngNewSize=1) at AList.c:1252
#8  0x000000010000fb58 in AddToTailAL (robjAlist=0x1001692b0, vobjElementPtr=0x10031a770) at AList.c:1458
#9  0x0000000100006a64 in _ULOGTemplateList (vobjULOGAnalyzeDb=0x5) at ULOGAlerts.c:228
#10 0x0000000100007358 in main (argc=6, argv=0xffffffff7fffe988) at ULOGAlerts.c:421

Can any one help me with the Issue.
# 6  
Old 11-30-2012
IF you mean your void function does this:
Code:
void foo()
{
    // code here
    return malloc(intnumberofbytes);
}

This will corrupt your stack. The memory allocated will be unreachable also. I am surprised the compiler lets you do this. This is called undefined behavior in compiler speak. It means: the result of doing this is not defined, so if it works it is by accident that is does so.
# 7  
Old 11-30-2012
Quote:
Originally Posted by jhon1257
When am using return(malloc(intnumberofbytes) for a void function am getting a bus error.
Debugger traces are nice supplemental data, but, as mentioned above, there's no subsitute for actually sharing the code that's causing the problem.

Is this in any way related to the strstr issue or have you moved on? If you've moved on, you should have started another thread and provided some closure for this one (such as posting your solution to the problem so that others may learn and benefit from your experience).

Regards,
Alister
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

Linux/Solaris System Administrator to become a Linux/Solaris System Programmer?

Hi all What is the qualification required by Linux/Solaris System Administrator to become a Linux/Solaris System Programmer as to gain complete knowledge on computers. Thanks (1 Reply)
Discussion started by: Tlogine
1 Replies

2. UNIX for Dummies Questions & Answers

Help with Solaris file system

Hi, I have not worked on Solaris 10 that much. Need some help with this. I can't seem where the file or how the file systems are mounted. Please see the /etcvfstab below. more vfstab #device device mount FS fsck mount mount #to mount to fsck ... (3 Replies)
Discussion started by: samnyc
3 Replies

3. HP-UX

how to mount a file system from a solaris server into an hp-ux system

Hi all I wonder if its possible to mount on a hp-ux server a file system that was previously mounted on a solaris 10 server. The LUN is on NetApp stoarge. The problem on hp-ux I cannot do pvcreate on the lun (disk) because contains data. Any help will be appreciated FR (2 Replies)
Discussion started by: fretagi
2 Replies

4. Solaris

dual boot solaris/solaris zfs file system

Hi, I am running into a some problems creating a dual boot system of 2 solaris instances using ZFS file system and I was wondering if someone can help me out. First some back ground. I have been asked to change the file system of our server from UFS to ZFS. Currently we are using Solaris... (3 Replies)
Discussion started by: estammis
3 Replies

5. Solaris

Solaris 10 system requirements???

Hi guys, I have been using Solaris 10 virtually since a couple of weeks under VirtualBox. Now I want to run it on hardware as it doesn't seem to work well under VirtualBox, atleast to my knowledge. I have another system which I intend to run Solaris on, and it is as under. Processor:- Intel... (1 Reply)
Discussion started by: gabam
1 Replies

6. Solaris

Solaris 10 system hangs

Solaris 10 (Sun V210) System hangs every couple of months. Have to go into ALOM to reset. I did a consolehistory report and seen this in it. Failed to exec inetd_start method of instance svc:/network/bootps/udp:default: I/O error WARNING: /pci@1c,600000/scsi@2 (glm0): Resetting... (3 Replies)
Discussion started by: Joeentech
3 Replies

7. Solaris

How I can get System Performance on Solaris

Hi All, Can someone help me out knowing all commands for getting system performance on Solaris machines. Thanks in advance, Yagami Light. (5 Replies)
Discussion started by: Yagami
5 Replies

8. Solaris

rsh commands not getting executed from Solaris 10 System to AIX System

Hi Friends, I am trying to execute rsh commands from Solaris 10 system to AIX system. When I give; Solaris10# rsh <hostname> ls -l , it gives me an error rshd : 0826-826 The host name for your address is not known At the same time, Solaris10# rsh <hostname> ---- gives me remote shell of... (25 Replies)
Discussion started by: jumadhiya
25 Replies
Login or Register to Ask a Question