From: SourceForge.net <no...@so...> - 2003-12-15 11:43:49
|
Support Requests item #860173, was opened at 2003-12-15 14:29 Message generated for change (Comment added) made by infidel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=202435&aid=860173&group_id=2435 Category: None Group: None Status: Open Priority: 5 Submitted By: Marcelo Taube (marcelouy) Assigned to: Nobody/Anonymous (nobody) Summary: Complicated problem Initial Comment: Dear Sir, I'm facing a difficult situation while coding a program, and i really need your help. Sometimes my program behaves great, then i make a little change to the program and it starts doing strange things, so i change another little thing and it starts working great again. It seems to me that there is a bug hided too deep and that i can't find it. I'm starting to think that the bug is not in my code but in the standard C++ library but of course I'm not sure, I beg u help me I finnally got a version of my programm that instead of doing strange things it simply crashes. Analyzing what's happening i found that there is a string object that changes its value suddenly with no reason. I needed to trace the value of that string in the whole program to know the exact moment when it changes. So i created a class called TraceObjCaller that in whose constructor it writes to a file the value of that string. When i want to trace the value i build one object of that class. Using that technique i traced down the bug to the construction of a deque. As shown in the next piece of code i've placed a trace before an after the construction of the deque. ************************************** class msg_lnklist : public TraceObjCaller, public std::deque<mensaje> { private: TraceObjCaller toca; ************************************** during that construction the value of the string changes for no reason Here is the output (the trace file) ************************************** TraceName():228.255.255.255 TraceName():|Q= l= l= n= |Q= ************************************** The first time the string has its correct value(an ip address), the second time it seems to show random chars. From this evidence i suspect that in some conditions the deque class is modifying memory which doesn't belong to it. Could this be possible???? Thank you very much in advance for your help, Marcelo Taube PD: Some details: I'm using gcc version 3.2 (mingw special 20020817-1) (which comes with the last version of Dev-Cpp). ---------------------------------------------------------------------- >Comment By: Luke Dunstan (infidel) Date: 2003-12-15 19:43 Message: Logged In: YES user_id=30442 It is very unlikely that your problem is caused by a bug in libstdc++, but the only way for us to check is if you post a complete example program that demonstrates the problem. Ideally you should reduce the code as much as possible but it is not essential. You may use the file attachment feature on this bug tracker, or if it is too big then preferably you can make it available on the web and post a link here. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=202435&aid=860173&group_id=2435 |