Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wlib segmentation fault #1241

Open
sezero opened this issue Feb 29, 2024 · 7 comments
Open

wlib segmentation fault #1241

sezero opened this issue Feb 29, 2024 · 7 comments

Comments

@sezero
Copy link
Contributor

sezero commented Feb 29, 2024

Something seems to have broken between yesterday's and today's 'Current-build'

This is from a CI workflow run on a windows host:

	wlib -q -b -n -c -pa -s -t -zld -ii -io -inn libxmp.lib +libxmp.dll
The instruction at 0x6a00945d referenced memory at 0x0008d18c.
The memory could not be written.
Exception fielded by 0x00403e60
EAX=0x02308a1c EBX=0x00000000 ECX=0x0008d18c EDX=0x0008d0e0
ESI=0x0019fa4d EDI=0x6a005001 EBP=0x02264798 ESP=0x0019fa10
EIP=0x6a00945d EFL=0x00010202 CS =0x00000023 SS =0x0000002b
DS =0x0000002b ES =0x0000002b FS =0x00000053 GS =0x0000002b
Stack dump (SS:ESP)
0x6a027508 0x00000007 0x00000000 0x6a005410 0x02308a24 0x00000000 
0x65e038bc 0x00000000 0x000081b6 0x0008b200 0x6a011400 0x00000000 
0x00000000 0x0019fe4c 0x6a005030 0x00805a4d 0x00000001 0x6a005230 
0x6a028402 0x0019fe4c 0x0019fa70 0x02264356 0x02264340 0x6a00553c 
0x7862696c 0x642e706d 0x00006c6c 0x00488090 0x00000000 0x0000000e 
0x00000001 0x00000000 0x007202cc 0x00000001 0x004896e0 0x00000000 
0x00000000 0x004880e8 0x0e00000e 0x0000000c 0x00000000 0x00000002 
0x007202ac 0x00000000 0x01010000 0x00000030 0x00000000 0x00488098 
0x0000007f 0x00720270 0x0000000c 0x00000000 0x00000000 0x000e0000 
0x00720270 0x0000000c 0x0000000c 0x004880e0 0x01000000 0x0000000c 
0x00000000 0x00000000 0x0019ff60 0x7748c420 0x44532416 0xfffffffe 
0x0019fb7c 0x7749d047 0x00000000 0x7749d06d 0x00488098 0x00720000 
Error(E14): Cannot execute (wlib): No error
Error(E42): Last command making (libxmp.dll) returned a bad status
Error(E02): Make execution terminated
Should this file be deleted [Yes/No] ? 
Error: Process completed with exit code 1.

Happens on linux, as well:

	wlib -q -b -n -c -pa -s -t -zld -ii -io -inn libxmp.lib +libxmp.dll
Segmentation fault
Error(E42): Last command making (libxmp.dll) returned a bad status
@jmalak
Copy link
Member

jmalak commented Feb 29, 2024

Thanks for your bug report.
I will fix it ASAP.

@jmalak
Copy link
Member

jmalak commented Feb 29, 2024

Please could you give me copy of libxmp.dll.

@sezero
Copy link
Contributor Author

sezero commented Feb 29, 2024

Here you go (both built with ow1.9): win32dll.zip, os2dll.zip

@sezero
Copy link
Contributor Author

sezero commented Feb 29, 2024

Here you go (both built with ow1.9): win32dll.zip, os2dll.zip

Curiously, the segfault happens only with the win32 dll and not with the os/2 dll...

@jmalak
Copy link
Member

jmalak commented Feb 29, 2024

Thanks I see what problem is.
It is related to deallocation of output library name which is replaced during importing records to already dealocated memory block. It happens only for Windows target library and when create it from DLL by import records.
It is part of code that need review it is not transparent code and there are changed pointers during processing between short module name and full path file name. I add transparent deallocation for short module name but it is changed (internaly during importing symbols from Windows DLL) and now fail if wlib do cleanup. I temporary remove this deallocation and after fixing importing import records from DLL I wll add it again.

jmalak added a commit that referenced this issue Feb 29, 2024
@sezero
Copy link
Contributor Author

sezero commented Feb 29, 2024

The 'Last-CI-build' from 79e1b3d does seem to have worked around the issue.

@jmalak
Copy link
Member

jmalak commented Feb 29, 2024

Thanks for confirmation.
I will do permanent fix later. I think little rework import records handling for library will be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants