c++ - 64-bit program segmentation fault on HP-UX PA RISC -


I'm using 3 HP-UX PA RISC machine for testing A Palestinian Authority is failing on the machine, where others have to do this work. Note, even if the binary is executed with the version check, i.e. it prints the version only and exits and does not carry any other operation, even though binary division is making a mistake. What is the probable reason for the segmentation fault? It is important for me to know the root causes of failure on a box. As the program is working on 2 HP-UX, it seems that this is a environmental problem?

I tried to copy the same type of code in the exam program (i.e., declare variables, print edition and exit) and build with it compilation option but it is working. Here's the GDB output for the program.

  $ gdb prg_us detected 64-bit executable. Includes / opt / Langoli / bin / GDB 64 HP GDB 5.4.0 PA-RISC 2.0 (Extended), HP-UX 11.00 and Target HPPA 2.0.0-HP-HPX 11.00 Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-Packard Wildlife 5.4.0 (GDB based) is covered by the GNU General Public License. Type "show copy" to change the terms and / or to deliver copies. Type "show warranty" for warranty / support. (Gdb) b 5573 breakpoint 1 0x4000000000259e04: file pmgreader.c, line 5573 / tmp From / test / prg_us (GDB) R-V Programming Start: / TMP / Test / PreGiS-1 Breakpoint 1, Main (RGC = 2, RGV = 0x800003ffbfff05f8) at pmgreader.c: 5573 5573 if (RGC == 2 & amp; ARC [ 1], "-v") == 0) Current language: Auto; Currently C ++ (GDB) N 5575 printf ("% s", VER); (GDB) EN 5576 exhaust (0); (GDB) N program receiving signal SIGSEGV, Segmentation fault CICODAD: 0 - SEGV_UNKNOWN - Unknown error. 0x800003ffbfb9e130 real_free + 0x480 () to /lib/pa20_64/libc.2 (gdb)   

What should be the possible reason? Why is it working on one and not on another?

Just a long shot - both of you stdio.h and Stdlib.h so that it is known for the prototype compiler for printf () and exit () ?

Actually, after a little more consideration (and seeing that C ++ is in the mix), you may have some static object initialization, which can cause problems (possibly damaging the heap?). .

Unfortunately, it seems that Valgrind is not supported on PA-RISC - is there any such tool to run on PA-RISC? If not, it may be appropriate to run the valgrind on your program's x64 build, if it is not very difficult to set up.

Comments