Bug 388 - GlueGen doesn't calculate offsets correctly for complex structs (StructAccessor)
Summary: GlueGen doesn't calculate offsets correctly for complex structs (StructAccessor)
Status: VERIFIED FIXED
Alias: None
Product: Gluegen
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: Other all
: P4 major
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2010-03-17 05:37 CET by Michael Bien
Modified: 2011-12-02 07:57 CET (History)
0 users

See Also:
Type: DEFECT
SCM Refs:
f733203dfbd034a6b1aa3eb2cd616437c982c435 9a889948e7d649286ae0a473b49d14461c8981c5 133de98defb7ec3d1f202805505aa85a5650e3d0 a0fc362dfd5857ed3485b72f93baaa05f2591a1d 2bf03e9814477b412f9533d3ba3f4c597892501e 8fc841257cae6b49399b29dfa53e3e834d27cabb 92d6c9dc5fa72b01703456452c60822f36c14fff 846c64d71d0e07ce1f5b4955eba8b49bfa0b5a22 0a8e1566c766f3b5a5e71b5d80500034f1a614a8 8b3057585930357bb16546f584d998953b084034 dc4b259b6651bdc0cec0895bc74e26e504870c8e 4aa66890176e9c2d8e648d6031c9491c3d625e07 3f2110f045de4bd4bd43f681256626bed1998fc3 dac1bac087ac94c596dcb74185d504712069b0a7
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2010-03-24 08:04:19 CET


---- Reported by mbien@fh-landshut.de 2010-03-17 17:37:13 -0400 ----

array support for structs needs more work
http://github.com/mbien/gluegen/commit/0fa706b4eef533ead671310a9a7e063a910198cb
field offsets are not calculated correctly in some situations.

for an example run GlueGen's StructAccessorTest and check the generated offsets for struct.h.



--- Bug imported by sgothel@jausoft.com 2010-03-24 08:04 EDT  ---

This bug was previously known as _bug_ 2 at http://jogamp.org/bugzilla/show_bug.cgi?id=2
Comment 1 Sven Gothel 2010-11-19 13:03:37 CET
P4 since our current projects can live with this issue ..
Comment 2 Sven Gothel 2011-07-23 02:08:23 CEST
gluegen/wip_mobile branch, will be merged to master soon.

Summary (details see git commit log):

    Currently GlueGen fails for type long (size) and some alignments (see package.html).
      - The size and alignment values shall be queried at runtime.
      - Compound alignment needs to follow the described natural alignment (also @runtime).

    - StructLayout:
       - Utilizing SizeThunk alignment
       - Alignment
           1) Natural type alignment
           2) Add Size
           3) Trailing padding w/ largest element alignment

    java c-struct code generation:
      - single class using size/offset arrays of all MachineDescription configurations
      - at runtime the array idx is queried in static block
      - type aligment for not fixed-native-size types (SizeThunk, undef long/int) via StructAccessor

OK: linux 32/64/armv7l, android armv7l, windows 32/64