HP-UX 64 compilation causing some code to seg fault


 
Thread Tools Search this Thread
Operating Systems HP-UX HP-UX 64 compilation causing some code to seg fault
# 1  
Old 06-06-2008
HP-UX 64 compilation causing some code to seg fault

Hello everyone,

Today we are attempting to port some legacy C code to a 64 HP-UX machine at my company and there is kind of a strange error we ran into.

there is a small function they have defined called zgetenv that
accepts a char* and basically just does some null checking and returns
getenv(char*)

the function works fine if i copy it into the file im attempting to recompile and change nothing other than the name of the function.
but when i attempt to call this function from the library that we have recompiled for the 64 bit machine I get a segmentation fault on the
returned value if i call a strlen or strcpy on it.

the strange thing is that this function is being called all over the place in this code and it only gives seg faults in this one module for some reason...

the only possible problem i can think of would be that we havent correctly linked this module to the new 64 bit compilation or something but I dont think that would result in a segmentation fault...

I am really really lost and any help would be much appreciated.

Thanks, Eric
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Source code compilation

Need assistance in Source code compilation . When installing a software compiling a source code . Whatever the output that prints on the screen i want to log it into a file. How can i see output and store the output to file ./configure make make install Is there other way of seeing output... (5 Replies)
Discussion started by: ajayram_arya
5 Replies

2. Programming

This code keeps giving me a segmentation fault why?

#include<stdlib.h> #include <pthread.h> #include "tlpi_hdr.h" #include <stdio.h> static volatile int glob = 0; static struct { pthread_t t1,t2; } *thread; static void * /* Loop 'arg' times incrementing 'glob' */ threadFunc(void *arg) { int loops = *((int *) arg); ... (1 Reply)
Discussion started by: fwrlfo
1 Replies

3. Shell Programming and Scripting

sort -t option causing code to fail need ASCII character

Hello, When I run this UNIX code without the -t option it gives me the desired results. The code keeps the record with the greatest datetime based on the key columns. I sort it first then sort it again with the -u option, that's it. I need to have a variable to specify an ASCII character... (2 Replies)
Discussion started by: script_op2a
2 Replies

4. Programming

C code : Segmentation fault

Hi Friends, I have written a small code in C which performs the below operations Task : 1 ) read line by line from a file. 2 ) assuming 3th and 4th fields of the file as GN and GNTO 3 ) The target file should contain all the fields except GNTO. 4... (3 Replies)
Discussion started by: kiran_bhatter
3 Replies

5. Programming

Compilation error when compiling Pro*C code

I'm running a query similar to the one that I'm describing below -: _______________________________ EXEC SQL INSERT INTO TABLE1 ( C1 ,C2 ,C3 ,C4 ) (SELECT DISTINCT B.V1 ,B.V2 ,( SELECT D.V3 FROM TABLE2 D WHERE D.V3 = C.V4) ,B.V4 FROM TABLE2 B ,TABLE3 C WHERE B.V3 = C.V4) ;... (1 Reply)
Discussion started by: maheshp
1 Replies

6. Programming

Program exited with code 01: does it indicate unsuccessful compilation?

(gdb) r --------------------- enter Breakpoint 1, 0x0000000000409d40 in main () (gdb) n Single stepping until exit from function main, which has no line number information. Find_Cmd_Option: found option no. 2: seed (s) Find_Cmd_Option: found option no. 5: dfile (c) Initial no. div... (1 Reply)
Discussion started by: cdbug
1 Replies

7. Programming

Seg Fault Running AIX COBOL program

Hi some help read............ I'm getting a segmentation fault when I run an AIX COBOL/Db2 program. I initiate the program from the command line, but it hangs, and then when I press enter it generates a segmantation fault and produces a core dump. The box is running AIX software level ... (5 Replies)
Discussion started by: steve_f
5 Replies

8. Programming

Xlib Problem: XCloseDisplay seg fault

