Bug 252919 - Bogus error about invalid Mach-O file for i386 files on SnowLeopard
Summary: Bogus error about invalid Mach-O file for i386 files on SnowLeopard
Status: RESOLVED UNMAINTAINED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.6 SVN
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-01 04:20 UTC by Daniel Dunbar
Modified: 2023-02-18 21:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Dunbar 2010-10-01 04:20:20 UTC
Version:           3.6 SVN
OS:                Linux

Valgrind 3.6SVN (r11391) gives bogus warnings when trying to run i386 code without debug info:
--
ddunbar@ozzy:tmp$ cat t.c
int main() { return 0; }
ddunbar@ozzy:tmp$ gcc t.c
ddunbar@ozzy:tmp$ valgrind -q ./a.out
ddunbar@ozzy:tmp$ gcc -m32 t.c
ddunbar@ozzy:tmp$ valgrind -q ./a.out
--82216-- WARNING: Serious error when reading debug info
--82216-- When reading debug info from ./a.out:
--82216-- Invalid Mach-O file (bad magic).
--82216-- WARNING: Serious error when reading debug info
--82216-- When reading debug info from ./a.out:
--82216-- Error reading Mach-O object.
ddunbar@ozzy:tmp$ gcc -g -m32 t.c
ddunbar@ozzy:tmp$ valgrind -q ./a.out
ddunbar@ozzy:tmp$ 
--


Reproducible: Always
Comment 1 Daniel Dunbar 2010-10-01 04:24:52 UTC
Ah, I see what is happening here, this is because I had a .dSYM file in the current directory for a different arch. Here is a more complete test scenario:
--
ddunbar@ozzy:foo$ echo "int main() { return 0; }" > t.c
ddunbar@ozzy:foo$ gcc -g -m64 t.c
ddunbar@ozzy:foo$ gcc -m32 t.c && valgrind -q ./a.out
--82441-- WARNING: Serious error when reading debug info
--82441-- When reading debug info from ./a.out:
--82441-- Invalid Mach-O file (bad magic).
--82441-- WARNING: Serious error when reading debug info
--82441-- When reading debug info from ./a.out:
--82441-- Error reading Mach-O object.
ddunbar@ozzy:foo$ 
--

The error message makes more sense now, but it would be nice if it would either mention that the .dSYM file is what is out of date, or simply ignore it if the archs don't match.
Comment 2 Paul Floyd 2023-02-18 21:05:51 UTC
The oldest mac I can access is 10.7 so I'm closing this.