aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 [2]

Author Topic: aMule web fails loading sometimes...  (Read 21817 times)

fidoboy

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
Re: aMule web fails loading sometimes...
« Reply #15 on: August 01, 2009, 07:00:38 PM »

Probably on Monday.
Hehe, our new running gag.  ;D
(I doubt "running gag" is actually English  now that I see it... It means perpetual joke.)

I really like to hear the list, 'cause amuleweb doesn't do a lot of things
- is a bitch to set up (you need two directories "default" and "php-default" with identical content, you have to enter settings in the remote.conf by hand). Of course, as a dev you have it set up and never notice.
- on Linux it always crashes for me (with LibPNG, having about 100 downloads). That was one reason I ported it to Windows, so I can start debugging it.
- there are some doubtful pieces of code in it, like CImageLib::AddImage, RemoveImage, GetImage
Quote
There are broken things in amule.
Just name them. (I don't doubt it, but that's not helpful.)

uses gzip even though the client didn't say that it supports gzip.
@fidoboy: You can always turn gzip compression off in the config for such cases.

Ok, i'll do my test turning gzip off and i'll report my results here... but i think that it has something to do with the use of frames...

regards,
« Last Edit: August 01, 2009, 10:34:21 PM by fidoboy »
Logged

lfroen

  • Guest
Re: aMule web fails loading sometimes...
« Reply #16 on: August 01, 2009, 08:29:51 PM »

Some notes for Stu:
Quote
is a bitch to set up
If default (should be set by package manager) doesn't work for you - too bad. That's called "advanced usage" and require some knowledge of shell.


Quote
on Linux it always crashes for me (with LibPNG, having about 100 downloads)
As you may guess, number "100" is not written anywhere in code.
Quote
That was one reason I ported it to Windows, so I can start debugging it.
Wrong idea. If it's crashed on Linux - you should be debugging it ... well ... on Linux. Maybe the problem is your specific Linux/libpng/libc etc.

Quote
doubtful pieces of code in it, like CImageLib::AddImage, RemoveImage, GetImage
That's mind-blowing statement. What's so "doubtful" about it?! One can easy guess, what AddImage() does. Hint: it have something to do with "adding image".

Quote
Just name them.
Offtopic. Point was, that if you looking to things to fix - amuleweb is not best place to start.

Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMule web fails loading sometimes...
« Reply #17 on: August 01, 2009, 10:11:30 PM »

That's called "advanced usage" and require some knowledge of shell.
Yeah, I deserved that.  :)

Quote
Quote
on Linux it always crashes for me (with LibPNG, having about 100 downloads)
As you may guess, number "100" is not written anywhere in code.
You know the meaning of "about" ?

Quote
Wrong idea. If it's crashed on Linux - you should be debugging it ... well ... on Linux. Maybe the problem is your specific Linux/libpng/libc etc.
We'll see that. I don't think the code is that platform dependent.

Quote
Quote
doubtful pieces of code in it, like CImageLib::AddImage, RemoveImage, GetImage
That's mind-blowing statement. What's so "doubtful" about it?! One can easy guess, what AddImage() does. Hint: it have something to do with "adding image".
Not the purpose is doubtful, just the implementation.
Code: [Select]
void CImageLib::AddImage(CAnyImage *img, const wxString &name)
{
CAnyImage *prev = m_image_map[name];
if ( prev ) {
delete prev;
}
m_image_map[name] = img;
}
Looks like someone should look up how std::map works:P

Quote
Offtopic.
So start a new thread. But don't call our project "broken" and then evade details.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

fidoboy

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
Re: aMule web fails loading sometimes...
« Reply #18 on: August 01, 2009, 10:37:48 PM »

Hey guys, c'mon, i've started this thread to talk about a problem/bug that i'm having with the amule webserver, it's not my intention to discuss about the quality of amule's code...

regards,  ;)
Logged

lfroen

  • Guest
Re: aMule web fails loading sometimes...
« Reply #19 on: August 01, 2009, 10:58:17 PM »

Not the purpose is doubtful, just the implementation.
Code: [Select]
void CImageLib::AddImage(CAnyImage *img, const wxString &name)
{
CAnyImage *prev = m_image_map[name];
if ( prev ) {
delete prev;
}
m_image_map[name] = img;
}
Looks like someone should look up how std::map works:P
Looks perfectly OK to me. std::map doesn't call delete on contained objects by itself, because it doesn't maintain reference count.
Someone should learn how std::* works before talking nonsense.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMule web fails loading sometimes...
« Reply #20 on: August 01, 2009, 11:10:51 PM »

