Open Beyley opened 10 months ago
I too face the same issue for below simple code on (0.12.0-dev.1751+7fbbeae61):
const std = @import("std");
pub fn main() !void {
var gp = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gp.allocator();
var client = std.http.Client{ .allocator = allocator };
client.deinit();
var resp = try client.fetch(allocator, .{ .location = .{ .url = "https://dummyjson.com/products/1" } });
resp.deinit();
}
I too face the same issue for below simple code on (0.12.0-dev.1751+7fbbeae61):
const std = @import("std"); pub fn main() !void { var gp = std.heap.GeneralPurposeAllocator(.{}){}; const allocator = gp.allocator(); var client = std.http.Client{ .allocator = allocator }; client.deinit(); var resp = try client.fetch(allocator, .{ .location = .{ .url = "https://dummyjson.com/products/1" } }); resp.deinit(); }
My Bad, I'm de-initializing the memory without defer, now it's working for me:
const std = @import("std");
pub fn main() !void {
var gp = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gp.allocator();
var client = std.http.Client{ .allocator = allocator };
defer client.deinit();
var resp = try client.fetch(allocator, .{ .location = .{ .url = "https://dummyjson.com/products/1" } });
defer resp.deinit();
}
Zig Version
0.12.0-dev.1726+8b1097083
Steps to Reproduce and Observed Behavior
Clone this repo at commit
2900ecbcf8ca3b6e6827c0a82164f22c33668e89
Compile withzig build -Duse_llvm=false run
on a Linux host, with a file located at~/.config/fresh_presence_config.ini
with the contentsApp crashes on startup when it attempts to ask the server for instance information
Expected Behavior
App runs as it does on the LLVM backend, with the logs of