3

Platform: windows 7 32bit, erlang R15B01.

I have developed an erlang server that simultaneously listens to 200 different tcp ports (200 gen_servers)

After a few minutes of moderate load(few clients in parallel) the entire node just freezes completely - even the shell freezes entirely.

How can this problem get diagnosed? is there a standard erlang approach for those kind of problems? (memory consumption was low ,so its not some kind of memory leak)

Important Edit

It seems that under werl.exe there is no such problem. only under erl.exe. Probably same as in http://erlang.2086793.n4.nabble.com/erl-exe-dies-but-werl-exe-does-not-on-both-Windows-XP-and-2008R2-with-R14B01-td3335030.html

GabiMe
  • 18,105
  • 28
  • 76
  • 113

2 Answers2

7

If you kill your process with kill -SIGUSR1 <pid>, the erlang VM will generate a erlang crash dump file erl_crash.dump in the directory the app was started.

Then you can analyze it using the crash dump viewer.

Isac
  • 2,058
  • 16
  • 23
  • right. but this is a start. i could use also http://stackoverflow.com/questions/4672572/how-can-i-configure-windows-to-generate-a-core-dump-from-an-application – GabiMe Jul 31 '12 at 21:58
  • This problem only happens in windows. How can I force a dump file under windows? I tried using procdump but it creates a non-erlang dump that the viewer does not understand – GabiMe Aug 05 '12 at 09:10
  • Maybe you can go to Task Manager and kill the VM. – Ethan Aug 05 '12 at 12:15
  • @Ethan. The problem is that erlang stops working. killing it using TM is easy – GabiMe Aug 05 '12 at 12:20
  • Is the erlang VM completely frozen? If not, you can force a crash using the shell: erlang:halt("crash"). – Isac Aug 06 '12 at 13:42
  • The equivalent command under Windows is `taskkill` (that is, `taskkill /PID `). Not sure whether that will allow Erlang to generate a crash dump, though. – Brilliand Aug 06 '12 at 23:53
0

A frozen erlang shell can be caused by uncaught exit signals. You can try to trap exits in the shell process (assuming it is the parent process of your server) which should give you the exit reason. See Reference manual on Errors

Jan
  • 23
  • 3