Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

how to fix "Segmentation fault", execute node.js on Android device? #8455

Closed
jaffwu opened this issue Sep 26, 2014 · 5 comments
Closed

how to fix "Segmentation fault", execute node.js on Android device? #8455

jaffwu opened this issue Sep 26, 2014 · 5 comments

Comments

@jaffwu
Copy link

jaffwu commented Sep 26, 2014

su
node /sdcard/server.js
[1] + Stopped (signal)
[1] + Segmentation fault


android version: 2.3.3 root
server.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8081);
console.log('Server running at http://localhsot:8081/');

@indutny
Copy link
Member

indutny commented Sep 26, 2014

What node.js version are you trying to run and how have you built it?

@jaffwu
Copy link
Author

jaffwu commented Sep 26, 2014

node.js version is 0.11.14
ndk version is android-ndk32-r10-linux-x86

./android-configure
make

@indutny
Copy link
Member

indutny commented Sep 26, 2014

Do you have gdb or some other debugger there? Could you try gdb --args node /sdcard/server.js then run and bt once it segfault?

@jaffwu
Copy link
Author

jaffwu commented Sep 26, 2014

i try gdb
this is result:

(gdb) bt
#0  0x70001000 in ?? ()
Cannot access memory at address 0x0
#1  0x00000000 in ?? ()
(gdb) bt
#0  0x70001000 in ?? ()
#1  0x00000000 in ?? ()
(gdb) bt
#0  0x70001000 in ?? ()
#1  0x00000000 in ?? ()
(gdb) bt
#0  0x70001000 in ?? ()
#1  0x00000000 in ?? ()
(gdb) c
Continuing.
Cannot access memory at address 0x0

Program received signal SIGILL, Illegal instruction.
0x002dbb08 in ?? ()
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x6fd15ca4 in ?? ()
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x6fd15ca4 in ?? ()
(gdb) c
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)

@javihernandez
Copy link

@jaffwu, JFYI

your example works perfectly on my android device.
I'm using node-v0.13.0-pre built against android-ndk-r9d.

@Trott Trott closed this as completed Apr 22, 2023
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

4 participants