Hi, First of all forgive me if Xlib related problems does not go under this thread. In my main program, im using Xlib`s XImage type object which contains a regularly updating bitmap, and maps the XImage to a Xwindow using XPutImage. ( XCreateImage is used to create the XImage. ) The... (0 Replies)
Discussion started by: wolwy_pete
0 Replies

9. Programming

compilation parameters, code optimization

Hi all, I implemented an application, through using c++ and compiled it with g++. At first, what I did is (@ compilation): g++ calcBacon.C -o test -DDEBUG after I ran my application it took almost 120 sec. to finish its execution when I compiled with optimization parameters, execution... (5 Replies)
Discussion started by: SaTYR
5 Replies

10. Programming

Open Suse 10 seg fault

Okay, so here is some code that when compiled on Fedora Core 6 works great, but when I compile and run it on OpenSuse 10 it gives back a seg fault when trying to join the 2nd thead. #include <pthread.h> #include <stdio.h> int print_message_function( void *ptr ); int x = 1; main() { ... (1 Reply)
Discussion started by: chrisdrobison
1 Replies
Login or Register to Ask a Question
INTLCALENDAR.GETSKIPPEDWALLTIMEOPTION(3)				 1				  INTLCALENDAR.GETSKIPPEDWALLTIMEOPTION(3)

IntlCalendar::getSkippedWallTimeOption - Get behavior for handling skipped wall time

	Object oriented style

SYNOPSIS
public int IntlCalendar::getSkippedWallTimeOption (void ) DESCRIPTION
Procedural style int intlcal_get_skipped_wall_time_option (IntlCalendar $cal) Gets the current strategy for dealing with wall times that are skipped whenever the clock is forwarded during dailight saving time start transitions. The default value is IntlCalendar::WALLTIME_LAST. The calendar must be lenient for this option to have any effect, otherwise attempting to set a non-existing time will cause an error. This function requires ICU 4.9 or later. PARAMETERS
o $cal - The IntlCalendar resource. RETURN VALUES
One of the constants IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST or IntlCalendar::WALLTIME_NEXT_VALID. EXAMPLES
Example #1 IntlCalendar.getSkippedWallTimeOption(3) <?php ini_set('date.timezone', 'Europe/Lisbon'); ini_set('intl.default_locale', 'en_US'); ini_set('intl.error_level', E_WARNING); //On March 31st at 0100, the clock goes forward 1 hour and from GMT+00 to GMT+01 $cal = new IntlGregorianCalendar(2013, 2 /* March */, 31, 1, 30); var_dump( $cal->isLenient(), // true $cal->getSkippedWalltimeOption() // 0 WALLTIME_LAST ); $formatter = IntlDateFormatter::create( NULL, IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC' ); var_dump($formatter->format($cal->getTime() / 1000)); $cal->setSkippedWallTimeOption(IntlCalendar::WALLTIME_FIRST); var_dump($cal->getSkippedWalltimeOption()); // 1 WALLTIME_FIRST $cal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 1); var_dump($formatter->format($cal->getTime() / 1000)); $cal->setSkippedWallTimeOption(IntlCalendar::WALLTIME_NEXT_VALID); var_dump($cal->getSkippedWalltimeOption()); // 2 WALLTIME_NEXT_VALID $cal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 1); var_dump($formatter->format($cal->getTime() / 1000)); The above example will output: bool(true) int(0) string(40) "Sunday, March 31, 2013 at 1:30:00 AM GMT" int(1) string(41) "Sunday, March 31, 2013 at 12:30:00 AM GMT" int(2) string(40) "Sunday, March 31, 2013 at 1:00:00 AM GMT" SEE ALSO
IntlCalendar::getRepeatedWallTimeOption, IntlCalendar::setSkippedWallTimeOption, IntlCalendar::setRepeatedWallTimeOption. PHP Documentation Group INTLCALENDAR.GETSKIPPEDWALLTIMEOPTION(3)