Skip to main content

Questions tagged [debugging]

Questions about debugging techniques, using the built-in debugger, and/or the Wolfram Workbench debugger.

55 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
0 answers
254 views

RuntimeTools insight?

Does anyone happen to have some more complete insight into the RuntimeTools package that is used by Debug and Workbench? I ask ...
flip's user avatar
  • 1,800
10 votes
0 answers
127 views

How to setup logging levels?

I was wondering what tools exist out there for doing logging in Mathematica? The Echo functions is nice, but I'd like to set various severity levels and other ...
user5601's user avatar
  • 3,655
9 votes
0 answers
187 views

A bug in Derivative?

Update This is a bug in v11.3 or earlier and is fixed in v12. Original Post Check this out: ...
luyuwuli's user avatar
  • 2,814
8 votes
0 answers
298 views

Is there a way to update Workbench 2.0 to recognize Mathematica 9, 10 and 10.1 functions?

Is there a way to add newer functions to a configuration file so that Workbench 2.0 is useable for development with 10.1? Also, are there changes that can be made so that Workbench 2.0 can be used to ...
Doug Kimzey's user avatar
  • 2,279
7 votes
0 answers
120 views

Understanding the profiler: Is pattern matching/de-structuring expensive?

I was profiling some code and I am trying to understand what the results mean. Suppose we have the very idiomatic, ...
ITA's user avatar
  • 393
7 votes
0 answers
93 views

Logging modules in Mathematica?

Is there any logging module or functions or scripts that one can use to store all the information of what happens during executing mathematica program in Wolfram? For example, one might look up log....
Xuemei's user avatar
  • 1,616
6 votes
0 answers
89 views

In over my head in trying to create a debugger

Apologies for a less than ideal question, but if I could have asked a good question the answer would probably have been revealed in the process... In answer to this question @LeonidShifrin gave some -...
Julian Moore's user avatar
  • 2,560
6 votes
0 answers
183 views

Is there a package or canonical way for writing test harnesses in Mathematica?

I've written a complicated function foo.1 I'd now like to simplify this function's code, and later enhance it with more features. With each change, however, I'd ...
Andrew Cheong's user avatar
5 votes
0 answers
227 views

FindGeometricTransform not working properly for a simple problem

I am surprised why FindGeometricTransform is failing to automatically register or align two sets of points that are drawn from a ...
Ali Hashmi's user avatar
  • 8,960
5 votes
0 answers
114 views

Visually identifying differences between two Mathematica functions

Context Let us assume we have two functions defined in Mathematica. I am interested in spotting the differences in the code for the two functions. Example ...
chris's user avatar
  • 23k
5 votes
0 answers
440 views

Profiling in Mathematica

This is meant as a broad question, because I couldn't find such a discussion on this topic (the questions I found are very old and basic, e.g. the most popular one only shows where to find Mathematica'...
Jansen's user avatar
  • 1,223
5 votes
0 answers
108 views

Techniques in debugging with preview of possibly large expressions + garbage collection issues

First of all, all appreciate all suggestions how to rephrase the title to make it more friendly. Here's the background: Let's say your top level procedure flow is complicated, involves url calls, ...
Kuba's user avatar
  • 137k
5 votes
0 answers
396 views

Syntax error for optional pattern, but only in debugger

This expression (explained here by Leonid) evaluates fine unless Evaluation->Debugger is enabled: h[x : (_Integer) : 1] := x Syntax::sntxf: "x:" cannot be ...
ssch's user avatar
  • 16.6k
4 votes
0 answers
99 views

JoinAcross Memory Leak

I believe JoinAcross may have a memory leak but would appreciate some help looking at it. It appears to be small when used just once but when iterated a lot it eventually crashes my wolframscripts. I'...
rfrasier's user avatar
  • 592
4 votes
0 answers
109 views

Why does the debugger not stop when a message is generated?

I am on version 10.1. I have enabled the debugger and I have checked the box in front of "Break at Messages" in the Debugger Tools Window. However most the time the debugger does not stop when a ...
Jacob Akkerboom's user avatar
3 votes
0 answers
92 views

Partial trace of a $n \times n$ square matrix

I would like to create a function to compute the partial of a general matrix. I came across to the following code for a 4x4 matrix: ...
Gabriele Stevanato's user avatar
3 votes
0 answers
62 views

Package code problems with Mechanical Involute Gears

