Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Blockly
  5. [gelöst] javascript.0 terminated with code NaN

NEWS

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    22
    1
    1.1k

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    9.2k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    14
    1
    2.4k

[gelöst] javascript.0 terminated with code NaN

Geplant Angeheftet Gesperrt Verschoben Blockly
blockly
3 Beiträge 2 Kommentatoren 215 Aufrufe 2 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • S Offline
    S Offline
    senior1418
    schrieb am zuletzt editiert von senior1418
    #1

    Node.js : v14.19.0
    js-controller 3.3.22
    Javascript v5.2.21

    Zur Simulation sollten alle 2 Sekunden Werte im Bereich 400 - 450 bzw. 14000 - 16000 geschrieben werden.

    2f01afc4-20bf-4285-9a91-79aedc548743-image.png
    Code dazu :

    var bool, Intervall, Intervall2;
    
    function mathRandomInt(a, b) {
     if (a > b) {
       // Swap a and b to ensure a is smaller.
       var c = a;
       a = b;
       b = c;
     }
     return Math.floor(Math.random() * (b - a + 1) + a);
    }
    
    
    while (!bool) {
     if (getState("0_userdata.0.Testsystem.Boolean").val) {
       Intervall = setInterval(async function () {
         setState("0_userdata.0.Testsystem.Number"/*Number*/, (mathRandomInt(400, 450)));
         console.log(getState("0_userdata.0.Testsystem.Number").val);
       }, 2000);
     } else {
       Intervall2 = setInterval(async function () {
         setState("0_userdata.0.Testsystem.Number"/*Number*/, (mathRandomInt(14500, 16000)));
         console.log(getState("0_userdata.0.Testsystem.Number").val);
       }, 2000);
     }
    }
    

    Das führt aber wiederholbar zu m Absturz der JavaScript Instanz.

    2022-02-19 08:07:04.443 - info: javascript.0 (1401) Start javascript script.js.Strom.Durchlauferhitzer.demo
    2022-02-19 08:08:07.750 - error: host.iobroker-test Caught by controller[0]: <--- Last few GCs --->
    2022-02-19 08:08:07.753 - error: host.iobroker-test Caught by controller[0]: [1401:0x5781770] 837893 ms: Mark-sweep (reduce) 2051.6 (2058.5) -> 2051.5 (2059.2) MB, 3538.5 / 0.0 ms (average mu = 0.079, current mu = 0.001) allocation failure scavenge might not succeed
    2022-02-19 08:08:07.753 - error: host.iobroker-test Caught by controller[0]: [1401:0x5781770] 841439 ms: Mark-sweep (reduce) 2052.5 (2056.2) -> 2052.4 (2058.2) MB, 3543.4 / 0.0 ms (average mu = 0.041, current mu = 0.001) allocation failure scavenge might not succeed
    2022-02-19 08:08:07.753 - error: host.iobroker-test Caught by controller[0]: <--- JS stacktrace --->
    2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[0]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
    2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[1]: 1: 0xa389b0 node::Abort() [io.javascript.0]
    2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[2]: 2: 0x96e0af node::FatalError(char const*, char const*) [io.javascript.0]
    2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[3]: 3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [io.javascript.0]
    2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[4]: 4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [io.javascript.0]
    2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[5]: 5: 0xd73fd5 [io.javascript.0]
    2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[6]: 6: 0xd74b5f [io.javascript.0]
    2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[7]: 7: 0xd8299b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [io.javascript.0]
    2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[8]: 8: 0xd8655c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [io.javascript.0]
    2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[9]: 9: 0xd54c3b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [io.javascript.0]
    2022-02-19 08:08:07.756 - error: host.iobroker-test Caught by controller[10]: 10: 0x109d21f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [io.javascript.0]
    2022-02-19 08:08:07.756 - error: host.iobroker-test Caught by controller[11]: 11: 0x1446379 [io.javascript.0]
    2022-02-19 08:08:07.756 - warn: host.iobroker-test instance system.adapter.javascript.0 terminated due to SIGABRT
    2022-02-19 08:08:07.756 - info: host.iobroker-test instance system.adapter.javascript.0 terminated with code NaN ()
    2022-02-19 08:08:07.756 - info: host.iobroker-test Restart adapter system.adapter.javascript.0 because enabled
    

    Könnte mir bitte jemand sagen wie ich das besser machen kann. Vielen Dank !

    AsgothianA 1 Antwort Letzte Antwort
    0
    • S senior1418

      Node.js : v14.19.0
      js-controller 3.3.22
      Javascript v5.2.21

      Zur Simulation sollten alle 2 Sekunden Werte im Bereich 400 - 450 bzw. 14000 - 16000 geschrieben werden.

      2f01afc4-20bf-4285-9a91-79aedc548743-image.png
      Code dazu :

      var bool, Intervall, Intervall2;
      
      function mathRandomInt(a, b) {
       if (a > b) {
         // Swap a and b to ensure a is smaller.
         var c = a;
         a = b;
         b = c;
       }
       return Math.floor(Math.random() * (b - a + 1) + a);
      }
      
      
      while (!bool) {
       if (getState("0_userdata.0.Testsystem.Boolean").val) {
         Intervall = setInterval(async function () {
           setState("0_userdata.0.Testsystem.Number"/*Number*/, (mathRandomInt(400, 450)));
           console.log(getState("0_userdata.0.Testsystem.Number").val);
         }, 2000);
       } else {
         Intervall2 = setInterval(async function () {
           setState("0_userdata.0.Testsystem.Number"/*Number*/, (mathRandomInt(14500, 16000)));
           console.log(getState("0_userdata.0.Testsystem.Number").val);
         }, 2000);
       }
      }
      

      Das führt aber wiederholbar zu m Absturz der JavaScript Instanz.

      2022-02-19 08:07:04.443 - info: javascript.0 (1401) Start javascript script.js.Strom.Durchlauferhitzer.demo
      2022-02-19 08:08:07.750 - error: host.iobroker-test Caught by controller[0]: <--- Last few GCs --->
      2022-02-19 08:08:07.753 - error: host.iobroker-test Caught by controller[0]: [1401:0x5781770] 837893 ms: Mark-sweep (reduce) 2051.6 (2058.5) -> 2051.5 (2059.2) MB, 3538.5 / 0.0 ms (average mu = 0.079, current mu = 0.001) allocation failure scavenge might not succeed
      2022-02-19 08:08:07.753 - error: host.iobroker-test Caught by controller[0]: [1401:0x5781770] 841439 ms: Mark-sweep (reduce) 2052.5 (2056.2) -> 2052.4 (2058.2) MB, 3543.4 / 0.0 ms (average mu = 0.041, current mu = 0.001) allocation failure scavenge might not succeed
      2022-02-19 08:08:07.753 - error: host.iobroker-test Caught by controller[0]: <--- JS stacktrace --->
      2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[0]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
      2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[1]: 1: 0xa389b0 node::Abort() [io.javascript.0]
      2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[2]: 2: 0x96e0af node::FatalError(char const*, char const*) [io.javascript.0]
      2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[3]: 3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [io.javascript.0]
      2022-02-19 08:08:07.754 - error: host.iobroker-test Caught by controller[4]: 4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [io.javascript.0]
      2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[5]: 5: 0xd73fd5 [io.javascript.0]
      2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[6]: 6: 0xd74b5f [io.javascript.0]
      2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[7]: 7: 0xd8299b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [io.javascript.0]
      2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[8]: 8: 0xd8655c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [io.javascript.0]
      2022-02-19 08:08:07.755 - error: host.iobroker-test Caught by controller[9]: 9: 0xd54c3b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [io.javascript.0]
      2022-02-19 08:08:07.756 - error: host.iobroker-test Caught by controller[10]: 10: 0x109d21f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [io.javascript.0]
      2022-02-19 08:08:07.756 - error: host.iobroker-test Caught by controller[11]: 11: 0x1446379 [io.javascript.0]
      2022-02-19 08:08:07.756 - warn: host.iobroker-test instance system.adapter.javascript.0 terminated due to SIGABRT
      2022-02-19 08:08:07.756 - info: host.iobroker-test instance system.adapter.javascript.0 terminated with code NaN ()
      2022-02-19 08:08:07.756 - info: host.iobroker-test Restart adapter system.adapter.javascript.0 because enabled
      

      Könnte mir bitte jemand sagen wie ich das besser machen kann. Vielen Dank !

      AsgothianA Offline
      AsgothianA Offline
      Asgothian
      Developer
      schrieb am zuletzt editiert von Asgothian
      #2

      @senior1418
      Was besser machen …

      • Das ‘wiederhole solange’ weg.
      • um das ‘falls Wert’ einen Baustein aus dem trigger Bereich legen, trigger auf den gleichen datenpunkt, wurde geändert
      • vor dem falls noch ein ‘anhalten intervall’ und ein ‘anhalten intervall2’ und es sollte gut aussehen.

      A.

      ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
      "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

      S 1 Antwort Letzte Antwort
      0
      • AsgothianA Asgothian

        @senior1418
        Was besser machen …

        • Das ‘wiederhole solange’ weg.
        • um das ‘falls Wert’ einen Baustein aus dem trigger Bereich legen, trigger auf den gleichen datenpunkt, wurde geändert
        • vor dem falls noch ein ‘anhalten intervall’ und ein ‘anhalten intervall2’ und es sollte gut aussehen.

        A.

        S Offline
        S Offline
        senior1418
        schrieb am zuletzt editiert von
        #3

        @asgothian

        vielen Dank, so läuft das. Per Schleife immer neue Intervalle zu erzeugen bringen das Fass zum überlaufen.

        .. glaube ich hab's :-)

        1 Antwort Letzte Antwort
        0
        Antworten
        • In einem neuen Thema antworten
        Anmelden zum Antworten
        • Älteste zuerst
        • Neuste zuerst
        • Meiste Stimmen


        Support us

        ioBroker
        Community Adapters
        Donate

        434

        Online

        32.5k

        Benutzer

        81.7k

        Themen

        1.3m

        Beiträge
        Community
        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
        ioBroker Community 2014-2025
        logo
        • Anmelden

        • Du hast noch kein Konto? Registrieren

        • Anmelden oder registrieren, um zu suchen
        • Erster Beitrag
          Letzter Beitrag
        0
        • Home
        • Aktuell
        • Tags
        • Ungelesen 0
        • Kategorien
        • Unreplied
        • Beliebt
        • GitHub
        • Docu
        • Hilfe