BOSSoNe0013 / track-o-bot

The friendly Hearthstone Tracker (Linux port)
https://trackobot.com
GNU Lesser General Public License v2.1
39 stars 6 forks source link

Track-o-bot crashes #39

Closed terzag closed 8 years ago

terzag commented 8 years ago

I often notice when quitting HearthStone that the Track-o-Bot tray icon is no longer there. I'm not sure if it crashes while in-game or when I quit HS. Is there a log somewhere that could tell why it crashed?

PlasmaPower commented 8 years ago

If you run track-o-bot from the terminal, it should give you more detailed information on the crash. If it says core dumped, segmentation fault, or something else similarly nondescriptive, make sure you have debug symbols enabled when you compile this, install vagrant, and run vagrant track-o-bot.

If it says segmentation fault, then it's likely your problem is this: https://github.com/BOSSoNe0013/track-o-bot/issues/24

terzag commented 8 years ago

Ran it from the terminal and I get these (the first line is repeated a bunch of time − it's cut but probably irrelevant):

static QPixmap QPixmap::grabWindow(WId, int, int, int, int) is deprecated, use QScreen::grabWindow() instead. Defaulting to primary screen. * stack smashing detected *: ./Track-o-Bot terminated Abandon (core dumped)

What do I do to have "debug symbols enabled" (Ubuntu 15.10)? Some packages to install?

PlasmaPower commented 8 years ago

@terzag are you building it from source?

PlasmaPower commented 8 years ago

Most likely you have debug symbols enabled, unless they were later stripped.

terzag commented 8 years ago

Yes, building from source. Last time I built ToB was maybe two days ago. How do I use vagrant?

Just in case, the message that was cut is "static QPixmap QPixmap::grabWindow(WId, int, int, int, int) is deprecated, use QScreen::grabWindow() instead. Defaulting to primary screen."

PlasmaPower commented 8 years ago

@terzag I'm pretty sure the deprecation notice is irrelevant. As for vagrant, simply execute vagrant [program] from the command line.

terzag commented 8 years ago

But is it done at compile time or when running ToB? because if I type vagrant ./Track-o-Bot all I get is the help page of Vagrant (list of options).

PlasmaPower commented 8 years ago

Oops, my bad, I didn't mean vagrant, I meant valgrind. Try that instead.

terzag commented 8 years ago

Ok, here is the output after ToB crashed:

* stack smashing detected _: ./Track-o-Bot terminated ==15981== ==15981== Process terminating with default action of signal 6 (SIGABRT) ==15981== at 0x6ABF267: raise (raise.c:55) ==15981== by 0x6AC0EC9: abort (abort.c:89) ==15981== by 0x6B02BF2: libc_message (libc_fatal.c:175) ==15981== by 0x6BA2E3B: fortify_fail (fortify_fail.c:38) ==15981== by 0x6BA2DDF: __stack_chk_fail (stack_chkfail.c:28) ==15981== by 0x4200FE: Logger::Add(LogEventType, char const, ...) (Logger.cpp:77) ==15981== by 0x40F18E: JsonFromReply(QNetworkReply, QJsonObject) (WebProfile.cpp:35) ==15981== by 0x40F367: WebProfile::UploadResult(QJsonObject const&)::{lambda()#1}::operator()() const (WebProfile.cpp:78) ==15981== by 0x410DA6: QtPrivate::FunctorCallQtPrivate::IndexesList<, QtPrivate::List<>, void, WebProfile::UploadResult(QJsonObject const&)::{lambda()#1}>::call({lambda()#1}, void) (qobjectdefsimpl.h:494) ==15981== by 0x410D37: void QtPrivate::Functor<WebProfile::UploadResult(QJsonObject const&)::{lambda()#1}, 0>::callQtPrivate::List<, void>({lambda()#1}&, void, {lambda()#1}&_) (qobjectdefsimpl.h:551) ==15981== by 0x410CD9: QtPrivate::QFunctorSlotObject<WebProfile::UploadResult(QJsonObject const&)::{lambda()#1}, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase, QObject_, void, bool_) (qobjectimpl.h:192) ==15981== by 0x5FDF616: QMetaObject::activate(QObject, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.4.2) ==15981== ==15981== HEAP SUMMARY: ==15981== in use at exit: 5,568,715 bytes in 33,882 blocks ==15981== total heap usage: 2,640,686 allocs, 2,606,804 frees, 1,380,873,537 bytes allocated ==15981== ==15981== LEAK SUMMARY: ==15981== definitely lost: 53,081 bytes in 471 blocks ==15981== indirectly lost: 8,919 bytes in 389 blocks ==15981== possibly lost: 14,520 bytes in 192 blocks ==15981== still reachable: 5,492,195 bytes in 32,830 blocks ==15981== of which reachable via heuristic: ==15981== newarray : 3,176 bytes in 23 blocks ==15981== multipleinheritance: 160 bytes in 1 blocks ==15981== suppressed: 0 bytes in 0 blocks ==15981== Rerun with --leak-check=full to see details of leaked memory ==15981== ==15981== For counts of detected and suppressed errors, rerun with: -v ==15981== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

It looks like the crash happens when I quit HS, as all my games seem to be recorded.

PlasmaPower commented 8 years ago

It appears that the crash is a stack overflow, but the stack isn't that large, and parsing JSON shouldn't easily overflow the stack.

stevschmid commented 8 years ago

This issue is fixed in the upstream master branch and thanks to @BOSSoNe0013 the fix can be found already in this linux fork.