<font size=2 face="sans-serif">We can decode the assert line with our
symbols.  I suspect the traces might have clues too.  I assume
you are using a custom op-build though?</font><br><font size=2 face="sans-serif"><br>--<br>Dan Crowell<br>Senior Software Engineer - Power Systems Enablement Firmware<br>IBM Rochester: t/l 553-2987<br>dcrowell@us.ibm.com</font><br><br><br><br><font size=1 color=#5f5f5f face="sans-serif">From:      
 </font><font size=1 face="sans-serif">Stewart Smith <stewart@linux.vnet.ibm.com></font><br><font size=1 color=#5f5f5f face="sans-serif">To:      
 </font><font size=1 face="sans-serif">Daniel M Crowell/Rochester/IBM@IBMUS</font><br><font size=1 color=#5f5f5f face="sans-serif">Cc:      
 </font><font size=1 face="sans-serif">Jeremy Kerr <jk@ozlabs.org>,
skiboot@lists.ozlabs.org, William G Hoffa/Rochester/IBM@IBMUS</font><br><font size=1 color=#5f5f5f face="sans-serif">Date:      
 </font><font size=1 face="sans-serif">06/06/2017 03:56 AM</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject:    
   </font><font size=1 face="sans-serif">Re: [Skiboot]
[PATCH RFC v2 00/12] opal-prd updates for p9</font><br><hr noshade><br><br><br><tt><font size=2>Daniel M Crowell <dcrowell@us.ibm.com> writes:<br>> I thought things were working now so that is new news to me.<br><br>weirdly, if I build a statically linked opal-prd, it does work... well,<br>fails somewhere deeper in HBRT with:<br><br>HBRT: Assertion failed @0x3fffa6f60e2c on line 96.<br><br>Which isn't so clear...<br><br>Here's a (completely untested) patch that would make the assert notice<br>from HB/HBRT also include source file name and line number. Feel free to<br>grab/try or I could probably clean it up a bit and submit upstream if<br>that'd help.<br><br>diff --git a/src/include/assert.h b/src/include/assert.h<br>index c3f7ea0c4b1d..39372b928bc0 100644<br>--- a/src/include/assert.h<br>+++ b/src/include/assert.h<br>@@ -93,7 +93,11 @@ enum AssertBehavior<br>  *               user-space dispatching.<br>  */<br> NO_RETURN<br>-void __assert(AssertBehavior i_assertb, int i_line);<br>+void __assert(AssertBehavior i_assertb, int i_line, const char *msg);<br>+<br>+#define stringify(expr)         stringify_1(expr)<br>+/* Double-indirection required to stringify expansions */<br>+#define stringify_1(expr)       #expr<br> <br> #ifdef __HOSTBOOT_MODULE // Only allow traced assert in module code.<br> <br>@@ -132,7 +136,8 @@ void __assert(AssertBehavior i_assertb, int i_line);<br>         __ASSERT_DO_TRACE(expr, __VA_ARGS__); \<br>         __assert((__ASSERT_HAS_TRACE(__VA_ARGS__)
? \<br>                  ASSERT_TRACE_DONE
: ASSERT_TRACE_NOTDONE),\<br>-                 __LINE__);\<br>+                 __LINE__,<br>+                
                 __FILE__
":" stringify(__LINE__) ":" stringify(expr));\<br>     }\<br> }<br> <br>@@ -147,7 +152,7 @@ void __assert(AssertBehavior i_assertb, int i_line);<br> {\<br>     if (unlikely(!(expr)))\<br>     {\<br>-        __assert(ASSERT_KERNEL, __LINE__);\<br>+        __assert(ASSERT_KERNEL, __LINE__, __FILE__
":" stringify(__LINE__) ":" stringify(expr));\<br>     }\<br> }<br> <br>diff --git a/src/lib/assert.C b/src/lib/assert.C<br>index 953393c314f5..fe48a8ee290f 100644<br>--- a/src/lib/assert.C<br>+++ b/src/lib/assert.C<br>@@ -41,7 +41,7 @@<br> /** Hook location for trace module to set up when loaded. */<br> namespace TRACE { void (*traceCallback)(void*, size_t) = NULL; };<br> <br>-extern "C" void __assert(AssertBehavior i_assertb, int i_line)<br>+extern "C" void __assert(AssertBehavior i_assertb, int i_line,
const char *msg)<br> {<br>     if ((i_assertb == ASSERT_CRITICAL) && (KernelMisc::in_kernel_mode()))<br>     {<br>@@ -61,23 +61,23 @@ extern "C" void __assert(AssertBehavior i_assertb,
int i_line)<br>             }<br>             else<br>             {<br>-                printk("Assertion
failed @%p on line %d.\n",<br>-                    
  linkRegister(), i_line);<br>+                printk("Assertion
failed @%p: %s\n",<br>+                    
  linkRegister(), msg);<br>             }<br>             task_crash();<br>             break;<br> <br>         case ASSERT_CRITICAL:  // Critical task,
trace not available.<br>-            printk("Assertion failed
@%p on line %d.(Crit_Assert)\n",<br>-                   linkRegister(),
i_line);<br>+            printk("Assertion failed
@%p (Crit_Assert): %s\n",<br>+                   linkRegister(),
msg);<br> <br>             // Need to call the external
CritAssert system call<br>             cpu_crit_assert(reinterpret_cast<uint64_t>(linkRegister()));<br>             break;<br> <br>         case ASSERT_KERNEL:  // Kernel assert
called.<br>-            printk("Assertion failed
@%p on line %d. (kassert)\n",<br>-                   linkRegister(),
i_line);<br>+            printk("Assertion failed
@%p (kassert): %s\n",<br>+                   linkRegister(),
msg);<br> <br>             /*@<br>              * @errortype<br>diff --git a/src/runtime/rt_assert.C b/src/runtime/rt_assert.C<br>index a22fe461a10f..4e8a787b4a70 100644<br>--- a/src/runtime/rt_assert.C<br>+++ b/src/runtime/rt_assert.C<br>@@ -28,12 +28,13 @@<br> /** Hook location for trace module to set up when loaded. */<br> namespace TRACE { void (*traceCallback)(void*, size_t) = NULL; };<br> <br>-extern "C" void __assert(AssertBehavior i_assertb, int i_line)<br>+extern "C" void __assert(AssertBehavior i_assertb, int i_line,
const char *msg)<br> {<br>+    (void)i_line;<br>     if (i_assertb != ASSERT_TRACE_DONE)<br>     {<br>-        printk("Assertion failed @%p on line
%d.\n",<br>-                linkRegister(),
i_line);<br>+        printk("Assertion failed @%p: %s.\n",<br>+                linkRegister(),
msg);<br>     }<br> <br>     g_hostInterfaces->assert();<br><br><br>-- <br>Stewart Smith<br>OPAL Architect, IBM.<br></font></tt><br><br><BR>