This is not an ordinary forum. We like to talk straight and direct. And we occasionally disagree. (Some of us often.) Even bad language has been sighted here. No need to be concerned.  ;)

And its perfectly okay if a newbie moderates two moderators.  :D

Looks perfectly OK to me.
If m_image_map has no member with a key of name then m_image_map[name] creates one. The value is a pointer. Pointers have no ctor, so the pointer is random. If random is not zero, random is deleted.
If you're lucky, your runtime lib zeros allocated memory for new objects. Then it would work accidentally.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMule web fails loading sometimes...
« Reply #21 on: August 02, 2009, 12:48:02 AM »

Quote
Wrong idea. If it's crashed on Linux - you should be debugging it ... well ... on Linux. Maybe the problem is your specific Linux/libpng/libc etc.
We'll see that. I don't think the code is that platform dependent.
Debugged it on Windows and fixed it. Problem was a tiny download. There is special code for these which was broken.
(It wasn't built with libpng on Linux after all.)
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

lfroen

  • Guest
Re: aMule web fails loading sometimes...
« Reply #22 on: August 02, 2009, 06:52:35 PM »

Quote
If m_image_map has no member with a key of name then m_image_map[name] creates one. The value is a pointer. Pointers have no ctor, so the pointer is random.
Wrong. When value doesn't exists in map, default, not random value is inserted. http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01322.html

In case of pointer (or other built-in integral type) this value is 0.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMule web fails loading sometimes...
« Reply #23 on: August 02, 2009, 10:17:32 PM »

As I said, you got lucky. But you should be able to tell if code is working without reviewing the library. And what about other platforms than gcc ?
Fixed in 9744.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: aMule web fails loading sometimes...
« Reply #24 on: August 02, 2009, 11:12:55 PM »

you should be able to tell if code is working without reviewing the library. And what about other platforms than gcc ?

The C++ standard requires this behaviour.
Logged
concordia cum veritate

fidoboy

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
Re: aMule web fails loading sometimes...
« Reply #25 on: August 03, 2009, 01:07:36 AM »

This is amazing, i've came here looking for an answer to my problem and now i'm in the middle of... nowhere! Well, i hope that you can solve that bug soon... amule webserver is really useful.

keep up the good work!  ;)
Logged

lfroen

  • Guest
Re: aMule web fails loading sometimes...
« Reply #26 on: August 03, 2009, 06:00:40 AM »

As I said, you got lucky. But you should be able to tell if code is working without reviewing the library.
As you already saw, I am able to tell. You can't. Like I said before - that's bloody c++ standard, which have nothing to do with gcc/platform or whatever else. So, please leave it as is.

Any other "questionable" code you see?
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMule web fails loading sometimes...
« Reply #27 on: August 03, 2009, 10:46:23 PM »

So, please leave it as is.
Too late.

Quote
Any other "questionable" code you see?
How about
Code: [Select]
void CImageLib::RemoveImage(const wxString &name)
{
CAnyImage *prev = m_image_map[name];
if ( prev ) {
m_image_map.erase(name);
}
}
If the key is in the map it removes the map entry, but does not delete the data pointed to.
If the key is not in the map it leaves a new entry with a Null pointer.
(fixed)
And then there is the code that still causes it to crash. Haven't tracked it down yet, must first enable libPNG for win.

This is amazing, i've came here looking for an answer to my problem and now i'm in the middle of... nowhere!
Sorry. We usually don't misbehave in users' threads.
About your initial problem: I've noticed it too, yeah. But I've not got so far as to start analyzing it. Is your webserver linked with libPNG ? I think it might be related (occurring in builds without libPNG). Lfroen could probably fix it in a minute if he bothered to climb down from his higher spheres.  :)
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

lfroen

  • Guest
Re: aMule web fails loading sometimes...
« Reply #28 on: August 04, 2009, 07:28:13 PM »

Quote
Lfroen could probably fix it in a minute if he bothered to climb down from his higher spheres
Here, on Earth those "spheres" called "growing family". Dictionary is your friend at this point.

Quote
If the key is in the map it removes the map entry, but does not delete the data pointed to.
If the key is not in the map it leaves a new entry with a Null pointer.
Technically speaking, you're correct. Second case should not happen, however - how do you remove image that you didn't inserted earlier?
The only reason why image is being removed is file removal from download queue. And since you can't remove something which is not there, it should not happen.
If it indeed happen - there's another problem elsewhere.
Logged
Pages: 1 [2]