<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>unexpected segmentation fault changing pc register with branch</title><link>https://community.arm.com/developer/tools-software/tools/f/armds-forum/1154/unexpected-segmentation-fault-changing-pc-register-with-branch</link><description> </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: unexpected segmentation fault changing pc register with branch</title><link>https://community.arm.com/thread/3589?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 11:09:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0c051c7d-1b2b-48cb-9921-72b50d541df8</guid><dc:creator>Peter Harris</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 15th May 2013 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;You could always printk the registers in the segfault handler.&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unexpected segmentation fault changing pc register with branch</title><link>https://community.arm.com/thread/3586?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 11:09:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:250d3127-9d69-4f2c-94ca-6ca9c3c42f14</guid><dc:creator>Martin Weidmann</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 15th May 2013 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;I&amp;#39;m not a GDB expert, but can you get it show you the IFSR and IFAR values?&amp;#160; These are the Instruction Fault Status and Instruction Fault Address registers respectively.&amp;#160; They are how the processor reports why instruction fetch failed (which is what I&amp;#39;m guessing is happening).&amp;#160; Couple of possibilities....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;* The memory just isn&amp;#39;t mapped (seems unlikely as you&amp;#39;ve just mapped it, but it&amp;#39;s possible you made a mistake)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;* The mapped region is marked as eXecute Never (XN), meaning any attempt to execute the address will fail&lt;/span&gt;&lt;br /&gt;&lt;span&gt;* Access flag (AF bit) in the descriptor has not been set by the kernel yet.&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unexpected segmentation fault changing pc register with branch</title><link>https://community.arm.com/thread/3588?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 11:09:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a8604264-0286-4c58-8c5d-8426db2ccb70</guid><dc:creator>Davide Quarta</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 15th May 2013 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;thanks all for the reply! &lt;/span&gt;&lt;a href="http://forums.arm.com/public/style_emoticons/default/smile.gif"&gt;&lt;img alt=":)" src="http://forums.arm.com/public/style_emoticons/default/smile.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;i missed this piece of information: &lt;/span&gt;&lt;a href="http://blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/" target="_blank"&gt;http://blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;(studied ARM architecture in two days as much as i could)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;flushing the cache solves the problem.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;best regards,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;D.&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unexpected segmentation fault changing pc register with branch</title><link>https://community.arm.com/thread/3587?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 11:09:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5e8907df-8beb-45c9-83cb-a10efd2b8480</guid><dc:creator>Davide Quarta</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 15th May 2013 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;As far as I know GDB cannot access those registers.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;I&amp;#39;ll ask my supervisor if he has access to a good JTAG debugger (probably we could have one lingering around in the department...)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;and will write here what are the values of IFSR/IFAR.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;p.s. I&amp;#39;ve checked the memory mapping on &lt;/span&gt;&lt;i&gt;/proc/$pid/maps&lt;/i&gt;&lt;span&gt; and it says that it&amp;#39;s correctly allocated with permissions &lt;/span&gt;&lt;i&gt;rwxs&lt;/i&gt;&lt;span&gt; mapped on &amp;quot;&lt;/span&gt;&lt;i&gt;/dev/zero (deleted)&lt;/i&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Thank you for your kind reply!&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>