core dump due to user error when mapping array

16 views
Skip to first unread message

markus.sc...@gmail.com

unread,
Aug 27, 2025, 11:24:17 AM (11 days ago) Aug 27
to idl-pvwave
I caused a core dump:
IDL> print, !version
{ x86_64 linux unix linux 8.5 Jul  7 2015      64      64}
IDL> str_arr=['a{}','b{}']
IDL> fixed=(list(str_arr,/ex)).map(lambda('s:[s.replace("{}","x"),s.replace("{}","y")]'))
IDL> print, fixed.toArray(/tr)
ax ay
bx by
IDL> print, str_arr.map(lambda('s:[s.replace("{}","x"),s.replace("{}","y")]'))
ax bx
bx�f
free(): double free detected in tcache 2
Aborted (core dumped)
I know why I shouldn't be doing what I did and how to work around it, but it should yield a reasonable error message and not a core dump.

Is this still a problem in the current version?

Chris Torrence

unread,
Aug 28, 2025, 9:45:07 AM (10 days ago) Aug 28
to idl-pvwave
Hi Markus,

This works fine in IDL 9.2:
IDL> !version.release
9.2.0

IDL> str_arr=['a{}','b{}']                                                              
IDL> fixed=(list(str_arr,/ex)).map(lambda('s:[s.replace("{}","x"),s.replace("{}","y")]'))
IDL> fixed
[
    ["ax", "ay"],
    ["bx", "by"]

]
IDL> print, str_arr.map(lambda('s:[s.replace("{}","x"),s.replace("{}","y")]'))          
ax ay
bx by
IDL> help, str_arr.map(lambda('s:[s.replace("{}","x"),s.replace("{}","y")]'))
<Expression>    STRING    = Array[2, 2]

I don't recall all the details, but I think we fixed something a couple versions ago.
Cheers,
Chris
IDL Dev Lead
Reply all
Reply to author
Forward
0 new messages