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

Archlinux seemingly not working locally with current master #40

Closed
ysangkok opened this issue Feb 24, 2015 · 5 comments
Closed

Archlinux seemingly not working locally with current master #40

ysangkok opened this issue Feb 24, 2015 · 5 comments

Comments

@ysangkok
Copy link
Contributor

Which version is in service on copy.sh/v86? I'm trying to get Archlinux running locally, but I get the error: "Cannot read property 'length' of undefined" on state.js:338, which means that buffer_infos is missing. I suspect this is because the snapshot format changed after the snapshot was made. If I can check out the old version locally, I assume I could get the snapshot to run.

Thank you.

@ysangkok
Copy link
Contributor Author

oh wait, i also get the error on http://copy.sh/v86/debug.html?profile=archlinux

how can it be that the error doesn't occur in production mode? is it because the length is actually unused and the closure compiler optimizes it out?

@copy
Copy link
Owner

copy commented Feb 25, 2015

This is a weakness in the saving/restoring mechanism. It's essentially an extended version of JSON.parse and JSON.stringify, with extra handling for array buffers, typed arrays and skipping certain properties. Since properties names are changed during compilation, the snapshots cannot be shared between minified and unminified versions.

As an alternative, all properties would need to be written out explicitly, for example like this:

RTC.prototype.save_state = function()
{
    return [
        this.cmos_index,
        this.boot_order,
        // ...
    ];
};

RTC.prototype.restore_state = function(state)
{
    this.cmos_index = state[0];
    this.boot_order = state[1];
    // ...
};

That's probably a better strategy to implement this (but more complex), and I'll leave the issue open for this purpose. It's not high on my priority list at the moment, though.

Fixing this would also allow using state buffers between different versions of the emulator, assuming no changes to the state format are made. Closure Compiler renames properties differently even if minor changes are made to the code.

An alternative would be to switch to a less aggressive minifier. In my opinion, dead code elimination and linting are too useful to switch away from Closure Compiler.

@copy
Copy link
Owner

copy commented May 18, 2015

This problem has been annoying me, because I had to rebuild the Archlinux image after every code change and couldn't even build it with a script.

It's fixed now: State images should work between different builds of the emulator and after rebuilds.

@copy copy closed this as completed in f82373d May 18, 2015
@iAmInActions
Copy link

im encountering the error on the latest build with ubuntu 10.04. my save works on the online version but not my local build.

error is:

Uncaught TypeError: a[1] is undefined
    G file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:65
    G file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:101
    G file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:81
    G file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:262
    Od file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:202
    Od file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:62
    n file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:364
    g file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:365
    setTimeout handler*bf/t< file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    t file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    t file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    t file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    t file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:368
    bf file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:369
    done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:360
    promise callback*done file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:360
    onload file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:346
    a file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:345
    Pa file:///home/actionguy/Projects/wasm-linux-vm/v86_all.js:360
    onload file:///home/actionguy/Projects/wasm-linux-vm/index.html:31
    EventHandlerNonNull* file:///home/actionguy/Projects/wasm-linux-vm/index.html:29
v86_all.js:65:240

@copy
Copy link
Owner

copy commented Dec 5, 2021

@iAmInActions Can you open the file in debug.html and post the error again?

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

No branches or pull requests

3 participants