-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread.spawn() crashes an Android #22963
Comments
What kind of crash? Stack trace? |
No stack trace. Terminate suddenly at this line. |
However, I have confirmed that this works, so I know that Thread.spawn() itself is not the problem until. const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "android_test",
.root_module = b.createModule(.{
.root_source_file = b.path("main.zig"),
.target = target,
.optimize = optimize,
}),
});
b.installArtifact(exe);
} const std = @import("std");
pub fn main() !void {
std.log.debug("Hello, Android!", .{});
const thread = try std.Thread.spawn(.{}, hello, .{});
thread.join();
}
fn hello() void {
var i: u8 = 0;
while (i<=3) : (i += 1) {
std.log.debug("{}", .{i});
std.Thread.sleep(1_000_000_000);
}
}
|
Well, try attaching a debugger? |
I'm very sorry, but I don't understand usage of debugger on Andorid. |
Zig Version
0.14.0-dev.3145+6a6e72fff
Steps to Reproduce and Observed Behavior
I am sorry that I have not been able to pinpoint the exact cause, but file this as an issue.
src.zip
This worked up to 42e48b8 but crashes after 6a6e72f.
Adding this line causes a crash in
main_anroid.zig
.Expected Behavior
No crash.
The text was updated successfully, but these errors were encountered: