1. memstruct segfaults

Forked from Re: OpenEuphoria's Strategy

mattlewis said...
ghaberek said...

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. sad

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

new topic     » topic index » view message » categorize

2. Re: memstruct segfaults

ghaberek said...

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).

ghaberek said...
-- 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.

ghaberek said...
-- 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

new topic     » goto parent     » topic index » view message » categorize

3. Re: memstruct segfaults

I pushed up fixes for both errors.

Matt

new topic     » goto parent     » topic index » view message » categorize

4. Re: memstruct segfaults

mattlewis said...

I pushed up fixes for both errors.

I just pulled the latest changes. Works like a charm. Thanks! smile

-Greg

new topic     » goto parent     » topic index » view message » categorize

5. Re: memstruct segfaults

ghaberek said...

I just pulled the latest changes. Works like a charm. Thanks! smile

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: memstruct segfaults

mattlewis said...

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu