TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Debugging a Mixed Python and C Language Stack

152 点作者 quasiben大约 2 年前

6 条评论

zdevito大约 2 年前
When developing PyTorch, we also run into a lot of mixed Python&#x2F;C++ language situations. We&#x27;ve recently been experimenting with in-process &#x27;combined&#x27; Python&#x2F;C++&#x2F;PyTorch 2.0 stack traces to make it easier to understand where code is executing (<a href="https:&#x2F;&#x2F;dev-discuss.pytorch.org&#x2F;t&#x2F;fast-combined-c-python-torchscript-inductor-tracebacks&#x2F;1158" rel="nofollow">https:&#x2F;&#x2F;dev-discuss.pytorch.org&#x2F;t&#x2F;fast-combined-c-python-tor...</a>).
评论 #35708075 未加载
fmajid大约 2 年前
GDB can decode Python stack traces as Python code, as long as you have have python-gdb.py from the Python source distribution in the same place as your Python executable.
评论 #35711719 未加载
评论 #35711289 未加载
评论 #35709797 未加载
评论 #35707907 未加载
评论 #35715412 未加载
评论 #35710350 未加载
PaulHoule大约 2 年前
That reminds me of the time I debugged some code (also neural network) that was in both Java and C++ and I was able to attach both gdb and jdb to the same process but had to disable the segfault trap on gdb because the jvm segfaults all the time in normal operation.
评论 #35711831 未加载
评论 #35711212 未加载
jaza大约 2 年前
An inspiring, albeit daunting, write-up for someone like me, who has been a python coder for over 10 years, but who has never professionally coded in C or C++. I&#x27;d be pleasantly surprised with myself if I could one day debug like that.<p>Also somewhat depressing that, yet again, the GIL was to blame, and that after all that impressive investigatory work, the fix was (spoiler alert!) &quot;rewrite the offending function in C&quot;.
评论 #35713044 未加载
vaughan大约 2 年前
It&#x27;s unfortunate that no one thinks about the debugging experience with anything they build today. It&#x27;s always a &quot;strap yourself in&quot; experience like in the post.<p>I dream of an IDE that is one-click, full-stack, local debug.<p>I dropped some ideas here: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=35650253" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=35650253</a>
nightpool大约 2 年前
Awesome to see some more Excalidraw diagrams on the front page, feels like it&#x27;s really taking off.