The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Which Base Level Filesets needed by a specific program? cypher82 UNIX for Advanced & Expert Users 4 05-29-2008 09:07 AM
On Premature Optimization iBot Complex Event Processing RSS News 0 02-12-2008 05:20 AM
Help on optimization of the script aju_kup UNIX for Dummies Questions & Answers 2 11-20-2007 02:21 AM
AIX 5.3 64-bit program crashes with AIX 5.1 jeet_xp High Level Programming 3 08-24-2007 09:41 AM
Samba crashes on Solaris with Veritas Cluster rhfrommn UNIX for Advanced & Expert Users 1 10-28-2004 09:24 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-13-2007
Yuriy07 Yuriy07 is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 3
Program crashes with optimization level O2

I am experiencing a difficulty undersatnding why my program (C++, HP UNIX) crashes. It crashes only when I build it with -O (+O2) optimization switch (used in aCC compiler). It works ok with +O0 or +O1 optimization.

Also, I see that local variables are shown incorrecly when program is built with +O2 optimization switch. They show correcly with +O0 or +O1 optimization.

Could anyone advise me on the +O2 optimization? Why this could lead to the crash? Why the debugger fails to show correctly the local variables?

It is compiled with the following switches:
/opt/aCC/bin/aCC -AA -DHPUX -DBUILD_UNIX -DNO_MSG_BUILD -DNO_MAP_BUILD -DUNICODE -DPIC +Z +inst_auto -D_THREADSAFE -mt +W641 +W829 -g0 -O -I.. -I../.. -I../lib -I/usr/local/include/stl -I../pcmsrv32 -I../pcmlib -g0 -c

Below is the gdb output after the crash:

Program received signal SIGSEGV, Segmentation fault.
0x7f0cc484 in GetAddress (grid=0, link=0, rAddress=@0x0) at street.cpp:352
352 street.cpp: No such file or directory.
(gdb) backtrace
#0 0x7f0cc484 in GetAddress (grid=0, link=0, rAddress=@0x0) at street.cpp:352
#1 0x7f2409d8 in LRAddrOutput::AddressSearch (this=0x7f7f41e8, pInterp=0x0,
grid=13, oldNumMatches=2132813148, rLinkJuris=@0x7f7f41cc,
rPostalCodes=@0x7f7f41e8, rLinkInfo=@0x7f7f4178, rNameInfo=@0x7f7f4194,
exact=@0x7f7f4078) at geoaddrs.cpp:3845
#2 0x7f23e450 in LRAddrOutput::SearchForAddress (this=0x7f7f3fe0, gridID=0,
pInterp=0x401be934, exact=@0x7f129158) at geoaddrs.cpp:2887
#3 0x7f232b88 in LRAddrOutput::CalcMatches (this=0x0, pCB=0x0)
at geoaddrs.cpp:559
#4 0x7f244664 in LRAddr::Lookup (this=0x694, region=0x0,
state=0x3 <Error reading address 0x3: Invalid argument>, pCB=0x0)
at geoaddrs.cpp:4901
#5 0x7f24beb0 in CGeocoder::FindStreetMatchesW (this=0x4004cd7c,
addrW=0x4004cd38 "\177\026\357\b", cityW=0x401be3a4 "", stateW=0x0,
countyW=0x401be934 "", zipW=0x401be9b4 "", size=0 '\000', grid=7026188,
pCB=0x0, type=0, lLat=0, lLong=0) at geocoder.cpp:1044
#6 0x7f2a21d4 in Place_NumAddressMatches (geoID=2139042812,
inStr=0x7f7f33f0 "",
city=0xffffffff <Error reading address 0xffffffff: Bad address>,
state=0x0, county=0x401be934 "", zip=0x401be9b4 "", size=0 '\000',
grid=7026188, UpdateProgMeter=0) at placemgr.cpp:957
#7 0x7f30d5d4 in GeoCodeImpl::NodeForCityOrAddr (this=0x7f7f3300,
pGeoResults=0x7f2b8430, pszLookup=0x4000f608 "NA", bExactMatch=96,
bSPLC=false, bRdNameOnly=false) at geo_impl.cpp:542
---Type <return> to continue, or q <return> to quit---
#8 0x7f30df4c in GeoCodeImpl::Nodefor (this=0x401be370,
pszLookup=0x3 <Error reading address 0x3: Invalid argument>,
bExactMatch=-56, returnSPLC=96, pRtOptions=0x40009e78,
bTrySupressPicklist=false) at geo_impl.cpp:687
#9 0x7f336774 in RouteImpl::AddStop (this=0x401b7f58,
name=0x400c17ec "\177+g@t\nfin=CoPilot tiedostotiedot\nfre=Informations sur
le Fichier CoPilot\nger=CoPilot Dateiinformationen\ngre=\316\240\316\273\316\267
\317\201\316\277\317\206\316\277\317\201\316\257\316\265\317\202 \316\263\316\27
1\316\261 \317\204\316\277 \316\261\317\201\317\207\316\265\316\257\316\277 CoPi
lot\nita=Informazioni sui file di CoPilot"..., gc=0x7f7f31b0)
at route_impl.cpp:488
#10 0x7f39915c in PCMSAddStop (trip=333240,
stop=0x5159c "PCMSAddStop returned %d\n") at pcmsrvapp.cpp:1312
#11 0x266b8 in TestFuelOpt () at pcmstest.cpp:616
#12 0x25ae4 in main () at pcmstest.cpp:467
(gdb)

Any help is appreciated.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0