Title: BridJ (via JNAerator studio) fails to process simple code with includes throwing 'OutOfMemory' · Issue #205 · nativelibs4java/nativelibs4java · GitHub
Open Graph Title: BridJ (via JNAerator studio) fails to process simple code with includes throwing 'OutOfMemory' · Issue #205 · nativelibs4java/nativelibs4java
X Title: BridJ (via JNAerator studio) fails to process simple code with includes throwing 'OutOfMemory' · Issue #205 · nativelibs4java/nativelibs4java
Description: Here is the snippet of header file: #include
Open Graph Description: Here is the snippet of header file: #include
X Description: Here is the snippet of header file: #include <iostream> void printSome(int argc, int xs[]); int intTest(int arg); Pretty simple, yeah, but looks like BridJ has to parse out so after a while i...
Opengraph URL: https://github.com/nativelibs4java/nativelibs4java/issues/205
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BridJ (via JNAerator studio) fails to process simple code with includes throwing 'OutOfMemory'","articleBody":"Here is the snippet of header file:\n\n``` c\n#include \u003ciostream\u003e\n\nvoid printSome(int argc, int xs[]);\n\nint intTest(int arg);\n```\n\nPretty simple, yeah, but looks like BridJ has to parse out \u003ciostream\u003e so after a while it fails. Here is the output of log:\n\n```\n/usr/include/c++/4.4.5/iostream:13:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/iosfwd:13:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/stringfwd.h:14:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/cwchar:18:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/cstddef:18:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/cstddef:19:0: error: File not found: stddef.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/exception:11:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/stl_algobase.h:38:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/functexcept.h:12:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/cpp_type_traits.h:14:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/ext/type_traits.h:12:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/move.h:12:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/concept_check.h:13:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/stl_iterator_base_types.h:42:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/cstdio:18:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/stdio.h:28:0: error: File not found: stddef.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/_G_config.h:8:0: error: File not found: stddef.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/wchar.h:31:0: error: File not found: stddef.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/libio.h:35:0: error: File not found: stdarg.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/localefwd.h:14:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/localefwd.h:15:0: error: File not found: bits/c++locale.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/cctype:18:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/ext/atomicity.h:12:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/ext/atomicity.h:13:0: error: File not found: bits/gthr.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/ext/atomicity.h:14:0: error: File not found: bits/atomic_word.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/string:13:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/allocator.h:25:0: error: File not found: bits/c++allocator.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/streambuf:13:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/cwctype:18:0: error: File not found: bits/c++config.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/locale_facets.h:15:0: error: File not found: bits/ctype_base.h in . /usr/include /usr/include/c++/4.4.5\n/usr/include/c++/4.4.5/bits/locale_facets.h:1256:0: error: File not found: bits/ctype_inline.h in . /usr/include /usr/include/c++/4.4.5\nException for /usr/include/c++/4.4.5/ios at line 1128:java.util.concurrent.ExecutionException: java.lang.Exception: java.lang.OutOfMemoryError: Java heap space\njava.util.concurrent.ExecutionException: java.lang.Exception: java.lang.OutOfMemoryError: Java heap space\n at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:262)\n at java.util.concurrent.FutureTask.get(FutureTask.java:119)\n at com.ochafik.lang.jnaerator.JNAeratorParser.parseSlices(JNAeratorParser.java:177)\n at com.ochafik.lang.jnaerator.JNAeratorParser.parse(JNAeratorParser.java:213)\n at com.ochafik.lang.jnaerator.JNAerator.parseSources(JNAerator.java:1119)\n at com.ochafik.lang.jnaerator.JNAerator.jnaerate(JNAerator.java:837)\n at com.ochafik.lang.jnaerator.studio.JNAeratorStudio$14.run(JNAeratorStudio.java:607)\nCaused by: java.lang.Exception: java.lang.OutOfMemoryError: Java heap space\n at com.ochafik.lang.jnaerator.JNAeratorParser$1.call(JNAeratorParser.java:147)\n at com.ochafik.lang.jnaerator.JNAeratorParser$1.call(JNAeratorParser.java:136)\n at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)\n at java.util.concurrent.FutureTask.run(FutureTask.java:166)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)\n at java.lang.Thread.run(Thread.java:636)\nCaused by: java.lang.OutOfMemoryError: Java heap space\n----------\n1. WARNING in file:///test/_IO_marker.java (at line 17)\n public _IO_marker(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n2. WARNING in file:///test/_IO_marker.java (at line 18)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n----------\n3. WARNING in file:///test/_G_fpos64_t.java (at line 17)\n public _G_fpos64_t(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n4. WARNING in file:///test/_G_fpos64_t.java (at line 18)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n----------\n5. WARNING in file:///test/_G_fpos_t.java (at line 17)\n public _G_fpos_t(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n6. WARNING in file:///test/_G_fpos_t.java (at line 18)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n----------\n7. WARNING in file:///test/mbstate_t.java (at line 18)\n public mbstate_t(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n8. WARNING in file:///test/mbstate_t.java (at line 19)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n----------\n9. WARNING in file:///test/TestLibrary.java (at line 619)\n return (Pointer\u003c_IO_FILE \u003e)BridJ.getNativeLibrary(\"test\").getSymbolPointer(\"stdin\").as(DefaultParameterizedType.paramType(Pointer.class, _IO_FILE.class)).get();\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nType safety: Unchecked cast from Object to Pointer\u003c_IO_FILE\u003e\n----------\n10. WARNING in file:///test/TestLibrary.java (at line 650)\n return (Pointer\u003c_IO_FILE \u003e)BridJ.getNativeLibrary(\"test\").getSymbolPointer(\"stdout\").as(DefaultParameterizedType.paramType(Pointer.class, _IO_FILE.class)).get();\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nType safety: Unchecked cast from Object to Pointer\u003c_IO_FILE\u003e\n----------\n11. WARNING in file:///test/TestLibrary.java (at line 680)\n return (Pointer\u003c_IO_FILE \u003e)BridJ.getNativeLibrary(\"test\").getSymbolPointer(\"stderr\").as(DefaultParameterizedType.paramType(Pointer.class, _IO_FILE.class)).get();\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nType safety: Unchecked cast from Object to Pointer\u003c_IO_FILE\u003e\n----------\n12. WARNING in file:///test/TestLibrary.java (at line 728)\n return (Pointer\u003cPointer\u003cByte \u003e \u003e)BridJ.getNativeLibrary(\"test\").getSymbolPointer(\"sys_errlist\").as(DefaultParameterizedType.paramType(Pointer.class, DefaultParameterizedType.paramType(Pointer.class, Byte.class))).get();\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nType safety: Unchecked cast from Object to Pointer\u003cPointer\u003cByte\u003e\u003e\n----------\n----------\n13. WARNING in file:///test/__mbstate_t.java (at line 19)\n public __mbstate_t(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n14. WARNING in file:///test/__mbstate_t.java (at line 20)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n15. WARNING in file:///test/__mbstate_t.java (at line 57)\n public __value_union(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n16. WARNING in file:///test/__mbstate_t.java (at line 58)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n----------\n17. WARNING in file:///test/_IO_FILE.java (at line 19)\n public _IO_FILE(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n18. WARNING in file:///test/_IO_FILE.java (at line 20)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n19. ERROR in file:///test/_IO_FILE.java (at line 525)\n @Array({15 * 4 - 4 * org.bridj.Pointer.SIZE - com.ochafik.lang.jnaerator.runtime.NativeSize.SIZE}) \n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nThe value for annotation attribute Array.value must be a constant expression\n----------\n----------\n20. WARNING in file:///test/__locale_struct.java (at line 19)\n public __locale_struct(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n21. WARNING in file:///test/__locale_struct.java (at line 20)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n----------\n22. WARNING in file:///test/__fsid_t.java (at line 18)\n public __fsid_t(Pointer pointer) {\n ^^^^^^^\nPointer is a raw type. References to generic type Pointer\u003cT\u003e should be parameterized\n----------\n23. WARNING in file:///test/__fsid_t.java (at line 19)\n super(pointer);\n ^^^^^^^\nType safety: The expression of type Pointer needs unchecked conversion to conform to Pointer\u003c? extends StructObject\u003e\n----------\n23 problems (1 error, 22 warnings)\n```\n\nI don't care about warnings, but this one error is confusing.\nI've tried to specify more memory to JNAerator appending `-Xmx2g` but even with 2g of ram result is the same. Is there some workaround? \n\nMy environment is \nUbuntu 10.10 x86 / JNAerator 0.9.9-SNAPSHOT \njava version \"1.6.0_20\"\nOpenJDK Runtime Environment (IcedTea6 1.9.10) (6b20-1.9.10-0ubuntu1~10.10.2)\n","author":{"url":"https://github.com/lazyval","@type":"Person","name":"lazyval"},"datePublished":"2011-11-27T13:27:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/205/nativelibs4java/issues/205"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4652c30c-a3cd-d620-6ead-f6423edf9b06 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEFC:2EE6B2:BE52C3:1051247:697A77EB |
| html-safe-nonce | 001d55c8e2419b30d8b0991d2e2510fa5447a9ca0164bf841a1089d78cd00558 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUZDOjJFRTZCMjpCRTUyQzM6MTA1MTI0Nzo2OTdBNzdFQiIsInZpc2l0b3JfaWQiOiIzMjY5MjY5NjY1MTM3NDU3MTMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5adb220f3eb5e8bf52771d7ea9e2cdb227efa80154241f7159d9403a144e7e54 |
| hovercard-subject-tag | issue:2359908 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nativelibs4java/nativelibs4java/205/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a1f8847b964d3f87a853d4098d00fccbd0db8663ac606f17985532e45b73119b/nativelibs4java/nativelibs4java/issues/205 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a1f8847b964d3f87a853d4098d00fccbd0db8663ac606f17985532e45b73119b/nativelibs4java/nativelibs4java/issues/205 |
| og:image:alt | Here is the snippet of header file: #include |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lazyval |
| hostname | github.com |
| expected-hostname | github.com |
| None | a9d1eabfb8cf0cb510bcf598032681675ad29b7ee4cb3bfb9a0a088a12803628 |
| turbo-cache-control | no-preview |
| go-import | github.com/nativelibs4java/nativelibs4java git https://github.com/nativelibs4java/nativelibs4java.git |
| octolytics-dimension-user_id | 11545921 |
| octolytics-dimension-user_login | nativelibs4java |
| octolytics-dimension-repository_id | 2194042 |
| octolytics-dimension-repository_nwo | nativelibs4java/nativelibs4java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2194042 |
| octolytics-dimension-repository_network_root_nwo | nativelibs4java/nativelibs4java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 31bacebc3305d80609c1b175449c3d314bd1a855 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width