Skip to content
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

Crash when processing certain libretro dats #781

Closed
juliadin opened this issue Oct 22, 2023 · 3 comments · Fixed by #782
Closed

Crash when processing certain libretro dats #781

juliadin opened this issue Oct 22, 2023 · 3 comments · Fixed by #782
Assignees
Labels
bug A confirmed issues that needs fixing

Comments

@juliadin
Copy link
Contributor

Paste the command

igir report --dat dat/libretro-database/dat/Sony\ -\ PlayStation\ 3.dat --input sources/

Describe the bug

When using igir (tried with some 1.9, 2.0.6, 2.0.7) to process some files in the libretro-database repository, it crashes with an unhelpful error:

 ______   ______   ______  _______  
|      \ /      \ |      \|       \ 
 \$$$$$$|  $$$$$$\ \$$$$$$| $$$$$$$\
  | $$  | $$|    \  | $$  | $$    $$   ROM collection manager
  | $$  | $$|    \  | $$  | $$    $$   https://igir.io/
  | $$  | $$ \$$$$  | $$  | $$$$$$$\
 _| $$_ | $$__| $$ _| $$_ | $$  | $$   v2.0.7
|   $$ \ \$$    $$|   $$ \| $$  | $$
 \$$$$$$  \$$$$$$  \$$$$$$ \$$   \$$


↻ Scanning for DATs ·········· | ░░░░░░░░░░░░░░░░░░░░░░░░░ | 0/1file:///usr/local/lib/node_modules/igir/build/src/modules/datScanner.js:277
                    .filter((rom) => rom.name) // we need ROM filenames
                     ^

TypeError: Cannot read properties of undefined (reading 'filter')
    at file:///usr/local/lib/node_modules/igir/build/src/modules/datScanner.js:277:22
    at Array.flatMap (<anonymous>)
    at DATScanner.<anonymous> (file:///usr/local/lib/node_modules/igir/build/src/modules/datScanner.js:274:38)
    at Generator.next (<anonymous>)
    at fulfilled (file:///usr/local/lib/node_modules/igir/build/src/modules/datScanner.js:4:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.13.0

At the moment it happens with the files

libretro-database/dat/Nintendo - GameCube.dat
libretro-database/dat/Nintendo - Super Nintendo Entertainment System.dat
libretro-database/dat/Nintendo - Wii.dat
libretro-database/dat/Nintendo - Wii U.dat
libretro-database/dat/PuzzleScript.dat
libretro-database/dat/Sinclair - ZX Spectrum.dat
libretro-database/dat/Sony - PlayStation 3.dat
libretro-database/dat/Vircon32.dat
libretro-database/dat/WASM-4.dat

from the repository https://github.com/libretro/libretro-database.git

Expected behavior

processing of the dat files or warnings about issues with the contained data

Debug logs

 ______   ______   ______  _______  
|      \ /      \ |      \|       \ 
 \$$$$$$|  $$$$$$\ \$$$$$$| $$$$$$$\
  | $$  | $$|    \  | $$  | $$    $$   ROM collection manager
  | $$  | $$|    \  | $$  | $$    $$   https://igir.io/
  | $$  | $$ \$$$$  | $$  | $$$$$$$\
 _| $$_ | $$__| $$ _| $$_ | $$  | $$   v2.0.7
|   $$ \ \$$    $$|   $$ \| $$  | $$
 \$$$$$$  \$$$$$$  \$$$$$$ \$$   \$$


[16:46:42.694] INFO:  DATScanner: scanning DAT files
[16:46:42.720] DEBUG: DATScanner: found 1 DAT file
[16:46:42.721] DEBUG: DATScanner: enumerating DAT archives
↻ Scanning for DATs ·········· | ░░░░░░░░░░░░░░░░░░░░░░░░░ | 0/1file:///usr/local/lib/node_modules/igir/build/src/modules/datScanner.js:277
                    .filter((rom) => rom.name) // we need ROM filenames
                     ^

TypeError: Cannot read properties of undefined (reading 'filter')
    at file:///usr/local/lib/node_modules/igir/build/src/modules/datScanner.js:277:22
    at Array.flatMap (<anonymous>)
    at DATScanner.<anonymous> (file:///usr/local/lib/node_modules/igir/build/src/modules/datScanner.js:274:38)
    at Generator.next (<anonymous>)
    at fulfilled (file:///usr/local/lib/node_modules/igir/build/src/modules/datScanner.js:4:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.13.0

DAT(s) used

https://raw.githubusercontent.com/libretro/libretro-database/master/dat/Sony%20-%20PlayStation%203.dat

igir version

2.0.7

Node.js version

18.13.0

Operating system

Debian 12

Additional context

No response

@juliadin juliadin added the potential-bug A potential issue that needs confirmation and/or triage label Oct 22, 2023
@emmercm emmercm self-assigned this Oct 22, 2023
@emmercm emmercm added bug A confirmed issues that needs fixing and removed potential-bug A potential issue that needs confirmation and/or triage labels Oct 22, 2023
@emmercm
Copy link
Owner

emmercm commented Oct 22, 2023

This is being caused by RobLoach/datfile#2. I can add a workaround so the parsing doesn't crash like this, but the CMPro DAT parser may need a rewrite.

@juliadin
Copy link
Contributor Author

Thanks for the swift explanation. A workaround would be nice since I needed to do 'nop' runs of igir just to fidn the files that failed. Throwing an error that states the file name if dat parsing fails would be wonderful.

Copy link

🔒 Inactive issue lock

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Comment generated by the GitHub Lock Issues workflow.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug A confirmed issues that needs fixing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants