Hi guys..
I have some problems reading a file.
always I run the program, this crash in the same position of file.
I used gdb to debug and I had this error:

#0 0x00002aaaabd4c40b in memcpy () from /lib64/libc.so.6
#1 0x00002aaaaaf9c172 in QString::append (this=0x639260, str=@0x7fff529efe10) at /usr/include/bits/string3.h:52
#2 0x00002aaaaafe4277 in QTextStreamPrivate::fillReadBuffer (this=0x6391d0, maxBytes=-1) at ../../src/corelib/tools/qstring.h:255
#3 0x00002aaaaafe4f25 in QTextStreamPrivate::scan (this=0x6391d0, ptr=0x7fff529f3f08, length=0x7fff529f3f1c, maxlen=0, delimiter=QTextStreamPrivate::EndOfLine) at io/qtextstream.cpp:696
#4 0x00002aaaaafe5a81 in QTextStream::readLine (this=<value optimized out>, maxlen=0) at io/qtextstream.cpp:1584
#5 0x0000000000401ed2 in main (argc=2, argv=0x7fff529f41b8) at main.cpp:53


the problem, I think is in.readLine() but I don't know why.

Could you help me?

Qt Code:
  1. if(sql_file.open(QIODevice::ReadOnly | QIODevice::Text))
  2. {
  3. QTextStream in(&sql_file);
  4. QString line;
  5. int pos = 0;
  6.  
  7. do {
  8. line = in.readLine(); <------- problem here
  9. qDebug() << "pos: " << pos << " length: " << line.length();
  10.  
  11. ++pos;
  12. //process_line(line);
  13. } while (!line.isNull());
  14.  
  15. sql_file.close();
  16. }
To copy to clipboard, switch view to plain text mode 

Thanks in advance