Debugging Perl script using threads fails

Hi!

Not sure if this belongs here, so according to About the Support category , I hope you will tell me.

When I run a script in Komodo IDE that can be found on Perlmonks (http://www.perlmonks.org/?abspart=1;displaytype=displaycode;node_id=585551;part=1), I get an error message:

Modification of a read-only value attempted at C:/Program Files (x86)/ActiveState Komodo IDE 9/lib/support/dbgp/perllib/perl5db.pl line 4380.

Running the very same script on the command prompot without Komodo IDE works fine.

Best regards,
Alex

Hi @capfan,

What is the command?

Also, run %perl -v in Tools > Run Command then run the same command without the % in your CMD. This is to make sure Komodo and your terminal are using the same Perl.

What version of Komodo? (Help > About Komodo)
What version of Windows?

  • Carey

Hi @careyh,

the command in the command prompt is simply the script, or perl threads-perlmonks.pl.
In the command prompt, I guess this is the Perl used:

> where perl
C:\Perl\bin\perl.exe

In Komodo IDE, I was unfortunately not able to do exactly what you wanted. Running Tools > Run Command > %perl -v yields an error: Unknown error running: 'c:\perl\bin\perl.exe -v'.
In the Komodo IDE log file, the following occurs:

[2015-10-01 09:18:05,861] [INFO] Startup: Welcome to Komodo IDE 9.2.1 build 87651 (platform win32-x86, running on Windows post2012Server version 6.3.9600)
[2015-10-01 09:18:05,878] [INFO] Startup: C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\komodo.exe built on Tue Sep 01 17:19:15 2015
[2015-10-01 09:18:06,720] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in resource://gre/modules/Preferences.jsm:381
[2015-10-01 09:18:06,783] [WARNING] root: ko.logging has been converted to a CommonJS module; use require("ko/logging") instead (since Komodo 9.0.0a1).
    @chrome://komodo/content/komodo.js:15:1

[2015-10-01 09:18:07,440] [ERROR] console-logger: bad script XDR magic number (0) in :0
Traceback (most recent call last):
  File "", line 0, in 

[2015-10-01 09:18:08,970] [WARNING] root: ko.findresults was already loaded, re-creating it.

[2015-10-01 09:18:10,581] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in file:///C:/Program%20Files%20(x86)/ActiveState%20Komodo%20IDE%209/lib/mozilla/components/koamAddonManager.js:138
[2015-10-01 09:18:11,533] [INFO] komodospellchecker: Spell checker loaded.
[2015-10-01 09:18:11,533] [INFO] komodospellchecker: Using dictionary en-US
[2015-10-01 09:18:28,671] [WARNING] console-logger: Key event not available on GTK2: key="u" modifiers="control,shift" (1) in chrome://komodo/content/komodo.xul:0
[2015-10-01 09:18:28,671] [WARNING] console-logger: Key event not available on some keyboard layouts: key="v" modifiers="control,alt" (1) in chrome://komodo/content/komodo.xul:0
[2015-10-01 09:18:32,845] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,845] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,845] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,848] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,849] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,851] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,851] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,851] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,852] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,854] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,855] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,855] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,857] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,858] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,858] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,858] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,859] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,861] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,861] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,862] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,864] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,865] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,865] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,867] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,868] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,868] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,868] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,869] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:18:32,869] [WARNING] koLanguageServiceBase: Found non-positive guess
[2015-10-01 09:23:33,220] [ERROR] dbgp.server: session cmdloop exception - sending session stop command
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\dbgp\serverBase.py", line 66, in _cmdloop
    self._handleIncoming()
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\dbgp\serverBase.py", line 140, in _handleIncoming
    newdata = self._socket.recv(1024)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
[2015-10-01 09:23:44,647] [ERROR] process: process.py: can't execute None (C:\Windows\system32\cmd.exe; /c c:\perl\bin\perl.exe -v)
ERROR:xpcom:Unhandled exception calling 'int8 * RunInTerminal(in wstring, in wstring, in wstring, in nsISomething, in nsISomething, in unicode &, out retval nsISomething);'
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\xpcom\server\policy.py", line 300, in _CallMethod_
    return 0, func(*params)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\components\koRunService.py", line 935, in RunInTerminal
    p = runutils.KoTerminalProcess(command, cwd=cwd, env=envDict)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\runutils.py", line 150, in __init__
    self._process = process.ProcessOpen(cmd, cwd=cwd, env=env)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\process.py", line 319, in __init__
    creationflags=flags)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\python\lib\subprocess.py", line 711, in __init__
    errread, errwrite)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\process.py", line 139, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
[2015-10-01 09:24:01,240] [ERROR] process: process.py: can't execute None (C:\Windows\system32\cmd.exe; /c c:\perl\bin\perl.exe -v)
ERROR:xpcom:Unhandled exception calling 'int8 * RunInTerminal(in wstring, in wstring, in wstring, in nsISomething, in nsISomething, in unicode &, out retval nsISomething);'
Traceback (most recent call last):
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\xpcom\server\policy.py", line 300, in _CallMethod_
    return 0, func(*params)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\components\koRunService.py", line 935, in RunInTerminal
    p = runutils.KoTerminalProcess(command, cwd=cwd, env=envDict)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\runutils.py", line 150, in __init__
    self._process = process.ProcessOpen(cmd, cwd=cwd, env=env)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\process.py", line 319, in __init__
    creationflags=flags)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\python\lib\subprocess.py", line 711, in __init__
    errread, errwrite)
  File "C:\Program Files (x86)\ActiveState Komodo IDE 9\lib\mozilla\python\komodo\process.py", line 139, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
[2015-10-01 09:24:38,144] [WARNING] console-logger: Key event not available on GTK2: key="u" modifiers="control,shift" (1) in chrome://komodo/content/tail/tail.xul:0
[2015-10-01 09:24:38,144] [WARNING] console-logger: Key event not available on some keyboard layouts: key="v" modifiers="control,alt" (1) in chrome://komodo/content/tail/tail.xul:0

This is Komodo IDE, version 9.2.1, build 87651, platform win32-x86.
Built on Tue Sep 01 17:19:15 2015.

The OS is Windows 8.1 Enterprise x64.

I did a complete reset and re-installation recently. So I’m a bit lost now how to proceed :frowning:

Could you explain the “using threads” portion of your title?

Sure.

The script I mentioned uses threads:

# Libraries
use threads;
use threads::shared;
use Thread::Queue;

Scripts that do not use threads work fine. I did have this issue in the past when coding threaded GUI applications, so I assumed it was relevant.

@capfan Were you able to debug your threading Perl code in Komodo?
I am having a similar problem.
I am disappointed that no one at Active State has contributed to the discussion.

Hi @jrheisey,

no, I did not find a solution to this issue yet, sorry.

About your disappointment: Clarification is needed: ActiveState did contribute to the discussion, they did simply not yet manage to do something about it.

I started learning C# for the threaded stuff. The language has its quirks, too, but at least, the IDEs do work flawlessly.

This happens with threads if they go silent. We must have missed your last reply @capfan. Apologies for that. No we haven’t made progress on this issue.

@jrheisey, when you’ve filed a new bug report please post it back here.

  • Carey

Here is a bug report.