<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 27, 2015 at 5:53 AM, Charles Lepple <span dir="ltr"><<a href="mailto:clepple@gmail.com" target="_blank">clepple@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="">On Jan 24, 2015, at 12:45 AM, Ryan Sizemore <<a href="mailto:ryan.sizemore@gmail.com" target="_blank">ryan.sizemore@gmail.com</a>> wrote:<br></span><div><span class=""><br><blockquote type="cite"><div dir="ltr">Hello,<div><br></div><div>I am trying to get nut running on a Windows 2012 R2 server (x64). I am using the MSI release of 2.6.5-3.</div></div></blockquote><div><br></div></span><div>I am not sure why they are not listed on the main download page, but there are actually three Windows MSI releases after that:</div><div><br></div><div><a href="http://www.networkupstools.org/package/windows/" target="_blank">http://www.networkupstools.org/package/windows/</a></div></div></div></blockquote><div><br></div><div>I see.  I will try an updated build.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><br></div><div>I mention this because there is a memory allocation fix that was released after your version:</div><div><br></div><div><a href="https://github.com/networkupstools/nut/commit/a07ff33854bd128115f1d63929f390c982ff410b" target="_blank">https://github.com/networkupstools/nut/commit/a07ff33854bd128115f1d63929f390c982ff410b</a></div><div><br></div><div>although I suspect it might not be related.</div></div></div></blockquote><div><br></div><div>The filter_path function looks to be only used for argument parsing, so yes, it probably isn't related to the issue I am seeing.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><br></div><div>That being said, the Windows port has not been maintained for a year or two. (This was being developed by Eaton employees, but Eaton is no longer supporting the NUT project.)</div><span class=""><br><blockquote type="cite"><div dir="ltr"><div> The attached UPS is an APC xs1500 (model bx1500g). The connection is an RJ45 to USB cable.</div><div><br></div><div>Here is my ups.conf:</div><div><div>[xs1500]</div><div><span style="white-space:pre-wrap">    </span>driver = usbhid-ups</div><div><span style="white-space:pre-wrap">      </span>port = auto</div><div><span style="white-space:pre-wrap">      </span>desc = "APC Back-UPS xs1500"</div></div><div><br></div><div>The problem I am encountering is upsd crashing with an 'Out of memory' error. I can start usbhid-ups.exe and it will correctly dump variables from the UPS, so communication with the UPS itself seems to work. However, when I try to run 'upsc xs1500', I get the following output from upsd (running with debugging output):</div><div><br></div><div><div>C:\Program Files (x86)\NUT\sbin>upsd -DDDDD</div><div>Network UPS Tools upsd 2.6.5-3723:3731M</div><div>   0.000000     listen_add: added ::1:3493</div><div>   0.000000     listen_add: added <a href="http://127.0.0.1:3493/" target="_blank">127.0.0.1:3493</a></div><div>   0.015628     setuptcp: try to bind to 127.0.0.1 port 3493</div><div>   0.031310     listening on 127.0.0.1 port 3493</div><div>   0.031310     setuptcp: try to bind to ::1 port 3493</div><div>   0.031310     listening on ::1 port 3493</div><div>   0.031310     Connected to UPS [xs1500]: usbhid-ups-xs1500</div><div>   0.046874     mainloop: wait for 4 filedescriptors</div><div>  <snip></div><div>  33.390678     mainloop: no data available</div><div>  33.390678     Pinging UPS [xs1500]</div><div>  33.390678     mainloop: wait for 4 filedescriptors</div><div>  33.406254     Got PONG from UPS [xs1500]</div><div>  33.406254     mainloop: wait for 4 filedescriptors</div><div>  34.749994     Out of memory</div></div></div></blockquote></span><div dir="ltr"><div><br></div><div>Is there any way for you to put a breakpoint in upsd.c:mainloop(), and step forward to see what is triggering the "Out of memory" error?</div></div></div></div></blockquote><div><br></div><div>I will see if I can get this running under a debugger, though I imagine I will need to get it building on my on machine first.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div dir="ltr"><div><br></div></div><span class=""><blockquote type="cite"><div dir="ltr"><div>upsc only shows a generic error:</div><div><br></div><div><div>C:\Program Files (x86)\NUT\bin>upsc xs1500</div><div>Error: Write error: Unknown error</div></div></div></blockquote></span><div dir="ltr"><div><br></div><div>After upsd dies, nothing is listening on the socket, so there won't be any descriptive error messages from upsc. However, I was hoping for something along the lines of "Connection refused" :-/</div><div><br></div></div><div><div class="h5"><blockquote type="cite"><div dir="ltr"><div>However, usbhid-upd.exe displays the following:</div><div><br></div><div><div>C:\Program Files (x86)\NUT\bin>usbhid-ups.exe -a xs1500 -DD</div><div>Network UPS Tools - Generic HID driver 0.37 (2.6.5-3723:3731M)</div><div>USB communication driver 0.31</div><div>   0.000000     debug level is '2'</div><div>   0.000000     upsdrv_initups...</div><div>   0.000000     Checking device (051D/0002) (bus-0/\\.\libusb0-0001--0x051d-0x0002)</div><div>   0.015628     - VendorID: 051d</div><div>   0.015628     - ProductID: 0002</div><div>   0.031251     - Manufacturer: American Power Conversion</div><div>   0.031251     - Product: Back-UPS BX1500G FW:866.L5 .D USB FW:L5</div><div>   0.031251     - Serial Number: 3B1045X04728</div><div>   0.046933     - Bus: bus-0</div><div>   0.046933     Trying to match device</div><div>   0.062500     Device matches</div><div>   0.091516     HID descriptor length 1133</div><div>   0.092016     Report Descriptor size = 1133</div><div>   0.107654     Using subdriver: APC HID 0.95</div></div><div><snip></div><div><div>  32.094517     upsdrv_updateinfo...</div><div>  32.094517     Got 3 HID objects...</div><div>  32.110104     Quick update...</div><div>  32.813233     Read error : 109</div><div>  34.094483     upsdrv_updateinfo...</div><div>  34.110249     Got 2 HID objects...</div><div>  34.141355     Full update...</div></div><div><br></div><div>I'm not sure if the 'Read error' is indicative of anything, but it occurs exactly when upsd crashes with the 'Out of memory' error.</div></div></blockquote><br></div></div></div><div>Does the driver keep going after that?</div><div><br></div></div></blockquote><div><br></div><div>Yes, the driver keeps running. It prints out "Read error : 109", which I am guessing is the value of errno that is set after calling select() on line 560 of upsclient.c. I could be wrong though.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>This is a bit of a shot in the dark (especially because your ProductID of 0002 is one of the less-broken ones) but do you still get the read error if you add the "pollonly" option to the UPS-specific part of ups.conf (i.e. after [xs1500])?</div></div></blockquote><div><br></div><div>Sadly, no, that doesn't seem to improve the outcome. If feels like upsd fails during a malloc or something similar resulting from the read failure in the driver. If I can get the sources building on my on computer, I will try to debug and see where the exact point of failure is at.</div><div><br></div><div>Thanks for all the help.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><br><div>
<span style="border-collapse:separate;border-spacing:0px"><div>-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div></span><br>

</div>
<br></font></span></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ryan Sizemore</div>
</div></div>