From: Tracker i. u. n. <pup...@li...> - 2007-04-13 16:59:44
|
Bugs item #1652827, was opened at 2007-02-05 22:52 Message generated for change (Comment added) made by mroberto You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=841026&aid=1652827&group_id=166957 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: upnp Group: v1.4.2 Status: Open Resolution: Works For Me Priority: 5 Private: No Submitted By: Michael Andersen (miwer) Assigned to: Marcelo Roberto Jimenez (mroberto) Summary: UpnpRegisterRootDevice returned -104 Initial Comment: When I run upnpd I get the above mentioned error (UPNP_E_OUTOF_MEMORY). I've tried with 1.4.1 and 1.4.2-RC3, it's the same. I don't understand why, because I have plenty of RAM, and I even tried closing some applications, but it didn't help. $ upnpd eth1 br0 The following is logged in the /var/log/messages: Feb 6 01:33:47 server upnpd[6933]: Error registering the root device with descDocUrl: http://192.168.0.1:49152/gatedesc.xml Feb 6 01:33:47 server upnpd[6933]: UpnpRegisterRootDevice returned -104 I tried enabling debugging and it looks like it cannot allocate memory through the membuffer_append function. It's wierd because it's only a few bytes. Please note, that I enabled some extra debugging lines that were commented, in order to get more information. See attached files. ---------------------------------------------------------------------- >Comment By: Marcelo Roberto Jimenez (mroberto) Date: 2007-04-13 13:59 Message: Logged In: YES user_id=67568 Originator: NO Hi Emil, Thank you very much for your help. I have looked at your patch, and it seems ok. I will attach it to the bug tracker. You are certainly right about the other assignments that need to be fixed. I will take a look at it before the new release and later when I get home I will apply your patch asap. If I can't find other assignments to be fixed I will do a new release with that bug fix. Thanks again! Regards, Marcelo. File Added: amd64fix.patch ---------------------------------------------------------------------- Comment By: Emil Ljungdahl (svenstorp) Date: 2007-04-13 12:41 Message: Logged In: YES user_id=1768744 Originator: NO This patch seems to fix the previous problems. On amd64 size_t and int got different size, which seems to have caused the problem. There is probably a lot of assignments to those changed structs that needs to fixed. See patch at http://www.kratern.se/~emil/libupnp/amd64fix.patch ---------------------------------------------------------------------- Comment By: Emil Ljungdahl (svenstorp) Date: 2007-04-13 11:32 Message: Logged In: YES user_id=1768744 Originator: NO I still get the "UpnpRegisterRootDevice returned -104"-error with 1.4.3 release (on a Gentoo amd64). However I nailed it down to some conversions between size_t and int's (see the attachment). Just as miwer, upnpd now stops at "Could not parse description document. Exiting ...". BUT! Here comes the funny part: when I compile with debug option (configure with --enable-debug) it works like a charm. What!? /Emil ---------------------------------------------------------------------- Comment By: Bjarke Istrup Pedersen (gurligebis) Date: 2007-03-31 18:40 Message: Logged In: YES user_id=382090 Originator: NO I'm the maintainer for linux-igd and libupnp on Gentoo Linux. I have a few reports on this problem too, the problem still exists with libupnp 1.4.3 and linux-igd 1.0 :-( ---------------------------------------------------------------------- Comment By: Michael Andersen (miwer) Date: 2007-02-28 18:22 Message: Logged In: YES user_id=504071 Originator: YES Hi Marcelo, I haven't had the time to follow up on this case. Sorry about that. I still get the out of memory error, allthough now it appears later in the startup process. It is still the realloc() call in the membuffer_set_size function that fails on my system. This call however, does succeed a number of times before it finally fails. Any ideas? The message in syslog is now this: Feb 28 21:57:55 server upnpd[23821]: UPnP SDK Successfully Initialized. Feb 28 21:57:55 server upnpd[23821]: Succesfully set the Web Server Root Directory. Feb 28 21:57:55 server upnpd[23821]: IGD root device successfully registered. Feb 28 21:57:55 server upnpd[23821]: Could not parse description document. Exiting ... I have upgraded to the 1.4.2 release, and I am trying the new linux-igd 1.0 (I also tried the 0.95, it's the same error) I have uploaded a new debug logfile, with my custom debug output from membuffer_set_size and such. (IUpnpInfoFile-20070228.txt) Best regards, Michael File Added: IUpnpInfoFile-20070228.txt ---------------------------------------------------------------------- Comment By: SourceForge Robot (sf-robot) Date: 2007-02-27 00:20 Message: Logged In: YES user_id=1312539 Originator: NO This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker). ---------------------------------------------------------------------- Comment By: Marcelo Roberto Jimenez (mroberto) Date: 2007-02-09 19:11 Message: Logged In: YES user_id=67568 Originator: NO Hi Michael, I had access to a 64 bit machine, and indeed there were issues on this platform. I just did a quick compile fix to libupnp, but I did not test upnpd before the fix. After the fix, it behaves ok, as it does on 32 bits. Please, test it with RC4, which is already available and contains the 64 bits fixes. Regards, Marcelo. ---------------------------------------------------------------------- Comment By: Michael Andersen (miwer) Date: 2007-02-08 19:44 Message: Logged In: YES user_id=504071 Originator: YES Hi Marcelo, I'm on Gentoo, linux-igd-0.95, and everything is installed as root, and upnpd is run as root, so it's not a permission issue I think. I've tested some more... it seems that in membuffer.c the function membuffer_set_size fails when calling realloc in line 230 to allocate more memory. I don't know why though, it works the first couple of times, and then suddenly fails. I have updated the IUpnpInfoFile.txt file with some more debugging info. You say it works for you, are you on amd64? If not, could this be the problem? /Michael File Added: IUpnpInfoFile.txt ---------------------------------------------------------------------- Comment By: Marcelo Roberto Jimenez (mroberto) Date: 2007-02-08 01:06 Message: Logged In: YES user_id=67568 Originator: NO Michael, I am on Suse 10.2 here. I got linuxigd-0.95 from the source forge site and have followe the instructions in the file INSTALL, which are in my case: $ svn co https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk pupnp $ cd pupnp $ ./configure --enable-debug --prefix=/home/myuser/usr/local/libupnp && make && make install $ cd .. $ tar zxvf linuxigd-0.95.tar.gz $ cd linuxigd-0.95 $ make LIBUPNP_PREFIX=/home/myuser/usr/local/libupnp $ su # make install install -d /etc/linuxigd install etc/gatedesc.xml /etc/linuxigd install etc/gateconnSCPD.xml /etc/linuxigd install etc/gateicfgSCPD.xml /etc/linuxigd install etc/dummy.xml /etc/linuxigd install upnpd /usr/sbin install upnpd.8 /usr/share/man/man8 if [ ! -f /etc/upnpd.conf ]; then install etc/upnpd.conf /etc; fi After that, I run upnpd and terminate it some time later with a <CTRL-C>: # LD_LIBRARY_PATH=/home/myuser/usr/local/libupnp/lib/ ./upnpd -f eth0 dsl0 upnpd[19783]: UPnP SDK Successfully Initialized. upnpd[19783]: Succesfully set the Web Server Root Directory. upnpd[19783]: IGD root device successfully registered. upnpd[19783]: Advertisements Sent. Listening for requests ... upnpd[19783]: Shutting down on signal 2... upnpd[19783]: DeleteAllPortMappings: UpnpNotifyExt(deviceHandle,uuid:75802409-bccb-40e7-8e6c-fa095ecce13e,urn:upnp-org:serviceId:WANIPConn1,propSet) PortMappingNumberOfEntries: 0 In other words, it works for me. Please, check your installation procedure and report back. Notice that it is necessary to run make install on linuxigd-0.95 as root, otherwise the files will not be copied to the /etc directory. Also, upnpd must be run as root. Regards, Marcelo. ---------------------------------------------------------------------- Comment By: Marcelo Roberto Jimenez (mroberto) Date: 2007-02-07 11:24 Message: Logged In: YES user_id=67568 Originator: NO Hi Michael, What is the version of linuxigd that you are using? ---------------------------------------------------------------------- Comment By: Michael Andersen (miwer) Date: 2007-02-05 22:55 Message: Logged In: YES user_id=504071 Originator: YES I forgot to mention, that I'm running kernel 2.6.18 and amd64 ---------------------------------------------------------------------- Comment By: Michael Andersen (miwer) Date: 2007-02-05 22:53 Message: Logged In: YES user_id=504071 Originator: YES File Added: IUpnpErrFile.txt ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=841026&aid=1652827&group_id=166957 |