← Back to team overview

ubuntu-phone team mailing list archive

Page sections and corrupted stacks

 

Hi all,

I've got a Sunday afternoon / evening / night / I-live-in-Asia-you-insensitive-clod puzzler for you.

I've been working on the ebook reader Beru, and I've been getting crashes on start about 50% of the time. I'd been hoping that this was just related to launching from Qt Creator. But I tried installing it and still got crashes about half the time I launched it.

So, I dug out the instructions for running under gdb, got a crash, and discovered the stack had been corrupted. Poor little Python-loving me didn't even know that this was a thing that could happen!

I bisected to find the problem commit, and discovered that it was when I added sections to the first page in my page stack. Obviously this couldn't be the problem, but I removed the sections just to check. And the crash went away.

Once I saw that, it was obvious that the problem was in my handler for changing the selected section. So I removed the handler (making the sections affect nothing), and the crash remained!

To try to separate the crash from the general hubbub of initialization, I removed the sections from the Page head, and set them procedurally after everything was loaded. Obviously, this wouldn't make a difference. But it stopped the crashes.

So far, I'm batting 0-for-3 on this one. So I'd like to hear if any of you have an idea what's going on. For now, delaying setting the sections is working, but I have a feeling that I'm jut hiding a bug. I'd like to find and fix it, or at least assure myself that this is a sensible work-around.

I haven't managed to come up with a simple test case yet. A basic page-with-sections test works just fine, so it has something to do with all the other things going on. Here's the problematic commit [1], the solution commit [2], and a bug report with some more info [3]. You're welcome to reply to the bug if you'd rather not do this over the list.

Thanks,
Robert

[1] https://github.com/rschroll/beru/commit/9f8a299d0ecc5c6454e0b2b5d8f54a883b4b3328 [2] https://github.com/rschroll/beru/commit/4d521b66e83596ce2a6cb9587e523bae1db0a1d4
[3] https://github.com/rschroll/beru/issues/82



Follow ups