Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Some unexpected errors #2

Open
orecus opened this issue Jun 20, 2019 · 6 comments
Open

Some unexpected errors #2

orecus opened this issue Jun 20, 2019 · 6 comments

Comments

@orecus
Copy link

orecus commented Jun 20, 2019

Hi,

I've just started migrating to this library and encountered some errors while processing files with it, not sure if these are bugs within medainfo itself, or this version of it.

Let me know if there are any additional details that may be needed or if I can assist in tracking these down.

RuntimeError: float unrepresentable in integer range
    at wasm-function[4084]:107
    at wasm-function[3442]:5
    at wasm-function[3440]:1155
    at wasm-function[3427]:838
    at wasm-function[3999]:117
    at wasm-function[3996]:413
    at wasm-function[3993]:263
    at wasm-function[3992]:669
    at wasm-function[4003]:1880
    at wasm-function[989]:79
    at wasm-function[1625]:494
    at wasm-function[1626]:1515
    at wasm-function[1597]:23398
    at wasm-function[3999]:117
    at wasm-function[3996]:413
    at wasm-function[3993]:263
    at wasm-function[3992]:669
    at wasm-function[4207]:161
    at wasm-function[3993]:124
    at wasm-function[3992]:669
    at wasm-function[410]:494
    at wasm-function[53]:66
/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:19
function(a){if(!(a instanceof x))throw a;});c.inspect=function(){return"[Emscripten Module object]"}}else if(ca)c.print||(c.print=print),"undefined"!=typeof printErr&&(c.printErr=printErr),c.read="undefined"!=typeof read?read:function(){throw"no read() available";},c.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");assert("object"===typeof a);return a},"undefined"!=typeof scriptArgs?c.arguments=scriptArgs:"undefined"!=typeof arguments&&
                                 ^

RuntimeError: float unrepresentable in integer range
    at wasm-function[4084]:107
    at wasm-function[3442]:5
    at wasm-function[3440]:1155
    at wasm-function[3427]:838
    at wasm-function[3999]:117
    at wasm-function[3996]:413
    at wasm-function[3993]:263
    at wasm-function[3992]:669
    at wasm-function[4003]:1880
    at wasm-function[989]:79
    at wasm-function[1625]:494
    at wasm-function[1626]:1515
    at wasm-function[1597]:23398
    at wasm-function[3999]:117
    at wasm-function[3996]:413
    at wasm-function[3993]:263
    at wasm-function[3992]:669
    at wasm-function[4207]:161
    at wasm-function[3993]:124
    at wasm-function[3992]:669
    at wasm-function[410]:494
    at wasm-function[53]:66
Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 134217728, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 
Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 134217728, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 
abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 134217728, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ") at Error
    at Ea (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:41:26)
    at E (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:142:128)
    at ga (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:43:15)
    at enlargeMemory (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:96:53)
    at wasm-function[5528]:67
    at wasm-function[4963]:3289
    at wasm-function[5448]:16
    at wasm-function[5449]:3
    at wasm-function[3992]:203
    at wasm-function[410]:494
    at wasm-function[53]:66
    at wasm-function[109]:138
    at wasm-function[5544]:16
    at dynCall_iiii_23 (eval at X (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:83:483), <anonymous>:4:12)
    at MediaInfo$Open_Buffer_Continue [as Open_Buffer_Continue] (eval at Gc (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:90:433), <anonymous>:9:10)
    at ReadStream.<anonymous> (/edacis/node_modules/node-mediainfo/dist/index.js:86:36)
    at ReadStream.emit (events.js:189:13)
    at ReadStream.EventEmitter.emit (domain.js:441:20)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at ReadStream.Readable.push (_stream_readable.js:220:10)
    at lazyFs.read (internal/fs/streams.js:181:12)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.

/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:19
function(a){if(!(a instanceof x))throw a;});c.inspect=function(){return"[Emscripten Module object]"}}else if(ca)c.print||(c.print=print),"undefined"!=typeof printErr&&(c.printErr=printErr),c.read="undefined"!=typeof read?read:function(){throw"no read() available";},c.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");assert("object"===typeof a);return a},"undefined"!=typeof scriptArgs?c.arguments=scriptArgs:"undefined"!=typeof arguments&&
                                 ^
abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 134217728, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ") at Error
    at Ea (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:41:26)
    at E (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:142:128)
    at ga (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:43:15)
    at enlargeMemory (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:96:53)
    at wasm-function[5528]:67
    at wasm-function[4963]:3289
    at wasm-function[5448]:16
    at wasm-function[5449]:3
    at wasm-function[3992]:203
    at wasm-function[410]:494
    at wasm-function[53]:66
    at wasm-function[109]:138
    at wasm-function[5544]:16
    at dynCall_iiii_23 (eval at X (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:83:483), <anonymous>:4:12)
    at MediaInfo$Open_Buffer_Continue [as Open_Buffer_Continue] (eval at Gc (/edacis/node_modules/node-mediainfo/lib/MediaInfoWasm.js:90:433), <anonymous>:9:10)
    at ReadStream.<anonymous> (/edacis/node_modules/node-mediainfo/dist/index.js:86:36)
    at ReadStream.emit (events.js:189:13)
    at ReadStream.EventEmitter.emit (domain.js:441:20)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at ReadStream.Readable.push (_stream_readable.js:220:10)
    at lazyFs.read (internal/fs/streams.js:181:12)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
