โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayNews from the Ada programming language world

Getting unix command CAT to work on Windows

The issue of getting the equivalent command of the Unix command cat on Windows has been discussed for example here: What is the Windows equivalent of the Unix command cat?

I have looked at the project MinGW here: MinGW - Minimalist GNU for Windows Files

I have installed the file mingw-get-setup.exe and now I have a gui with which I can retrieve necessary Unix tools by downloading from the internet. But I do not know which of these tools has/have the cat command.

I would like to use the cat command to merge Ada specifications and bodies files so as to distribute the codes as just one .ada file on which other users can use the gnatchop command to retrieve the original files again.

If there are other better projects on Windows to obtain the cat command directly in a single Windows installation unlike the MinGW project in which tools have to be installed by downloading from the internet, I am interested.

Analysis of a hung/stuck program

I have to maintain an (old) Ada program that loads multiple DLLs (plugins) dynamically after its own start on Windows. Each DLL defines an entry point procedure that is called from the main program. When this entry point procedure is called each DLL may start several tasks (for example network communication). These tasks are active until the programm is stopped.

Unfortunately it happens sometimes that all tasks in one DLL get stuck but the main program keeps responsive (cyclic network communication/Text_IO). With the help of the tool Dr. Mingw I have extracted the call stacks after the tasks became unresponsive. A few tasks are waiting (for example for new data or delay statements) and that is okay but I have also noticed (in my opinion) strange call stacks (renamed packages and procedures).

Example 1 (good):

ntdll.dll!NtWaitForSingleObject
KERNELBASE.dll!WaitForSingleObject
foo_bar.dll!system__task_primitives__operations__cond_timed_wait
foo_bar.dll!system__task_primitives__operations__timed_sleep
foo_bar.dll!system__tasking__entry_calls__wait_for_completion_with_timeout
foo_bar.dll!system__tasking__protected_objects__operations__timed_protected_entry_call
foo_bar.dll!blob__foobar_task_typeTB  [C:/path/blob.adb @ 1481]
foo_bar.dll!system__tasking__stages__task_wrapper
KERNEL32.DLL!BaseThreadInitThunk
ntdll.dll!RtlGetAppContainerNamedObjectPath
ntdll.dll!RtlGetAppContainerNamedObjectPath
foo_bar.dll!system__tasking__stages__terminate_task

Example 2 (bad, seen multiple times for the function To_Unbounded_String in multiple tasks):

ntdll.dll!ZwWaitForAlertByThreadId
ntdll.dll!RtlDllShutdownInProgress
ntdll.dll!RtlDllShutdownInProgress
ntdll.dll!RtlEnterCriticalSection
ntdll.dll!RtlEnterCriticalSection
foo_bar.dll!system__tasking__initialization__task_lock__2
foo_bar.dll!__gnat_malloc
foo_bar.dll!ada__strings__unbounded__allocate.part.3
foo_bar.dll!ada__strings__unbounded__to_unbounded_string
foo_bar.dll!foo__bar__some_procedure  [C:/path/foo-bar.adb @ 1352]
foo_bar.dll!example__worker_task_typeTB  [C:/path/example.adb @ 1870]
foo_bar.dll!system__tasking__stages__task_wrapper
KERNEL32.DLL!BaseThreadInitThunk
ntdll.dll!RtlGetAppContainerNamedObjectPath
ntdll.dll!RtlGetAppContainerNamedObjectPath
foo_bar.dll!system__tasking__stages__terminate_task

Example 3 (bad):

ntdll.dll!ZwWaitForAlertByThreadId
ntdll.dll!RtlDllShutdownInProgress
ntdll.dll!RtlDllShutdownInProgress
ntdll.dll!RtlEnterCriticalSection
ntdll.dll!RtlEnterCriticalSection
foo_bar.dll!system__tasking__initialization__task_lock__2
foo_bar.dll!system__os_primitives__get_base_time
foo_bar.dll!ada__calendar__clock
foo_bar.dll!one__two__three__other_procedure  [C:/path/one-two-three.adb @ 139]
foo_bar.dll!example__worker_task_typeTB  [C:/path/example.adb @ 1487]
foo_bar.dll!system__tasking__stages__task_wrapper
KERNEL32.DLL!BaseThreadInitThunk
ntdll.dll!RtlGetAppContainerNamedObjectPath
ntdll.dll!RtlGetAppContainerNamedObjectPath
foo_bar.dll!system__tasking__stages__terminate_task

I am looking for possible advice on what could be causing the problem or how to analyze it further.

โŒ
โŒ