1. memstruct segfaults
- Posted by ghaberek (admin) Feb 06, 2015
- 1767 views
Forked from Re: OpenEuphoria's Strategy
Yes! I have been playing with the memstruct interpreter on 64-bit Linux lately, and I really love having memstructs, but it segfaults when ever I do anything wrong.
Like, bad struct passing to C stuff, or crashes in the interpreter itself? I'm sure there are plenty of bugs in there. Porting Win32Lib has been a big help in generating different ways of using them.
There are at least two syntax errors I've been able to produce that result in a Segmentation fault crash.
I think there were a few more but I cannot remember what they were right now, and I have since correct the code that caused them.
I'll surely let you know if they happen again.
-- segfault when referencing a memstruct within itself. should be "syntax error, -- memstruct cannot reference itself directly. did you mean 'pointer TEST_STRUCT next'?" memstruct TEST_STRUCT TEST_STRUCT next end memstruct
-- segfault when referencing an undefined memtype. should be "memtype 'bool' has not been declared." memstruct TEST_STRUCT bool enabled end memstruct
Running the latest memstruct branch that I compiled myself recently.
[greg@localhost Projects]$ eui -v Euphoria Interpreter v4.1.0 development 64-bit Linux, Using System Memory Revision Date: 2015-01-18 16:51:09, Id: 6273:511ab308da2e
-Greg
2. Re: memstruct segfaults
- Posted by mattlewis (admin) Feb 06, 2015
- 1753 views
There are at least two syntax errors I've been able to produce that result in a Segmentation fault crash.
A handy way to debug this sort of thing (front end segfault) is to run with the interpreted front end (eui.ex).
-- segfault when referencing a memstruct within itself. should be "syntax error, -- memstruct cannot reference itself directly. did you mean 'pointer TEST_STRUCT next'?" memstruct TEST_STRUCT TEST_STRUCT next end memstruct
Hmm...this one seems to be getting into an infinite loop, which kinda makes sense. That's a bad declaration. I'm sure that should be a pointer to a TEST_STRUCT.
-- segfault when referencing an undefined memtype. should be "memtype 'bool' has not been declared." memstruct TEST_STRUCT bool enabled end memstruct
This one I get:
std/sequence.e:2276 in function join() type_check failure, items is 172 ... called from /home/matt/eu/oe/hg/source/fwdref.e:1187 in procedure Resolve_forward_references() ... called from /home/matt/eu/oe/hg/source/parser.e:5242 in procedure parser() ... called from /home/matt/eu/oe/hg/source/main.e:201 in procedure main() ... called from /home/matt/eu/oe/hg/source/main.e:228 --> See ex.err
So...have to dig into these to see what's going on. Thanks for the heads up.
Matt
3. Re: memstruct segfaults
- Posted by mattlewis (admin) Feb 06, 2015
- 1707 views
I pushed up fixes for both errors.
Matt
4. Re: memstruct segfaults
- Posted by ghaberek (admin) Feb 09, 2015
- 1670 views
I pushed up fixes for both errors.
I just pulled the latest changes. Works like a charm. Thanks!
-Greg
5. Re: memstruct segfaults
- Posted by mattlewis (admin) Feb 12, 2015
- 1583 views
I just pulled the latest changes. Works like a charm. Thanks!
FYI, I just pushed up a fix for a real doozy of a bug, where it wouldn't properly resolve memstruct stuff from included files. Amazingly, been there for over a year and a half.
Matt
6. Re: memstruct segfaults
- Posted by ghaberek (admin) Feb 12, 2015
- 1595 views
FYI, I just pushed up a fix for a real doozy of a bug, where it wouldn't properly resolve memstruct stuff from included files. Amazingly, been there for over a year and a half.
I just pulled the changes and rebuilt again. Thanks!
-Greg