<div dir="ltr"><div dir="ltr"><div dir="ltr">Thank you! The "print_stracktrace" trick does help. I get something that is shown below, which traces the error back to the binary code of the buggy application (which is in C++). A naive question: With Clang, is it possible to get the offending line of the source code,  like when you print a stracktrace of an exception in Java?   </div><div dir="ltr"><br><div><br></div><div><div>/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:517:55: runtime error: -nan is outside the range of representable values of type 'int'</div><div>    #0 0x4b0ffb  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x4b0ffb)</div><div>    #1 0x4ab7b3  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x4ab7b3)</div><div>    #2 0x4a501f  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x4a501f)</div><div>    #3 0x50a6af  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x50a6af)</div><div>    #4 0x509d3a  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x509d3a)</div><div>    #5 0x543be3  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x543be3)</div><div>    #6 0x7fd2719a5d29  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b4d29)</div><div>    #7 0x7fd2719b25c7  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2c15c7)</div><div>    #8 0x7fd2719a6bb2  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b5bb2)</div><div>    #9 0x7fd275c9505b  (/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x15b05b)</div><div>    #10 0x7fd275c9a515  (/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x160515)</div><div>    #11 0x7fd27197738a  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x28638a)</div><div>    #12 0x7fd2719cc5ec  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2db5ec)</div><div>    #13 0x7fd2719ccaf0  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2dbaf0)</div><div>    #14 0x7fd270160196  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4a196)</div><div>    #15 0x7fd2701603ef  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4a3ef)</div><div>    #16 0x7fd27016049b  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4a49b)</div><div>    #17 0x7fd2719cd7ea  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2dc7ea)</div><div>    #18 0x7fd271974b49  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x283b49)</div><div>    #19 0x7fd27197cbeb  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x28bbeb)</div><div>    #20 0x49f1eb  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x49f1eb)</div><div>    #21 0x49e9f1  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x49e9f1)</div><div>    #22 0x7fd27069a82f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)</div><div>    #23 0x477588  (/home/zhfu/catkin_ws/devel/lib/turtlesim/turtlesim_node+0x477588)</div><div><br></div><div><br></div>Zhoulai</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 8, 2019 at 9:38 AM Roman Lebedev <<a href="mailto:lebedev.ri@gmail.com">lebedev.ri@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">export UBSAN_OPTIONS="print_stacktrace=1"<br>
might help<br>
<br>
On Mon, Apr 8, 2019 at 10:30 AM Zhoulai Fu@Gmail via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I am running a robotic application on Ubuntu16. The application is compiled with Clang's UndefinedBehavior sanitizer with an "-g" option. I got a brief error message which seemed to indicate a bug somewhere:<br>
><br>
>     /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:517:55:<br>
>     runtime error: -nan is outside the range of representable values of type 'int'<br>
><br>
> My guess is that the bug is from my application, not from the more mature QT. How could I determine which line in the source (which I can access) of the application that triggers this runtime error?<br>
><br>
> Thanks.<br>
><br>
> Zhoulai<br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>