Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

HeadlessChildModel instances not being disposed of and headless model viewer displaying wrong child model

Abierto
#146 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
scala
Área
tooling

Línea de trabajo

Comienza examinando las referencias a HeadlessChildModel alrededor del gestor del modelo subyacente, el visor de modelos y los flujos ls:show y ls:reset descritos en el issue. Usa el volcado de heap adjunto y la secuencia indicada como entradas para la investigación; se considera terminado cuando se entienden las instancias duplicadas y el visor y el modelo en ejecución hacen referencia de forma coherente al modelo hijo previsto.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Mostly opening this to document a weird state I've arrived in. I don't have repro steps, but will update if I can figure them out. If I had to guess at repro steps, it would be something like:

  1. Run a model with a headless child model.
  2. ls:show 0 to view the world state.
  3. With that open, edit the code of the child model (opened with the LevelSpace menu)
  4. Maybe something like do ls:reset and rerun model with the viewer still open? Basically, having a bunch of ways of having the child model be referenced and then doing things that might change one reference but not the others.

I arrived at a state where an instance of a headless child model being used by the model and the one displayed with ls:show are different. The child model's command center seemed to talk to the same instance that the model used, as can be seen here:

image

Note that the world size seen in the view is the world size the child model has on initial load, but then it changes when run.

Looking at a heap dump, we see that there are, in fact, 6 instance of HeadlessChildModel:

image

HeadlessChildModel#5 appears to be the one used by the model and the command center, as indicated by the number of turtles in its world (the command center indicated 11 turtles, as did running [ count turtles ] ls:of 0 in the parent model):

image

HeadlessChildModel#6 appears to be used by the backing model manager:

image

but also seems to have agents in it:

image

I haven't been able to figure out which headless model is the one actually being displayed by the model viewer, but the heapdump is attached.

heapdump-1675355329037.zip

Lenguaje dominante
Scala
Estrellas
20
Forks
8
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NetLogo/LevelSpace

Todos los issues de NetLogo/LevelSpace

Issues similares

Más issues de Scala

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.