kornelski / cavif-rs

AVIF image creator in pure Rust
https://lib.rs/cavif
BSD 3-Clause "New" or "Revised" License
570 stars 27 forks source link

Illegal instruction / trap invalid opcode #61

Closed lakano closed 1 year ago

lakano commented 1 year ago

Hi,

Thank you for this tool. When we try to convert multiple files, we have sometime this error: Illegal instruction (core dumped) and in our syslog: kernel: [3558748.336136] traps: cavif[25743] trap invalid opcode ip:7f86d2274ddd sp:7f86d1085200 error:0 in cavif[7f86d216c000+1a6000] To debug and understood which file make problem, that could be useful to have a --verbose option All the file return this details with the "file" command: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 240x240, frames 3 May be because of the number of files ? ( ~14.000 ) ?

What can I do to help you to fix this bug quickly ?

kornelski commented 1 year ago

Does it crash with a particular file or any file?

Do you have an old CPU?

Can you try cloning the repo and running it with cargo run -- image.jpg? That will show detailed error info.

lakano commented 1 year ago

I've just finished to make a big loop to run it on smallest batch, and it's works. So the problem is the number of files in the pool. I've split in 10x, so at ~1.400 per run it's works

lakano commented 1 year ago

The CPU is: processor : 15 vendor_id : AuthenticAMD cpu family : 23 model : 1 model name : AMD EPYC Processor (with IBPB) stepping : 2 microcode : 0x1000065 cpu MHz : 2495.312 cache size : 512 KB physical id : 0 siblings : 16 core id : 7 cpu cores : 16 apicid : 15 initial apicid : 15 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl extd_apicid amd_dcm eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext retpoline retpoline_amd vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 ibpb arat bugs : fxsave_leak sysret_ss_attrs spectre_v1 spectre_v2 bogomips : 4990.62 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management:

I've trying your cargo command in few seconds

lakano commented 1 year ago

The cargo command failed because it's a old server ( Ubuntu 16.04 LTS )

error: failed to parse manifest at `/opt/cavif-rs/Cargo.toml`

Caused by:
  failed to parse the `edition` key

Caused by:
  this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions.
kornelski commented 1 year ago

Please try latest release: https://github.com/kornelski/cavif-rs/releases

Previous executable had panics disabled. This one should print more info on error.

lakano commented 1 year ago

I've just removed all my previous .avif files and retry again with the last version 1.5,and I have no error at all and all .avif are present ( find -name *.avif | wc -l ) So, I don't known if you fixed the problem since the 1.3.5, but for me all is ok ! Thank you!