Bug 318084 (MONO75056) - [PATCH] [SPARC] mono --debug uses unaligned access
Summary: [PATCH] [SPARC] mono --debug uses unaligned access
Status: RESOLVED FIXED
Alias: MONO75056
Product: Mono: Runtime
Classification: Mono
Component: debug (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Blocker
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-27 01:57 UTC by Andrew Jones
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Patch (975 bytes, patch)
2005-06-24 01:36 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:18:33 UTC


---- Reported by ascii.letter@gmail.com 2005-05-26 18:57:26 MST ----

Please fill in this template when reporting a bug, unless you know what you
are doing.
Description of Problem:
"mono --debug" dumps core.

Steps to reproduce the problem:
1. Compile mono 1.1.7 on Solaris.  I used the following:

ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.477
GNU nm 2.15
GNU ar 2.15
gcc (GCC) 3.4.3

2. Run a program, any program, with "--debug."

Actual Results:
>mono --debug lib/mono/1.0/gacutil.exe
Bus error (core dumped)
>mono --debug test.exe
Bus error (core dumped)

How often does this happen? 
Every time.



---- Additional Comments From vargaz@gmail.com 2005-05-26 19:39:22 MST ----

This is because of lines like this in mono-debug.c:

	* ((gpointer *) ptr) = klass;
	ptr += sizeof (gpointer);

This will crash on machines which do not allow unaligned access
(like the sparc), and it will be slow on machines that allow it
(x86).




---- Additional Comments From bmaurer@users.sf.net 2005-06-23 18:36:01 MST ----

Created an attachment (id=168013)
Patch




---- Additional Comments From bmaurer@users.sf.net 2005-06-23 18:36:55 MST ----

This patch should fix the issue -- at least for this access. I haven't
gotten a chance to actually run this on a sparc box. I left the READ
version of the macro in there as it could potentially be useful for
that file.



---- Additional Comments From vargaz@gmail.com 2005-07-30 14:16:24 MST ----

This happens on IA64 too. Having unaligned accesses is slow even on
architectures which tolerate it like x86. Also, some data structures
inside the symbol file are not aligned properly, like the 
minfo->lexical_blocks structure.

Martin, could you take a look at this ?




---- Additional Comments From vargaz@gmail.com 2005-08-07 13:49:28 MST ----

*** https://bugzilla.novell.com/show_bug.cgi?id=MONO75725 has been marked as a duplicate of this bug. ***

Imported an attachment (id=168013)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>Solaris 10 (SPARC platform edition.)</cf_op_sys_details>
Unknown operating system Solaris [Other]. Setting to default OS "Other".