Summary: | crashes when parsing php include file | ||
---|---|---|---|
Product: | [Unmaintained] quanta | Reporter: | Steve Bergman <steve> |
Component: | general | Assignee: | András Manţia <amantia> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | Kolberg_dev, softexpert |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Backtrace from crash of quanta_be 030104 cvs
Include file for reproducing problem Backtrace quanta-03-01-04cvs and vanilla qt-3.3.1 stderr of qstring_test |
Description
Steve Bergman
2004-03-01 04:02:40 UTC
Hi, I can't reproduce here. It simply does not crash. I'll update the version number to 2004-03-01, so next time when you get an update try to be sure that it's at least this version and report if it still crashes or not. Andras Created attachment 4963 [details]
Backtrace from crash of quanta_be 030104 cvs
It still crashes in the same place with current CVS. I just sent a backtrace. I've done some more testing and the problem seems to have to do with the length of the include file. It does not seem to care about how many lines, but it does seem to char about total file size. I've paired it down and if the include file is 2002 bytes in size it's fine. If it is > 2002 bytes in size it crashes. I checked to make sure it was not the total size of the include file + the original file with the include statement. It's not. I can increase the size of the file with the include statement and it does not crash. Which bug number should I be using? 117154 or 76478? I've done yet more testing. I radically changed the file by deleting out most of the code and replacing it with a series of 'echo "hello";' statements. It is acting very similarly to the way it did before, except that now the magic number is 1513 bytes. It crashes with 1514 but is OK as long as the include file is < 1514. I thought I had already added this, but apparently I never committed it. Anyway, here is a more detailed description of what I am doing: 1. Bring up quanta 2. Create new project 3. Cut and paste the attached dbClasses.inc code into the editor 4. Save it as dbClasses.inc 5. Click "New" for a new file. 6. Type: <?php include('dbClasses.inc'); ?> 7. Save this as test.php. (Should crash here. In case not, continue on.) 8. Close quanta. 9. Open quanta. 10. Open the project. 11. Double click on test.php 12. Should have crashed by now. Created attachment 4972 [details]
Include file for reproducing problem
It would be nice if you could get a backtrace after you reconfigure /recompiled quanta with the --enable-debug=full switch. And as I still can't reproduce, I'd suggest you to compile your Qt from source. It seems that the crash is in QString::replace (a Qt method), so it might be that the Fedora package is broken (eg. too heavy optimization flags were used). I have built vanilla qt-3.3.1 from scratch. (I had to symlink libqt.so.3 to libqt-mt.so.3 before quanta would actually come up.) The problem persists. Perhaps I need to rebuild quanta against the vanilla qt? I'll try that and report back. Ok, but don't forget to pass the --enable-debug=full to configure. Andras OK. This is quanta CVS from 03-01-04 compiled with --enable-debug=full against vanilla qt 3.3.1 compiled with -threads and -debug. Same behavior. I will attach the backtrace. Created attachment 4981 [details]
Backtrace quanta-03-01-04cvs and vanilla qt-3.3.1
Off-topic question: How do I add this to my bugs so that I get an email on changes? I'm using Fedora Core 1, KDE 3.2, qt-3.2.3 from Red Hat RPM. Quanta version is 3.2.0. I've checked this bug and my Quanta also crash. Steve could you look at bug 73713, and try to test your Quanta? You have CC field in the bugreport's page. Add your email address there. Now,if someone has the time I'd like to see a self compiled qt and kdelibs on Fedora, without using heavy optimization compiler flags. I'm really curious why does it crash for you, but not for me and some others. Note, recompiling with 3.2 be does correct the crashing problem for me, so it appears that my problem is fixed... I'll try to contact the manager for quanta for the Mandrake cooker and get the fix included. Thanks for the help. Bug added to the Mandrake cooker bugzilla. Link https://qa.mandrakesoft.com/show_bug.cgi?id=8643 Looks like it had been reported once over there but they diagnosed the problem as and incorrect kcontrol->file association, ie .php as application.. However my files use html embeded php and thus the extention is .html which correctly associates with text. I have tested with the index.php and faccount.php from 73713 and it does not crash here. Though I still have my original problem. *** Bug 76735 has been marked as a duplicate of this bug. *** Created attachment 5109 [details]
stderr of qstring_test
Here are the results of the qstring_test.cpp test program compiled and run
against vanilla qt 3.3.1.
CVS commit by amantia: Don't crash when parsing an included file.[#76478] CCMAIL: 76478-done@bugs.kde.org M +2 -1 ChangeLog 1.241 M +5 -4 parsers/parser.cpp 1.194 --- kdewebdev/quanta/ChangeLog #1.240:1.241 @@ -44,5 +44,6 @@ - background parsing: allow user input while parsing [#63000 and its duplicates] - load DTEPs only on demand: improves startup performance, uses less memory - - use the correct quotation and case when inserting a link to a file from the treeviews [#76663] + - use the correct quotation and case when inserting a link to a file from the treeviews [#76663] + - behavioral changes: - remove the < and > from the entered misc. tags. --- kdewebdev/quanta/parsers/parser.cpp #1.193:1.194 @@ -1321,7 +1321,7 @@ void Parser::parseIncludedFile(const QSt if (pos == -1) pos = foundStr.length(); -/* kdDebug(24000) << "length: " << foundStr.length() << endl; - kdDebug(24000) << "index: " << structPos << " length: " << pos - structPos + 1 << endl; */ - foundStr.replace(structPos, pos - structPos + 1, &space, pos - structPos + 1); + QString spaces; + spaces.fill(' ', pos - structPos + 1); + foundStr.replace(structPos, pos - structPos + 1, spaces); int openBracketPos = foundStr.findRev(dtd->structKeywordsRx, structPos); openBracketPos = foundStr.find('(', openBracketPos); @@ -1338,5 +1338,6 @@ void Parser::parseIncludedFile(const QSt closeBracketPos++; } - foundStr.replace(openBracketPos, closeBracketPos - openBracketPos, &space, closeBracketPos - openBracketPos); + spaces.fill(' ', closeBracketPos - openBracketPos); + foundStr.replace(openBracketPos, closeBracketPos - openBracketPos, spaces); } |