ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 655 forks source link

ionic serve: segmention fault (core dumped) on WSL Ubuntu 18.04 #3991

Open renatop7 opened 5 years ago

renatop7 commented 5 years ago

Description:

When I try to use ionic serve I get the following output:

> ng run app:serve --host=0.0.0.0 --port=8100
Segmentation fault (core dumped)

If I use npx ng serve it works and I can load my app on my browser.

One strange thing is that when I use ionic serve it breaks my WSL instance, I can no longer connect to the internet through the terminal, for example, if I try to install some package the connection hangs and never downloads it, until it finally times out.

It even mess with my Windows internet connection and I have to restart the WSL container to make it work normally again, it feels like some kind of proxy is acting.

Output:

ionic serve --verbose

  ionic:lib Terminal info: { tty: true, ci: false, windows: false } +0ms
  ionic:lib CLI global options: { _: [ 'serve' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +5ms
  ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
  ionic:lib:project Project details: { configPath: '/home/renatop/projects/medico-aqui/ionic.config.json', errors: [], context: 'app', type: 'angular' } +1ms
  ionic Context: { binPath: '/home/renatop/.nvm/versions/node/v10.15.3/lib/node_modules/ionic/bin/ionic', libPath: '/home/renatop/.nvm/versions/node/v10.15.3/lib/node_modules/ionic', execPath: '/home/renatop/projects/medico-aqui', version: '4.12.0' } +0ms
  ionic:lib:telemetry Sending telemetry for command: 'ionic serve' [ '--verbose', '--interactive', '--color' ] +0ms
  ionic:lib:hooks Looking for ionic:serve:before npm script. +0ms
  ionic:utils-network checking for open port on 0.0.0.0:8100 +0ms
  ionic:utils-network checking for open port on 127.0.0.1:8100 +4ms
  ionic:utils-network checking for open port on ::1:8100 +1ms
  ionic:utils-network checking for open port on 192.168.1.100:8100 +1ms
  ionic:utils-network checking for open port on fe80::41e8:5654:e7ce:a1e4:8100 +1ms
  ionic:lib:serve Looking for ionic:serve npm script. +0ms
> ng run app:serve --host=0.0.0.0 --port=8100
[ng] Fri, 24 May 2019 23:50:57 GMT portfinder:defaultHosts exports._defaultHosts is: [ '0.0.0.0', '127.0.0.1', '::1', '192.168.1.100', 'fe80::41e8:5654:e7ce:a1e4', null ]
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback: host is 0.0.0.0
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort entered testPort(): trying 0.0.0.0 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort done w/ testPort(): OK 0.0.0.0 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback: host is 127.0.0.1
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort entered testPort(): trying 127.0.0.1 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort done w/ testPort(): OK 127.0.0.1 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback: host is ::1
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort entered testPort(): trying ::1 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort done w/ testPort(): OK ::1 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback: host is 192.168.1.100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort entered testPort(): trying 192.168.1.100 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort done w/ testPort(): OK 192.168.1.100 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback: host is fe80::41e8:5654:e7ce:a1e4
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort entered testPort(): trying fe80::41e8:5654:e7ce:a1e4 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort done w/ testPort(): OK fe80::41e8:5654:e7ce:a1e4 port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback: host is null
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort entered testPort(): trying null port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:testPort done w/ testPort(): OK null port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() iteration callback testPort() callback with a success for port 8100
[ng] Fri, 24 May 2019 23:50:59 GMT portfinder:getPort in eachSeries() result callback: openPorts is [ 8100, 8100, 8100, 8100, 8100, 8100 ]
  ionic:lib:serve awaiting TCP connection to 0.0.0.0:8100 +4s
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "x-powered-by" to true
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "etag" to 'weak'
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "etag fn" to [Function: generateETag]
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "env" to 'development'
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "query parser" to 'extended'
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "query parser fn" to [Function: parseExtendedQueryString]
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "subdomain offset" to 2
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "trust proxy" to false
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "trust proxy fn" to [Function: trustNone]
[ng] Fri, 24 May 2019 23:50:59 GMT express:application booting in development mode
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "view" to [Function: View]
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "views" to '/home/renatop/projects/medico-aqui/views'
[ng] Fri, 24 May 2019 23:50:59 GMT express:application set "jsonp callback name" to 'callback'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router use '/' query
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router use '/' expressInit
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route new '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route acl '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route bind '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route checkout '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route connect '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route copy '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route delete '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route get '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route head '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route link '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route lock '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route m-search '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route merge '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route mkactivity '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route mkcalendar '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route mkcol '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route move '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route notify '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route options '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route patch '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route post '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route propfind '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route proppatch '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route purge '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route put '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route rebind '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route report '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route search '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route source '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route subscribe '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route trace '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route unbind '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route unlink '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route unlock '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:route unsubscribe '*'
[ng] Fri, 24 May 2019 23:50:59 GMT express:router:layer new '/'
Segmentation fault (core dumped)

My ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/home/renatop/.nvm/versions/node/v10.15.3/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.4.2
   @angular-devkit/build-angular : 0.10.7
   @angular-devkit/schematics    : 7.0.7
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : not available
   Cordova Plugins       : not available

System:

   NodeJS : v10.15.3 (/home/renatop/.nvm/versions/node/v10.15.3/bin/node)
   npm    : 6.4.1
   OS     : Linux 4.4

Other Information:

Win10 - Version 1809

Piturd commented 5 years ago

Same here Any solutions?

brane53 commented 5 years ago

Oh my gosh, this is happening to me too! Experienced it on the exact same day @renatop7 did, ironically enough. I thought I was going crazy. The whole internet connection went to crap after running ionic serve. Had to fall back to ng serve, but not after having to restart my computer.

imhoffd commented 5 years ago

What happens if you try npx ng serve --host=0.0.0.0 ?

renatop7 commented 5 years ago

What happens if you try npx ng serve --host=0.0.0.0 ?

Works just like npx ng serve

florianmonfort commented 4 years ago

Hi all

I get a segmentation fault (core dumped) error every time I try to run ionic after switching branches in my current repository or after stopping the current server.

I get the following result:

`➜ diningcity-assistant git:(issue-2381) ionic serve

ng run app:serve --host=localhost --port=8100 [INFO] Waiting for connectivity with ng... [INFO] Waiting for connectivity with ng... [1] 177 segmentation fault (core dumped) ionic serve`

Doing npx ng serve does not solve it and I get errors as well.

What's really strange is that it works well the first time, it's only after trying to start the server a second time afterwards that it breaks.

florianmonfort commented 4 years ago

For additional information I have found that shutting down the WSL instance and re-starting it is the only way I found to run it again, so I have to do it every single time:

wsl.exe -t ubuntu