<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Nullpointer in vmstat when exiting]]></title><description><![CDATA[<p dir="auto">Whenever I shutdown mango the vmstat daemon thread crashes with a nullpointer exception.  this isn't a big deal since I am shutting it down anyway, but it also happens when disabling the data source:</p>
<p dir="auto">stack:</p>
<pre><code>this	VMStatDataSourceRT  (id=189)	
	addedChangedPoints	ArrayList&lt;E&gt;  (id=200)	
		elementData	Object[10]  (id=233)	
		modCount	0	
		size	0	
	attributePositions	HashMap&lt;K,V&gt;  (id=210)	
		entrySet	HashMap$EntrySet  (id=309)	
		keySet	null	
		loadFactor	0.75	
		modCount	16	
		size	16	
		table	HashMap$Entry&lt;K,V&gt;[32]  (id=311)	
		threshold	24	
		values	null	
	dataPoints	ArrayList&lt;E&gt;  (id=214)	
		elementData	Object[10]  (id=308)	
		modCount	0	
		size	0	
	eventTypes	ArrayList&lt;E&gt;  (id=215)	
		elementData	Object[10]  (id=307)	
		modCount	2	
		size	2	
	in	BufferedReader  (id=216)	
		cb	 (id=303)	
		in	InputStreamReader  (id=305)	
		lock	InputStreamReader  (id=305)	
		markedChar	-1	
		markedSkipLF	false	
		nChars	78	
		nextChar	78	
		readAheadLimit	0	
		skipBuffer	null	
		skipLF	false	
	log	Log4JLogger  (id=221)	
		logger	Logger  (id=298)	
		name	"com.serotonin.mango.rt.dataSource.vmstat.VMStatDataSourceRT" (id=302)	
	pointListChangeLock	Boolean  (id=224)	
		value	false	
	removedPoints	ArrayList&lt;E&gt;  (id=227)	
		elementData	Object[10]  (id=297)	
		modCount	0	
		size	0	
	terminated	true	
	vmstatProcess	UNIXProcess  (id=194)	
		exitcode	143	
		hasExited	true	
		pid	18998	
		stderr_fd	FileDescriptor  (id=286)	
		stderr_stream	FileInputStream  (id=288)	
		stdin_fd	FileDescriptor  (id=291)	
		stdin_stream	BufferedOutputStream  (id=292)	
		stdout_fd	FileDescriptor  (id=312)	
		stdout_stream	BufferedInputStream  (id=313)	
	vo	VMStatDataSourceVO  (id=228)	
		alarmLevels	HashMap&lt;K,V&gt;  (id=274)	
		enabled	true	
		id	6	
		name	"vmstat" (id=282)	
		outputScale	2	
		pollSeconds	60	
		xid	"DS_742792" (id=285)	
	vo	VMStatDataSourceVO  (id=228)	
		alarmLevels	HashMap&lt;K,V&gt;  (id=274)	
			entrySet	HashMap$EntrySet  (id=275)	
			keySet	null	
			loadFactor	0.75	
			modCount	2	
			size	2	
			table	HashMap$Entry&lt;K,V&gt;[16]  (id=279)	
			threshold	12	
			values	null	
		enabled	true	
		id	6	
		name	"vmstat" (id=282)	
		outputScale	2	
		pollSeconds	60	
		xid	"DS_742792" (id=285)	
line	null	

</code></pre>
<p dir="auto">As you can see line is null. the nullpointer occurs at the readParts(line.split) line below, every time when I shut down.</p>
<pre><code> public void run() {
        try {
            while (true) {
                String line = in.readLine();
                readParts(line.split("\\s+"));
                readError();
            }
        }
</code></pre>
<p dir="auto">The appropriate fix isn't obvious to me.</p>
]]></description><link>https://forum.mango-os.com/topic/191/nullpointer-in-vmstat-when-exiting</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 23:27:38 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/191.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Sep 2009 21:36:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Nullpointer in vmstat when exiting on Mon, 21 Sep 2009 14:24:34 GMT]]></title><description><![CDATA[<p dir="auto">Hi Craig,</p>
<p dir="auto">I already have a fix for this in for the next version. I did this:</p>
<pre><code>
            while (true) {
                String line = in.readLine();
                
                if (line == null) {
                    if (terminated)
                        break;
                    else
                        throw new IOException("no data");
                }
                
                readParts(line.split("\\s+"));
                readError();
            }

</code></pre>
]]></description><link>https://forum.mango-os.com/post/2700</link><guid isPermaLink="true">https://forum.mango-os.com/post/2700</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Mon, 21 Sep 2009 14:24:34 GMT</pubDate></item></channel></rss>