FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

segfault with -inline

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Sun Mar 12, 2006 9:23 am    Post subject: segfault with -inline Reply with quote

Linux, dmd 0.148

With this program:
Code:
import mango.io.FileConduit;
import mango.io.TextWriter;

int main(char[][] args)
{
    TextFileConduit file = new TextFileConduit( "test.txt",
            FileStyle.ReadWriteCreate );
    file.truncate();
    TextWriter mWriter = new TextWriter( new Buffer(file), "\n" );
    mWriter.println( "?d", 3 );
    mWriter.flush();
    return 0;
}

compiled without -inline work fine.
With the compiler switch -inline on linux i get an segfault.
GDB backtrace:
Code:
#0  mango.io.TextWriter.TextWriter.encode(void*, uint, int) () at lib/mango/mango/io/TextWriter.d:127
#1  0x0804f2e0 in mango.io.TextWriter.TextWriter.encode(void*, uint, int) () at lib/mango/mango/io/TextWriter.d:127
#2  0x0804f2e0 in mango.io.TextWriter.TextWriter.encode(void*, uint, int) () at lib/mango/mango/io/TextWriter.d:127
#3  0x0804f2e0 in mango.io.TextWriter.TextWriter.encode(void*, uint, int) () at lib/mango/mango/io/TextWriter.d:127
#4  0x0804f2e0 in mango.io.TextWriter.TextWriter.encode(void*, uint, int) () at lib/mango/mango/io/TextWriter.d:127
#5  0x0804f2e0 in mango.io.TextWriter.TextWriter.encode(void*, uint, int) () at lib/mango/mango/io/TextWriter.d:127
#6  0x0804f185 in mango.io.DisplayWriter.DisplayWriter.emit(void[], uint) ()
    at lib/mango/mango/io/DisplayWriter.d:193
#7  0x0805150b in mango.convert.Format.__T13FormatStructTTaZ.FormatStructT.emit(void[], int) ()
    at lib/mango/mango/convert/Format.d:467
#8  0x080511ad in mango.convert.Format.__T13FormatStructTTaZ.FormatStructT.emit(void*, uint, uint) ()
    at lib/mango/mango/convert/Format.d:489
#9  0x08050ebe in mango.convert.Format.__T13FormatS tructTTaZ.FormatStructT.opCall(char[], TypeInfo[], void*) ()
    at lib/mango/mango/convert/Format.d:171
#10 0x0804f09b in mango.io.DisplayWriter.DisplayWriter.print(char[], TypeInfo[], void*) ()
    at lib/mango/mango/io/DisplayWriter.d:132
#11 0x0804f103 in _D5mango2io13DisplayWriter13DisplayWr iter7printlnFAaYC5mango2io13DisplayWriter13DisplayWriter ()
    at lib/mango/mango/io/DisplayWriter.d:157
#12 0x0804fae5 in D main () at mango_inline.d:9
#13 0x080536b3 in main ()

At this point the program is in an endless recursion and gets an stack overflow. Should I post that as dmd bug?
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Sun Mar 12, 2006 9:25 am    Post subject: Reply with quote

BTW: posting this message results in a SQL error of the forum server. I had to insert a space in the long D mangled names.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group