<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>crashes after 15 hours publishing messages with mqtt helper</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117286/crashes-after-15-hours-publishing-messages-with-mqtt-helper</link><description>Hi, 
 I am testing an actinius_icarus board V2. 
 I read data from senso BM68X every 500 ms, and publish on mqtt broker every 1 seconds. they are 256 bytes every sending. 
 After 15 hours or so the system crashes. Already two times and almost after the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Dec 2024 08:54:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117286/crashes-after-15-hours-publishing-messages-with-mqtt-helper" /><item><title>RE: crashes after 15 hours publishing messages with mqtt helper</title><link>https://devzone.nordicsemi.com/thread/515048?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 08:54:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbd8a17c-8fb2-4f3c-a7c2-76cf8edbc308</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;I studied a little bit addr2line. I got some problem to understand (((.&lt;/p&gt;
&lt;p&gt;Anyway you intuition was perfect as I doubled the stack size of thread processing mqtt publish and subscribe and I had more than one day working without crash.&lt;/p&gt;
&lt;p&gt;I think that was the problem. Anyway I should add a name to thread and link button to a kernel panic error to practice on addr2line tool.&lt;/p&gt;
&lt;p&gt;I think ticket can be closed.&lt;/p&gt;
&lt;p&gt;Best regards.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: crashes after 15 hours publishing messages with mqtt helper</title><link>https://devzone.nordicsemi.com/thread/515039?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 08:28:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f7d1095-6295-4713-b627-730c7d6faac2</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which thread was the faulting one(s)?&lt;/p&gt;
&lt;p&gt;Did you check the assert output (SP and LR content) and use addr2line / checked the zephyr.map file?&lt;/p&gt;
[quote user="hkn"]&lt;p&gt;Have you tried to use addr2line to backtrace where the fault was called from? And what thread(s) are in-use (search for current thread address in the zephyr.map file) ?&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a howto on addr2line usage:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/exercise-2-11/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/exercise-2-11/&lt;/a&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: crashes after 15 hours publishing messages with mqtt helper</title><link>https://devzone.nordicsemi.com/thread/514963?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2024 20:24:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daaf8a2a-bfe0-42a4-b124-a0fd44893ec8</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Unfortunately I was not able to debug. I did not enable in prj file. But I will do. Anyway your suggestion about stack overflow is helping a lot.&lt;/p&gt;
&lt;p&gt;Best.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: crashes after 15 hours publishing messages with mqtt helper</title><link>https://devzone.nordicsemi.com/thread/514888?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2024 12:48:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acfa2606-11cd-43a8-8574-0eefa00fb47a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]ASSERTION FAIL [ret == 0] @ WEST_TOPDIR/zephyr/subsys/net/lib/mqtt/mqtt_os.h:61&lt;br /&gt; sys_mutex_unlock failed with -22[/quote]
&lt;p&gt;errno 22 is EINVAL, and the docs for the mutex unlock function states:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.7.99-ncs1/include/zephyr/sys/mutex.h#L108-L124"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.7.99-ncs1/include/zephyr/sys/mutex.h#L108-L124&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;* @retval -EINVAL Provided mutex not recognized by the kernel or mutex wasn&amp;#39;t&lt;br /&gt; * locked&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This indicates that the pointer going into the function is somehow corrupted, usually due to a stack overflow or similar. The thread its being called from seems to differ between the two logs:&lt;/p&gt;
[quote user=""][13:55:55.165,130] &amp;lt;err&amp;gt; os: r0/a1: 0x00000004 r1/a2: 0x0000003d r2/a3: 0x00000004&lt;br /&gt;[13:55:55.165,130] &amp;lt;err&amp;gt; os: r3/a4: 0x00000004 r12/ip: 0x0000000c r14/lr: 0x00021397&lt;br /&gt;[13:55:55.165,161] &amp;lt;err&amp;gt; os: xpsr: 0x01000000&lt;br /&gt;[13:55:55.165,161] &amp;lt;err&amp;gt; os: s[ 0]: 0x20011c78 s[ 1]: 0x0003bb85 s[ 2]: 0x00000000 s[ 3]: 0x20011c78&lt;br /&gt;[13:55:55.165,191] &amp;lt;err&amp;gt; os: s[ 4]: 0x20012838 s[ 5]: 0x00027cbf s[ 6]: 0x00000000 s[ 7]: 0x00000000&lt;br /&gt;[13:55:55.165,222] &amp;lt;err&amp;gt; os: s[ 8]: 0x00000000 s[ 9]: 0x00000001 s[10]: 0x20017818 s[11]: 0x0001365f&lt;br /&gt;[13:55:55.165,252] &amp;lt;err&amp;gt; os: s[12]: 0x00000000 s[13]: 0x0001365f s[14]: 0x20017828 s[15]: 0x0001366f&lt;br /&gt;[13:55:55.165,283] &amp;lt;err&amp;gt; os: fpscr: 0x2000f1c8&lt;br /&gt;[13:55:55.165,283] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x000359ec&lt;br /&gt;[13:55:55.165,313] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0&lt;br /&gt;[13:55:55.165,344] &amp;lt;err&amp;gt; os: Current thread: 0x2000f1c8 (unknown)[/quote]
&lt;p&gt;&lt;/p&gt;
[quote user=""][12:01:59.972,900] &amp;lt;err&amp;gt; os: r0/a1: 0x00000004 r1/a2: 0x0000003d r2/a3: 0x00000003&lt;br /&gt;[12:01:59.972,930] &amp;lt;err&amp;gt; os: r3/a4: 0x00000004 r12/ip: 0x0000000c r14/lr: 0x0002136b&lt;br /&gt;[12:01:59.972,930] &amp;lt;err&amp;gt; os: xpsr: 0x01000000&lt;br /&gt;[12:01:59.972,961] &amp;lt;err&amp;gt; os: s[ 0]: 0x20011d1c s[ 1]: 0x0003ba05 s[ 2]: 0x00000000 s[ 3]: 0x20011d1c&lt;br /&gt;[12:01:59.972,991] &amp;lt;err&amp;gt; os: s[ 4]: 0x200128cc s[ 5]: 0x00027cbf s[ 6]: 0x00000000 s[ 7]: 0x00000000&lt;br /&gt;[12:01:59.972,991] &amp;lt;err&amp;gt; os: s[ 8]: 0x00000000 s[ 9]: 0x00000001 s[10]: 0x20017c8c s[11]: 0x00013633&lt;br /&gt;[12:01:59.973,022] &amp;lt;err&amp;gt; os: s[12]: 0x00000000 s[13]: 0x00013633 s[14]: 0x001de893 s[15]: 0x00000000&lt;br /&gt;[12:01:59.973,052] &amp;lt;err&amp;gt; os: fpscr: 0x20017cb0&lt;br /&gt;[12:01:59.973,052] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0003586c&lt;br /&gt;[12:02:45.467,498] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0&lt;br /&gt;[12:02:52.951,721] &amp;lt;err&amp;gt; os: Current thread: 0x2000f278 (unknown)[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried to use addr2line to backtrace where the fault was called from? And what thread(s) are in-use (search for current thread address in the zephyr.map file) ?&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a howto on addr2line usage:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/exercise-2-11/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/exercise-2-11/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>