aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: CVS is broken for me  (Read 2321 times)

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
CVS is broken for me
« on: August 10, 2007, 08:01:49 AM »

Hi folks,

I am not sure when that started but aMule is broken for me, it crashes upon startup with an assertion:

Code: [Select]
(gdb) bt
#0  0xb7f81410 in ?? ()
#1  0xbfe10e68 in ?? ()
#2  0x00000005 in ?? ()
#3  0xb7708024 in wxTrap () at ./src/common/appbase.cpp:672
#4  0xb7a0f342 in wxGUIAppTraits::ShowAssertDialog (this=0x88c69b0, msg=@0xbfe10f0c) at ./src/gtk/utilsgtk.cpp:403
#5  0xb770821c in ShowAssertDialog (szFile=0xb77de3b8, nLine=446, szFunc=0x88e1764, szCond=0xb77df94c, szMsg=0xb77dfa28,
    traits=0x88c69b0) at ./src/common/appbase.cpp:839
#6  0xb7708442 in wxAppConsole::OnAssertFailure (this=0x88a2a48, file=0xb77de3b8, line=446, func=0x88e1764, cond=0xb77df94c,
    msg=0xb77dfa28) at ./src/common/appbase.cpp:443
#7  0xb79dec53 in wxApp::OnAssertFailure (this=0x88a2a48, file=0xb77de3b8, line=446, func=0x88e1764, cond=0xb77df94c,
    msg=0xb77dfa28) at ./src/gtk/app.cpp:552
#8  0xb770833d in wxOnAssert (szFile=0xb77de3b8, nLine=446, szFunc=0xb77dfe15 "Found", szCond=0xb77df94c, szMsg=0xb77dfa28)
    at ./src/common/appbase.cpp:712
#9  0xb770e66e in wxCmdLineParser::Found (this=0xbfe111b4, name=@0xbfe1124c) at ./src/common/cmdline.cpp:446
#10 0x08080df0 in CamuleApp::OnInit (this=0x88a2a48) at amule.cpp:494
#11 0x0822c151 in CamuleGuiApp::OnInit (this=0x88a2a48) at amule-gui.cpp:262
#12 0x08084d3a in wxAppConsole::CallOnInit (this=0x88a2a48)
    at /home/mroberto/usr/local/wxWidgets-2.8.4/include/wx-2.8/wx/app.h:76
#13 0xb774fe66 in wxEntry (argc=@0xb785c4ec, argv=0x88912a8) at ./src/common/init.cpp:433
#14 0xb774ff5f in wxEntry (argc=@0xbfe11480, argv=0xbfe11504) at ./src/common/init.cpp:461
#15 0x0822cd3c in main (argc=Cannot access memory at address 0x3e91
) at amule-gui.cpp:95
(gdb) f 9
#9  0xb770e66e in wxCmdLineParser::Found (this=0xbfe111b4, name=@0xbfe1124c) at ./src/common/cmdline.cpp:446
446         wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown switch") );
(gdb) l
441     {
442         int i = m_data->FindOption(name);
443         if ( i == wxNOT_FOUND )
444             i = m_data->FindOptionByLongName(name);
445
446         wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown switch") );
447
448         wxCmdLineOption& opt = m_data->m_options[(size_t)i];
449         if ( !opt.HasValue() )
450             return false;
(gdb) p i
$1 = -1

I don't have the time to look into it, but maybe you know something related to any recent svn change.

Cheers!
« Last Edit: August 10, 2007, 08:11:18 AM by phoenix »
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: CVS is broken for me
« Reply #1 on: August 10, 2007, 09:46:07 AM »

Hi phoenix,

Quote
#15 0x0822cd3c in main (argc=Cannot access memory at address 0x3e91) at amule-gui.cpp:95
This looks like a different problem.

There's the IMPLEMENT_APP macro at this line in amuleDlg.cpp and all following - command line option related - problems are caused by this access failure.
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: CVS is broken for me
« Reply #2 on: August 11, 2007, 07:02:38 PM »

Hi wuischke,

I don't understand what you mean, but this is plain vanilla SVN code, I have not touched it.

The access problem is probably gdb getting confused. Otherwise there would have been a segfault, not an assertion from wx code.

Ok, I decided to have a break from real life affairs and hack a bit into aMule code for a change :)

This is the guilty one:
[aMule] [7361] A[amuled] Add option to enable EC and set pass

You see, the line in the code that caused the assertion was (in amule.cpp:494):
Code: [Select]
bool ec_config = cmdline.Found(wxT("ec-config"));
Do command line options need to be translated? Anyway, the problem is that this option can only exist when the corresponding line (amule.cpp:449):
Code: [Select]
cmdline.AddSwitch(wxT("e"), wxT("ec-config"), wxT("Configure EC (External Connections)."));
exists too. Currently,  the last line is #ifdef AMULE_DAEMON, so it won't exist in the command line dictionary. I leave the fix up to you, for I really don't have the time to ananlyse it with the necessary care and you probably have things fresh in your mind, but either you #ifdef the cmdlineFound() for "ec-config", or you "un#ifdef" the AddSwitch line.

Cheers!
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: CVS is broken for me
« Reply #3 on: August 11, 2007, 07:12:33 PM »

Nevermind what I said, I looked at the wrong file and by chance there was something which lead me to a wrong conclusion. (wx bug)

Thanks a lot for pointing this out, I'll figure something out and fix this with my next commit.

Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: CVS is broken for me
« Reply #4 on: August 11, 2007, 07:42:56 PM »

BTW, sorry for not beeing so helpfull lately, I am really looking forward to have some time to help you back.

I have started to change the OScope code, but up to the moment, only cosmetic changes to prepare, maybe it is not even worth committing.

BTW2, you are doing a great job!

Cheers!
Logged