From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ba33,18836a8b68997d5b X-Google-Attributes: gid10ba33,public X-Google-Thread: 1164f8,18836a8b68997d5b X-Google-Attributes: gid1164f8,public From: crewman@netcom.com (Kevin Weller) Subject: Re: "unaligned access" in malloc() Date: 1996/02/20 Message-ID: #1/1 X-Deja-AN: 140246374 sender: crewman@netcom9.netcom.com references: followup-to: comp.sys.dec,gnu.g++.help organization: NETCOM On-line Communication Services (408 261-4700 guest) newsgroups: comp.sys.dec,gnu.g++.help Well, I found the problem and fixed it...turns out, a buffer was being freed twice in a chain execution of virtual destructors. I usually know better than to suspect the library, but then, I'd been searching my code for days, with no luck, and any C programmer knows what that can do to someone's sanity. Despite my embarrassment, I must say that the good folks at DEC sure buried the "atom" toolkit deep. It's man pages weren't included in the standard places, so I had absolutely no idea it existed. Only after someone with Digital tech support mentioned it, along with several nice people via email, did I actually know of it...but not even the DEC tech could tell me where the documentation was or how to use it! I wound up searching the entire "dxbook" CD-ROM for references to the word "atom", finally turning up some documentation on where the stuff is and how to use it. But it was too late, since I found and used Gray Watson's dmalloc library to track down the problem. I think I'll have my boss make a donation to Mr. Watson; dmalloc is worth it. Thanks to all who responded to my pleas during my hour of crisis. Shamefully, Kevin Kevin Weller (crewman@netcom.com) wrote: : I've got a program that uses free store pretty heavily. I compile it : with G++ 2.7.0, as I have done for weeks. Now, however, after so many : uses of malloc() [as called from operator new, but the problem shows : up even if I switch to direct malloc() and free() usage], it bombs : with: : Unaligned access pid=13346 va=6174616400160011 pc=3ff800cdce0 : ra=300018406cc type=stq : The debuger (gdb) shows that this occurs *inside* malloc(), *before* : it ever returns to the caller. : It's my understanding that G++ new and free use the malloc() out of : DEC's standard C library, so I'm not sure if it's a problem with the : DEC malloc() or the G++ environment...hence the crossposting. Not : having the source to malloc(), I can't exactly debug it myself. : Does anybody know what's going on here, or if there is a patch for : malloc() or gcc? Thanks! -- ------------------------------------------------------------------------------ Kevin L. Weller, a.k.a. Crewman!!! /-------+--------------------\ crewman@netcom.com | aTm | GIG 'EM, AGGIES! | This is my personal (non-business) account \-------+--------------------/ ------------------------------------------------------------------------------ %SYS-E-BADOPSYS, Fatal system error, DEC VMS halting \ All wiyht. Rho sritched -SYS-I-GETUNIX, Replace with UNIX immediately! \ mg kegtops awound? ------------------------------------------------------------------------------