<?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>Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95100/understanding-a-fatal-error-in-my-application</link><description>My application is pretty consistently encountering a fatal error. The output from the SWD debug: 
 
 
 Following the advice of another post on Devzone, I set `CONFIG_RESET_ON_FATAL_ERROR=n` and used the Run and Debug extension in VSCode. Sure enough,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Dec 2022 08:51:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95100/understanding-a-fatal-error-in-my-application" /><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/402369?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2022 08:51:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a4868f6-53b4-4de6-85e6-cc8757ff4907</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;The map file can often be a useful debugging tool with issues like these. It is simply called zephyr.map, and can be found next to zephyr.hex in the build folder.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/402341?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2022 03:55:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c576e7ea-4a3e-46a3-b15f-b8e5fdcefb2c</guid><dc:creator>nategreco</dc:creator><description>&lt;p&gt;That was my thinking, but I didn&amp;#39;t consider looking at the map file to see what would have been overwritten.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/402221?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2022 09:21:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4ab1ec2-9c01-4767-afce-ec35b840fc4d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Nathan&lt;/p&gt;
&lt;p&gt;Is it possible that the buffer overrun started writing into&amp;nbsp;some of the variables used by the LVGL library?&lt;/p&gt;
&lt;p&gt;If you look at the map file you should see which variables come after the one that was overrun, which might explain why it failed like it did.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Either way, good to hear you were able to find the root cause.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/402026?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 02:31:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:907e92f6-2107-4a16-92b1-7fae980c25b9</guid><dc:creator>nategreco</dc:creator><description>&lt;p&gt;It indeed turned out to be buffer overrun, but I don&amp;#39;t see why the fault happened in the LVGL library.&amp;nbsp; I&amp;#39;m thinking an area of memory must have been overwritten that was later used by the LVGL library.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/402025?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 02:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d676eeba-46d6-4aff-8d8e-ce09ca3f8b06</guid><dc:creator>nategreco</dc:creator><description>&lt;p&gt;Just an update - I did find a buffer be buffer overrun in a write characteristic callback.&amp;nbsp; In no way was it related to LVGL, so I&amp;#39;m&amp;nbsp;still at a loss with that call stack and why the error was thrown in lv_gc.c?&lt;/p&gt;
&lt;p&gt;I will close this ticket now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/401924?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 12:46:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a32f079-2cc1-4cbe-b994-12910b69ef82</guid><dc:creator>nategreco</dc:creator><description>&lt;p&gt;Dissassembly just has a `??` for&amp;nbsp;&lt;span&gt;0x0003fda5, which I guess makes sense given the instruction address is invalid.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I think the issue might be buffer overrun, I&amp;#39;m going to poke more and share my code if I&amp;#39;m stuck.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/401923?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 12:45:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51f904f4-11ff-4344-af59-796a511f667b</guid><dc:creator>nategreco</dc:creator><description>&lt;p&gt;Thanks - I am using LVGL and Bluetooth, but there are no calls to the LVGL library outside of my main thread, so the fact that a Bluetooth RX thread throws an invalid exception on that line does not make any sense.&lt;/p&gt;
&lt;p&gt;The issue is definitely in&amp;nbsp;my control point write callback for my FTMS implementation.&amp;nbsp; I think I&amp;#39;m mishandling the copying of the param structure to the response (indication per the standard).&amp;nbsp; I&amp;#39;m going to try process of elimination to isolate the offending line.&amp;nbsp; If I get stuck I&amp;#39;ll share my code (it&amp;#39;s a bit messy, I don&amp;#39;t want to burden someone else reviewing it until I can isolate it better).&lt;/p&gt;
&lt;p&gt;I think at the end of it where I&amp;#39;ll probably want some clarity is why the debugger was so unhelpful.&amp;nbsp; Seems like maybe it thinks it executing a section of code it shouldn&amp;#39;t be?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/401878?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 10:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a062f87e-2767-49c5-8524-b4c28df2fc44</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;My guess would be a null pointer issue, caused by a memset call in lv_gc.c (line 42).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the BT_RX thread is the culprit I assume you are calling some LVGL functions from a Bluetooth callback in your code?&lt;/p&gt;
&lt;p&gt;Possibly you are passing an invalid pointer to one of these functions?&lt;/p&gt;
&lt;p&gt;In general calling various libraries from callbacks directly can be risky, since callbacks are often running in interrupt context, and it is limited what you can do from interrupts directly. I noticed this myself in the context of trying to combine LVGL and Bluetooth. But in this particular case the issue seems more pointer related.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are unable to figure it out, would you be able to share your code?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding a FATAL ERROR in my application</title><link>https://devzone.nordicsemi.com/thread/401827?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 04:30:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b79e8d27-7ae4-4f08-be16-7013c348e4a1</guid><dc:creator>mytzyiay</dc:creator><description>&lt;p&gt;If I had to guess, I&amp;#39;d say the fault is happening because r15/pc doesn&amp;#39;t actually point to instruction memory.&amp;nbsp; Possibly, it was restored from a corrupted stack or thread context struct, or&amp;nbsp;the code jumped to a corrupt function pointer.&lt;/p&gt;
&lt;p&gt;What is the code around r14/lr,&amp;nbsp;0x0003fda5?&lt;/p&gt;
&lt;p&gt;Any possibility of a use-after-free or buffer overrun in the application code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>