std.fs.Dir.copyFile fails on linux #2

Open
opened 2025-12-05 23:01:37 +00:00 by remi · 3 comments
Owner
pdex.so!compiler_rt.memcpy.copyRange4() (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:191)
pdex.so!compiler_rt.memcpy.copyLessThan16() (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:80)
pdex.so!compiler_rt.memcpy.copySmallLength() (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:56)
pdex.so!compiler_rt.memcpy.memcpyFast(u8 * dest, u8 * src, usize len) (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:42)
pdex.so!Random.ChaCha.fill (Unknown Source:0)
pdex.so!crypto.tlcsprng.fillWithCsprng (Unknown Source:0)
pdex.so!crypto.tlcsprng.tlsCsprngFill (Unknown Source:0)
pdex.so!Random.bytes (Unknown Source:0)
pdex.so!Random.int__anon_24257 (Unknown Source:0)
pdex.so!fs.AtomicFile.init (Unknown Source:0)
pdex.so!fs.Dir.atomicFile (Unknown Source:0)
pdex.so!fs.Dir.copyFile (Unknown Source:0)
pdex.so!hot_reload.load_new_code (Unknown Source:0)
pdex.so!hot_reload.update (Unknown Source:0)
pdex.so!update_and_render (Unknown Source:0)
[Unknown/Just-In-Time compiled code] (Unknown Source:0)
libglib-2.0.so.0!g_main_loop_run (Unknown Source:0)
libgtk-3.so.0!gtk_main (Unknown Source:0)
[Unknown/Just-In-Time compiled code] (Unknown Source:0)
libc.so.6!__libc_start_main (Unknown Source:0)
[Unknown/Just-In-Time compiled code] (Unknown Source:0)

For some reason using std.fs.Dir.copyFile causes a memcpy call where destination is 0

```pdex.so!compiler_rt.memcpy.copyFixedLength() (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:170) pdex.so!compiler_rt.memcpy.copyRange4() (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:191) pdex.so!compiler_rt.memcpy.copyLessThan16() (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:80) pdex.so!compiler_rt.memcpy.copySmallLength() (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:56) pdex.so!compiler_rt.memcpy.memcpyFast(u8 * dest, u8 * src, usize len) (/home/user/.zvm/0.15.2/lib/compiler_rt/memcpy.zig:42) pdex.so!Random.ChaCha.fill (Unknown Source:0) pdex.so!crypto.tlcsprng.fillWithCsprng (Unknown Source:0) pdex.so!crypto.tlcsprng.tlsCsprngFill (Unknown Source:0) pdex.so!Random.bytes (Unknown Source:0) pdex.so!Random.int__anon_24257 (Unknown Source:0) pdex.so!fs.AtomicFile.init (Unknown Source:0) pdex.so!fs.Dir.atomicFile (Unknown Source:0) pdex.so!fs.Dir.copyFile (Unknown Source:0) pdex.so!hot_reload.load_new_code (Unknown Source:0) pdex.so!hot_reload.update (Unknown Source:0) pdex.so!update_and_render (Unknown Source:0) [Unknown/Just-In-Time compiled code] (Unknown Source:0) libglib-2.0.so.0!g_main_loop_run (Unknown Source:0) libgtk-3.so.0!gtk_main (Unknown Source:0) [Unknown/Just-In-Time compiled code] (Unknown Source:0) libc.so.6!__libc_start_main (Unknown Source:0) [Unknown/Just-In-Time compiled code] (Unknown Source:0) ``` For some reason using std.fs.Dir.copyFile causes a memcpy call where destination is 0
Author
Owner

interestingly when writing my own copy function std.DynLib returns error.Unexpected for already open files? which is confusing?

interestingly when writing my own copy function std.DynLib returns error.Unexpected for already open files? which is confusing?
Author
Owner

okay its this function? std.crypto.random.int(u32)

okay its this function? std.crypto.random.int(u32)
Author
Owner

Okay so basically:

  • std.crypto.random.int fails for some reason
  • also we have to link libc

This error message is probably related [3059:3059:20251209,083037.435385:ERROR elf_dynamic_array_reader.h:64] tag not found

Okay so basically: - std.crypto.random.int fails for some reason - also we have to link libc This error message is probably related [3059:3059:20251209,083037.435385:ERROR elf_dynamic_array_reader.h:64] tag not found
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
remi/ultimate-playdate-zig#2
No description provided.