build2: Frequent random crashes on recent staged builds

I’ve been seeing fairly frequent bpkg terminated abnormally: access violation errors recently. Most frequently during sync it appears. Generally though they will not reproduce - running the exact same command again immediately will usually succeed.

I’ve now managed to capture a crash dump of one. It appears that sp was nullptr here: https://github.com/build2/bpkg/blob/master/bpkg/pkg-build.cxx#L5967

Dump and binaries

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I eventually managed to get an asan-enabled build working. Thus far, the issue has not shown up since using it, just as it stubbornly refuses to when launching b via the debugger. I’ll keep trying…

If both bpkg and b are crashing (which is what you said in https://github.com/build2/build2/issues/408#issuecomment-2336518988)

So this is based on the output I’m seeing in the shell, of the form given in the OP. I’ve seen it for both b and bpkg for certain (fairly often), possibly also for bdep, although of course there’s no way to be certain they’re all the same underlying issue. And I don’t know exactly how the shell/OS reports this stuff in relation to child processes, but yeah it would seem that unless it’s saying something very confusing, then indeed crashes are occurring in more than one of the executables.

  1. Have you tried this on Linux (where we have saner debugging facilities)? If this is (2), then it may be reproducible on Linux.

I have occasionally been building my project on Linux (only through WSL, however). Recently not so often since the clang/libc++ modules desync issue; that said, I’ve at least attempted to do so a number of times and as yet have not witnessed any crash on Linux.

  1. Have you tried this on Windows but on a different machine? The fact that you cannot attach the debugger suggest that there might be something off about your setup. Perhaps your edited your registry one too many times?

Yes, the crash occurs across multiple machines. I may not have tried the JIT debugger on another machine though, which is a good point. I’ll try that.

  1. Have you tried to intentionally reproduce it? For example by re-running the crashing command in a loop, say, 100 times to see if you can trigger the crash on demand? It would be helpful if we can establish the command and some upper boundary of tries that will most likely reproduce the crash.

Not yet, no. If I continue to fail to make any progress on getting a crash dump then I’ll try something like this.

Thanks for the report!

Will be fixed in the next staged version.