I've been playing around with with the old library archived package "Mechanical Involute Gears" The package has some broken things, namely those having to do with utf8 and a ...
DrMrstheMonarch's user avatar
3 votes
0 answers
106 views

Getting a Stack Trace on parallel execution

I find debugging very difficult in Mathematica, perhaps because I am unfamiliar with the appropriate tools. Ideally, I would like a "break on error" like Matlab with step control, however for the ...
bjorne's user avatar
  • 569
3 votes
0 answers
304 views

Issues with methods of FindMinimum

I'm trying to use the function FindMinimum for portfolio optimization in stead of NMinimize, since the latter is a lot slower. Also because the variance function of my portfolio is convex, locally ...
Karel de Wit's user avatar
3 votes
0 answers
144 views

Does anyone have a debugger that works in version 10.+?

Bug introduced in 10.0.2 and fixed in 10.2.0 The debugger from mma version 10.0 to 10.1.0 is broken for me. I have Windows 8.1 64-bit. When I step through a function using the debugger then the ...
Vilis Nams's user avatar
2 votes
0 answers
38 views

How can I see the invocation stack of functions together with their arguments after Interrupt?

I know that by pressing Alt+comma, I can interrupt a running task. This brings me to an interactive environment as if there would have been a command Interrupt[] (...
Adalbert Hanßen's user avatar
2 votes
0 answers
573 views

Unknown Box Name (ToBoxes) Error

I'm getting the following error in Mathematica What is going on? How do I avoid such an error? In order to roughly understand how I'm getting this error, here is a bit of context: I'm using ...
sam wolfe's user avatar
  • 4,863
2 votes
0 answers
56 views

Trace reveals unexpected evaluations and internal calls for recursive function

I would like some help in identifying the problem in my implementation of the recursive function shown below. But first, a bit of background. There is a well-known solution to the problem of finding ...
Shredderroy's user avatar
  • 5,251
2 votes
0 answers
276 views

Profiling - workarounds/fixes for unreliable RuntimeTools`Profile? Update added Clue

[MMA 11.0.1.0 Win 10 64-bit] I have tried using RuntimeTools`Profile manually and the most useful profile[] function provided by @Carl-Woll in this answer. Sadly, neither work reliably and the ...
Julian Moore's user avatar
  • 2,560
2 votes
0 answers
126 views

Piecewise function Syntax error only in debug mode

If I enter the following through mathematica (11.0) through UI $$\begin{cases} 1 &x \geq 0 \\ 0 &True \end{cases}$$ No error is reported. $$\begin{cases} 1 &x \geq 0 \\ 0 &True \end{...
Neel Basu's user avatar
  • 961
2 votes
0 answers
73 views

What are the idiosyncrasies which are worked around in these two MSE answers?

In the question here, Mr.Wizard gives the following code: ...
Shwouchk's user avatar
  • 507
2 votes
0 answers
437 views

How to debug an existing notebook in Workbench

I have an existing notebook that I want to debug in workbench. This notebook is a self contained program that does not use any .m files. From what I can tell from the Workbench documentation you can'...
Whose's user avatar
  • 213
2 votes
0 answers
105 views

Is it possible to pipe the output of EvaluationMonitor to Excel?

I have an EvaluationMonitor setup to capture the points processed by NIntegrate. This is a case where the same function, integrated over the same region in cartesian coordinates yields a dramatically ...
Doug Kimzey's user avatar
  • 2,279
2 votes
0 answers
176 views

Find where an error occurred in a bunch of command line scripts

I have been using my intuition to solve errors in my Mathematica scripts. But when calculations got more complex and I started getting errors involving code in more participating scripts (a script ...
carlosayam's user avatar
  • 2,080
1 vote
0 answers
37 views

ParametricNDSolve computation time is sensitive to the range of independent variable

My code to solve a system of nonlinear differential equations are the following: ...
user280016's user avatar
1 vote
0 answers
139 views

"Show Stack Trace" option always missing from error context menu

According to the Wolfram Language documentation, there should be an option in the context menu to see the stack trace: But I never see that option in my context menus: Is there a specific global ...
Shredderroy's user avatar
  • 5,251
1 vote
0 answers
154 views

How to print local variable when assertion failed

Given the following code: func[i_] := Module[{k}, k = i; Assert[k > 0, k]]; func[-1] The output is: ...
Chris Guo's user avatar
  • 149
1 vote
0 answers
48 views

Is it possible to trigger some Mathematica code when an error of the type StringTake::take happens?

I process data from various sources (databases) that are formatted very inconsistently. I would like to be able to process them finally summarized in one piece. My code consists of many cases of ...
Adalbert Hanßen's user avatar
1 vote
0 answers
53 views

Clean startup with back up

Whenever there are bugs Wolfram Support suggests to do a clean restart by holding Ctrl + Shift during start-up (often they recommend that without even warning the user that this will delete all their ...
Kvothe's user avatar
  • 4,491
1 vote
0 answers
60 views

How to change Echo output font size including EchoLabel within an entire Notebook?

I am creating a notebook template. I have Input and Output font size set at 10 but the Echo font size is 12. How do I change Echo to font size of 10? I cannot find a setting for this in Option ...
Jules Manson's user avatar
  • 2,467
1 vote
0 answers
55 views

Can Mathematica warn you about mistyped variables?

In other dynamical programming languages like Python, mistyping a variable, e.g. mistyping var1 as bar1 in the example below, immediately results in an error. ...
felix's user avatar
  • 549
1 vote
0 answers
62 views

Finding a selected expression

How can I find all expressions matching the one I am selecting? This features exists in Matlab and is quite helpful: Just trying to make my debugging easier. Thanks!
MathematicaUser's user avatar
1 vote
0 answers
38 views

How to run the newly created notebook "anonymously"?

How to test the autonomy of all calculations on .nb, i.e. run it so that it does not use existing variables from other .nb executables? And if it refers to a variable you did not create yourself to ...
Slepecky Mamut's user avatar
1 vote
0 answers
149 views

Catch unevaluated integral

I have a lot of integrals to evaluate. So, I do that in loops. Most of the integrals are solved with no problems and I enjoy it. But some of the integrals generate error messages like Infinity::indet ...
Shinrei's user avatar
  • 167
1 vote
1 answer
155 views

Debugging parallelized code

Is it possible to add a stack trace for this parallelized code to see where the problems stem from? ...
user49047's user avatar
  • 791
0 votes
0 answers
51 views

Printing the value of a function crashes Mathematica

I define SolVm1: ...
NC520's user avatar
  • 479
0 votes
0 answers
48 views

Line breaks cause too many empty lines in the Information box

$Version 13.0.1 for Mac OS X ARM (64-bit) (January 28, 2022) When there are many *Values with line breaks, the ...
Lacia's user avatar
  • 2,323
0 votes
0 answers
210 views

Find a way to have all progressively human reading or logical steps in a symbolic calculus and improve rendering

I have the following Mathematica notebook on this link notebook link 1.First, I would like to generate in an automatically way this notebook to a Wolfram script that I can make run directly from ...
youpilat13's user avatar
0 votes
0 answers
76 views

How can I see, which function has stuck?

This code runs infinitely. How can I see which function exactly had stuck and potentially fix the code? ...
Anixx's user avatar
  • 3,585
0 votes
0 answers
60 views

Piecewise[ ] for joining InterpolationFunction objects?

I want to combine InterpolationFunction objects, results of an NDSolve in a loop, into one function. This is my code: ...
Borislava Dimitrova's user avatar
0 votes
0 answers
53 views

If definition of elements in table

I need to define a table where the definition of the elements differs if the indices $i$ and $j$ are equal or different. In particular I have to implement the following formula $$(K_1^{(1)}(m_1,m_2))_{...
Davide Morgante's user avatar
0 votes
0 answers
63 views

After execution of simple list manipulation every expression turns dark blue and nothing is defined - how to debug

This question is related to this one in the sense that it uses the code from there. What happens is best illustrated in the video here. When I run (* part 1 *) ...
atapaka's user avatar
  • 3,960
0 votes
0 answers
225 views

How to see/trace Manipulate steps?

I am relatively new in Wolfram Language. What I want to solve is tracing "manipulate" steps in one of the demonstration project example codes. In my particular example, there are nearly 20 user build ...
houdini's user avatar
0 votes
0 answers
193 views

Problem with small program: Error: "Charting Private pvar"

Im in the making of a smaller self-running application. I have made a small piece of the program as it has to look in the end. However, sometimes when i change some of the input for either "demand" or ...
Mads's user avatar
  • 21
0 votes
0 answers
53 views

Define a new Front End Syntax for Function Argument Checking & Debugging

In this question I asked a basic question about how to check argument types such that there was useful output from the front end when calling functions. Based on elements of the nice answer by @j-m-is-...
Julian Moore's user avatar
  • 2,560