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

Momento on the Network #8

Closed
toddpi314 opened this issue Aug 12, 2013 · 1 comment
Closed

Momento on the Network #8

toddpi314 opened this issue Aug 12, 2013 · 1 comment

Comments

@toddpi314
Copy link

Having issues getting the load method to work on a serialized network (configuration).

When using the load, I am seeing a nodejs process abort.
After investigating, I can bypass the abort by editing the NNet::CreateFromFile method in the fan-create class impl.

Handle<Value> NNet::CreateFromFile(const Arguments &args)
{
    HandleScope scope;
    if (args.Length() != 1 || !args[0]->IsString())
        return VException("usage: new FANN.load(\"filename.nnet\")");

    char name[4096];
    String::Cast(*args[0])->WriteAscii(name, 0, 4096);
    // name[4095] = 0;  <=== comment this out!  

    FANN = fann_create_from_file(name); 

    return Undefined();
}

Beyond this, once the wrapped fann instance is available in Node, i get segment faults when attempting to interact with it:

PID 47970 received SIGSEGV for address: 0x11
0   segfault-handler-native.node        0x0000000100ca4b8b _ZL16segfault_handleriP9__siginfoPv + 191
1   libsystem_c.dylib                   0x00007fff8d92094a _sigtramp + 26
2   node                                0x000000010031e2f7 _ZN2v88internal9Assembler4movqENS0_8RegisterENS0_6HandleINS0_6ObjectEEENS0_9RelocInfo4ModeE + 199
3   fann.node                           0x0000000100caac8d _ZN4NNet3RunERKN2v89ArgumentsE + 283
4   node                                0x0000000100147038 _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 456
5   ???                                 0x00002a6a8070618e 0x0 + 46636909748622
6   ???                                 0x00002a6a8078e71e 0x0 + 46636910307102

Has anyone on the author team attempted to read/write a network?

@rlidwka
Copy link
Owner

rlidwka commented Sep 20, 2013

Has anyone on the author team attempted to read/write a network?

Yes, and it works here on 3.8.0-30-generic x86_64 linux kernel. That's why we probably missed it. But it is a bug all right.

I believe it's now fixed by #9.

@rlidwka rlidwka closed this as completed Sep 20, 2013
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

2 participants