[ wxwindows-Bugs-1783156 ] wxFileConfig DeleteEntry corruption

SourceForge.net noreply at sourceforge.net
Mon Sep 17 08:58:44 PDT 2007


Bugs item #1783156, was opened at 2007-08-28 11:41
Message generated for change (Comment added) made by xagox
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1783156&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Common
Group: Must fix
Status: Open
Resolution: None
Priority: 9
Private: No
Submitted By: Axel Gembe (xagox)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxFileConfig DeleteEntry corruption

Initial Comment:
Hello, I've been trying to find a wxFileConf problem for some time but did not have luck. I've found a way to work around the problem, but I still wanted to let you guys know the problem. I've attached a simple test case that produces the problem (tested with latest SVN). Basically the bug will corrupt the configuration file because it inserts a new group in the middle of an existing one. If you check the diff between test1.inb and test3.inb you will see what I mean. I think the problem is related to DeleteEntry using the bGroupIfEmptyAlso set to true. If I set it to false the problem doesn't happen.

----------------------------------------------------------------------

>Comment By: Axel Gembe (xagox)
Date: 2007-09-17 17:58

Message:
Logged In: YES 
user_id=1598021
Originator: YES

Here is the output of the unit test:

D:\MyProjects\wxWidgets\tests>vc_mswud\test.exe FileConfigTestCase
Test program for wxWidgets
build: 2.9.0 (debug,Unicode,Visual C++,wx containers,compatible with 2.8)

WARNING: VsnprintfTestCase will test the system vsnprintf() function
         instead of the wxWidgets wxVsnprintf_ implementation!

.........F........

.\config\fileconf.cpp(351) : error : Assertion
Test name: FileConfigTestCase::DeleteEntry
equality assertion failed
- Expected: [root/group1]
subentry=subvalue
subentry2=testvalue
subentry3=subvalue3
[root/group2]
subentry2=testvalue2

- Actual  : [root/group1]
subentry2=tesvalue
[root/group2]
subentry2=tesvalue2
subentry=subvalue
subentry3=subvalue3


Failures !!!
Run: 17   Failure total: 1   Failures: 1   Errors: 0

D:\MyProjects\wxWidgets\tests>


----------------------------------------------------------------------

Comment By: Axel Gembe (xagox)
Date: 2007-09-17 17:57

Message:
Logged In: YES 
user_id=1598021
Originator: YES

OK, I've now attached a patch for the wxFileConfig cppunit test that
clearly shows the problem, but I'm still unable to find out whats going
wrong there...
File Added: fileconfig-test.patch

----------------------------------------------------------------------

Comment By: Axel Gembe (xagox)
Date: 2007-08-31 11:18

Message:
Logged In: YES 
user_id=1598021
Originator: YES

I've just attached a tracelog. Here are the relevant lines. The last line
in group Sensor63 is NOT EinlernTel1=51.

11:16:33: Trace: (fileconf)   GetLastEntryLine() for Group 'Sensor63'
11:16:33: Trace: (fileconf)     ** Inserting Line '[Sensors/Sensor0]'
after 'EinlernTel1=51'

File Added: test.txt

----------------------------------------------------------------------

Comment By: Axel Gembe (xagox)
Date: 2007-08-29 11:22

Message:
Logged In: YES 
user_id=1598021
Originator: YES

Nobody got any idea ? Can anybody reproduce the bug with the attached test
code ?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1783156&group_id=9863




More information about the wx-dev mailing list