Closed simsong closed 2 years ago
Is access to libewf thread locked or is used from multiple threads?
libewf is only accessed from the main thread.
Recall that this is not a problem on Intel with the same disk image and program, only a problem on Apple silicon.
Here is another possible datapoint. Perhaps the system ran out of memory?
How does libewf
deal with low memory conditions? bulk_extractor
detects that memory allocation failed and handles it appropriately.
simsong@Seasons bulk_extractor % df -h .
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk3s5 926Gi 628Gi 183Gi 78% 1765601 1918589840 0% /System/Volumes/Data
simsong@Seasons bulk_extractor %
simsong@Seasons bulk_extractor % ps uwww 29395
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
simsong 29395 0.0 0.0 567558496 608 s000 TX 11:55AM 851:44.73 /Users/simsong/gits/bulk_extractor/src/bulk_extractor -1 -Z -o /Volumes/out/arm-be20-2TB-v2 /Users/simsong/corp/nps-2011-2tb/nps-2011-2tb.E01
simsong@Seasons bulk_extractor %
How does libewf deal with low memory conditions?
similar, if an alloc or realloc fails it "should" be handled gracefully, but an error is easily made. The trace indicates an issue in memmove (which I assume is an optimization of the memcpy in the libewf_handle_read_buffer function). If time permits I'll have a look at it tomorrow with a fresh pair of eyes.
Definitely out of memory.
I'm closing this. BE shoudln't let memory get out of control, and this is not a problem specific to libewf. Sorry for the false alarm, @joachimmetz .
I have replicated this several times now. No crash with
.raw
files, nor with small.E01
files, but definitely with large ones.First crash:
Second crash, this one under a debugger:
Since the crashes happen at different points in the run, and since the runs are non-deterministic due to muli-threading, I suspect that these are memory alignment/overrun/allocation errors that show up on the ARM architecture but not on the Intel architecture. (I saw a similar issue with BE16, see #328 )
Presumably @joachimmetz will want to know about this.