@m-rots
Copy link
Owner

m-rots commented Jun 21, 2019

Certainly not expected behaviour, it might have to do with the use of read streams OR the WASM module provided by MediaInfo itself.

I might have an idea for a non-stream equivalent of this module, which could fix your issue. Though honestly I have no idea, this module does nothing more than providing a small wrapper around the WASM file.

What version of NodeJS are you running? And what type of file are you trying to open?

Let's debug the source of this error together!

@orecus
Copy link
Author

orecus commented Jun 26, 2019

I'm running v10.15.3 of NodeJS.

For reference the mediainfo lib is called from workers, so I'm not 100% sure which file is causing this as they are run in parallel, but I can limit and re-run the code to see which files this comes from tonight, and get back to you! :)

@orecus
Copy link
Author

orecus commented Jul 4, 2019

Hi,

Sorry for the late reply, but I've been able to isolate which files is causing this, and can reproduce the two above errors on these two files constantly now.

I tested opening with the Mediainfo windows app, and that seems to be working on them without issues on those two files.

For reference, i'm calling it like so;

    const mediaData = await mediainfo(fileObject.path)
      .then((data) => {

        return data.media;
      })
      .catch((error) => {

        console.error('Failed to exctract mediainfo from file!', { fileObject, error });
        return null;
      });

The errors does not seem to be caught, not sure if it's something that can be changed, then at least we could handle it gracefully and move on.

@rogerknop
Copy link

Hello,
any news on that issue?
I am facing the same problem.
Regards, Roger

@Maxou44
Copy link

Maxou44 commented Jan 11, 2020

Do you have a sample media file and code to reproduce the issue?

@ksesong
Copy link

ksesong commented Feb 12, 2020

This might be a different issue, but I can't manage to get the info of this media file, as I get the following error:

/abc/node_modules/node-mediainfo/lib/MediaInfoWasm.js:19
function(a){if(!(a instanceof x))throw a;});c.inspect=function(){return"[Emscripten Module object]"}}else if(ca)c.print||(c.print=print),"undefined"!=typeof printErr&&(c.printErr=printErr),c.read="undefined"!=typeof read?read:function(){throw"no read() available";},c.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");assert("object"===typeof a);return a},"undefined"!=typeof scriptArgs?c.arguments=scriptArgs:"undefined"!=typeof arguments&&
                                 ^

RangeError [ERR_OUT_OF_RANGE]: The value of "start" is out of range. It must be >= 0 and <= 2 ** 53 - 1. Received -1
    at checkPosition (internal/fs/streams.js:45:11)
    at new ReadStream (internal/fs/streams.js:83:5)
    at Object.createReadStream (fs.js:1802:10)
    at ReadStream.<anonymous> (/abc/node_modules/node-mediainfo/dist/index.js:86:50)
    at ReadStream.emit (events.js:223:5)
    at ReadStream.EventEmitter.emit (domain.js:498:23)
    at internal/fs/streams.js:218:14
    at FSReqCallback.oncomplete (fs.js:146:23) {
  code: 'ERR_OUT_OF_RANGE'
}

Running it on the MediaInfoOnline website does yield positive results:

{
"media": {
"@ref": "sample.webm",
"track": [
{
"@type": "General",
"VideoCount": "1",
"FileExtension": "webm",
"Format": "WebM",
"Format_Version": "2",
"FileSize": "58906",
"Duration": "0.017",
"OverallBitRate": "27720470",
"FrameRate": "23.976",
"FrameCount": "0",
"IsStreamable": "Yes",
"Encoded_Date": "UTC 2020-02-11 14:26:22",
"Encoded_Application": "HandBrake 1.3.1 2020010400",
"Encoded_Library": "Lavf58.29.100"
},
{
"@type": "Video",
"StreamOrder": "0",
"ID": "1",
"UniqueID": "1",
"Format": "VP8",
"CodecID": "V_VP8",
"Duration": "0.017000000",
"Width": "3840",
"Height": "2160",
"PixelAspectRatio": "1.000",
"DisplayAspectRatio": "1.778",
"FrameRate_Mode": "CFR",
"FrameRate": "23.976",
"FrameCount": "0",
"Compression_Mode": "Lossy",
"Delay": "0.000",
"Default": "Yes",
"Forced": "No"
}
]
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants