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

Proposed changes to build aMule with wx 3.1.x #168

Closed
wants to merge 2 commits into from

Conversation

mrhyde71
Copy link

  1. removed warnings related to some macros deprecated in wx 3.0 related to Pen/Brush
  2. removed warnings related to some macros deprecated in wx 3.1 related to Font
  3. little change to remove call to wxScrolledWindow::OnScroll, deprecated in wx 3.0 and removed in wx 3.1

This code has been built on Mac with wx 3.1.2 and seems to work

…x and changed the code to allow to build with wxWidgets 3.1.x
@felisucoibi
Copy link

i think the scroll stuff is the main problem for amule crashing.

@mrhyde71
Copy link
Author

mrhyde71 commented Oct 27, 2019

Till now no problems with scroll noticed but currently I built only on Mac OS (still trying to build on WIndows and not updated my linux dev machines)
I put all changes I made (the reported in this pull request and also the others proposed in aMule forum, see http://forum.amule.org/index.php?topic=51900.msg153674#msg153674 and http://forum.amule.org/index.php?topic=51877.msg153590#msg153590 and created the following binaries for Mac OS in case someone want to try.

You can find them at following links
aMule
aMuleGUI

I imposed as min target 10.11 so I guess they should work starting from El Capitan

Copy link
Member

@gonosztopi gonosztopi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I welcome these changes and your contribution.

However, adding this amount of #if... lines makes the code harder to maintain. I'd suggest you create a separate file(like src/wxcompat.h, or any likeable name), with content like

// Renamed in wxWidgets-3.0.0
#ifndef wxBRUSHSTYLE_SOLID
#define wxBRUSHSTYLE_SOLID wxSOLID
#endif

and include it in the affected files. This way once we move away from wx-2.8 we'll need to touch only the compatibility header.

On the other hand, changes in wxCas code should stay as-is, because it's a separate app and should not share code with aMule.

Copy link
Member

@gonosztopi gonosztopi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason in removing a bunch of wxALIGN_CENTER_VERTICAL?

(Ok, I found your forum post...)

@mrhyde71
Copy link
Author

In general, I welcome these changes and your contribution.

However, adding this amount of #if... lines makes the code harder to maintain. I'd suggest you create a separate file(like src/wxcompat.h, or any likeable name), with content like

// Renamed in wxWidgets-3.0.0
#ifndef wxBRUSHSTYLE_SOLID
#define wxBRUSHSTYLE_SOLID wxSOLID
#endif

and include it in the affected files. This way once we move away from wx-2.8 we'll need to touch only the compatibility header.

On the other hand, changes in wxCas code should stay as-is, because it's a separate app and should not share code with aMule.

Ok, I'll try, I like your suggestion (find some free time to do it not so simple but I agree with you that there are too many #if...).

@mrhyde71
Copy link
Author

What's the reason in removing a bunch of wxALIGN_CENTER_VERTICAL?

(Ok, I found your forum post...)

Yes and building against wxWidgets with debug/assertion enabled is a little nightmare (basically I have an assertion for almost each object built in muuli_wdr.cpp)... I need to try something else to remove the "offending" flags in code without using to #if/#else (I have a couple of ideas and your idea about a file like "src/compat.h" could be useful also for this)

@sergiomb2
Copy link

wx 3.2.0 is out

@sandrotosi
Copy link

is there an effort to adjust this PR for wx 3.2?

@mifritscher
Copy link

As mentioned in #340, debian has applied a patch für wxwidgets 3.2.

@sl1pkn07
Copy link

sl1pkn07 commented Dec 3, 2023

please update the patch also for Wx 3.2.4

[Detaching after fork from child process 248120]
Assertion failed: /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp:DoEnableEvents:100: Assertion '!(GetSocketFlags() & wxSOCKET_BLOCK)' failed. enabling events for a blocking socket?
Backtrace follows:
[3] wxOnAssert(char const*, int, char const*, char const*, char const*) in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff76d1327]
[4] wxSocketImplUnix::DoEnableEvents(int, bool) in /usr/lib/libwx_baseu_net-3.2.so.0[0x7ffff7f3d9df]
[5] wxEpollDispatcher::Dispatch(int) in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7831d49]
[6] wxConsoleEventLoop::DispatchTimeout(unsigned long) in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7836b2b]
[7] wxConsoleEventLoop::Dispatch() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff78368a5]
[8] wxEventLoopManual::ProcessEvents() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7714df5]
[9] wxEventLoopManual::DoRun() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7714f31]
[10] wxEventLoopBase::Run() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff7714b82]
[11] wxAppConsoleBase::MainLoop() in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff76d223f]
[12] wxEntry(int&, wchar_t**) in /usr/lib/libwx_baseu-3.2.so.0[0x7ffff776b579]
[13] ?? in /usr/bin/amuled[0x5555555ccec7]
[14] ?? in /usr/lib/libc.so.6[0x7ffff7045cd0]
[15] __libc_start_main in /usr/lib/libc.so.6[0x7ffff7045d8a]
[16] ?? in /usr/bin/amuled[0x5555555cfa25]

/usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp(100): assert "!(GetSocketFlags() & wxSOCKET_BLOCK)" failed in DoEnableEvents(): enabling events for a blocking socket?
[Detaching after vfork from child process 248121]


Call stack:
[01] wxSocketImplUnix::DoEnableEvents(int, bool)
[02] wxEpollDispatcher::Dispatch(int)        
[03] wxConsoleEventLoop::DispatchTimeout(unsigned long)
[04] wxConsoleEventLoop::Dispatch()          
[05] wxEventLoopManual::ProcessEvents()      
[06] wxEventLoopManual::DoRun()              
[07] wxEventLoopBase::Run()                  
[08] wxAppConsoleBase::MainLoop()            
[09] wxEntry(int&, wchar_t**)                
[10] 0x5555555ccec7
[11] 0x7ffff7045cd0
[12] __libc_start_main                       
[13] 0x5555555cfa25
[New Thread 0x7ffff13f76c0 (LWP 248122)]
[Thread 0x7fffd27fc6c0 (LWP 248118) exited]
02:11:33: Debug: Failed to unregister 22 in direction 0
[Thread 0x7ffff13f76c0 (LWP 248122) exited]

Thread 1 "amuled" received signal SIGSEGV, Segmentation fault.
0x00007ffff7f3db6d in wxSocketImplUnix::OnReadWaiting (this=0x7fffe0001f70) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp:180
Downloading source file /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp
180                     if ( GetLastError() == wxSOCKET_WOULDBLOCK )                                                                                                                                                                                                                                                                                                                         
(gdb) bt full
#0  0x00007ffff7f3db6d in wxSocketImplUnix::OnReadWaiting() (this=0x7fffe0001f70) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/sockunix.cpp:180
        __FUNCTION__ = "OnReadWaiting"
        notify = <optimized out>
#1  0x00007ffff7831d49 in wxEpollDispatcher::Dispatch(int) (this=<optimized out>, timeout=<optimized out>) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/epolldispatcher.cpp:233
        handler = <optimized out>
        p = 0x7fffffffd060
        events = {{events = 5, data = {ptr = 0x7fffe0001fe8, fd = -536862744, u32 = 3758104552, u64 = 140736951492584}}, {events = 21845, data = {ptr = 0x555555e575b0, fd = 1441101232, u32 = 1441101232, u64 = 93825001682352}}, {events = 4152650817, data = {ptr = 0x1300007fff, fd = 32767, u32 = 32767, u64 = 81604411391}}, {events = 0, data = {ptr = 0x7ffff7837ee4 <wxConsoleEventLoopSourcesManager::AddSourceForFD(int, wxEventLoopSourceHandler*, int)+1860>, fd = -142377244, u32 = 4152590052, u64 = 140737345978084}}, {events = 1441108048, data = {ptr = 0x5bd1870000005555, fd = 21845, u32 = 21845, u64 = 6616217761653740885}}, {events = 2978056804, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x558ed69800000000, fd = 0, u32 = 0, u64 = 6165100888240160768}}, {events = 21845, data = {ptr = 0x555555963050, fd = 1435906128, u32 = 1435906128, u64 = 93824996487248}}, {events = 4151809165, data = {ptr = 0x7fff, fd = 32767, u32 = 32767, u64 = 32767}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x5bd1870000000000, fd = 0, u32 = 0, u64 = 6616217761653719040}}, {events = 2978056804, data = {ptr = 0x555555963050, fd = 1435906128, u32 = 1435906128, u64 = 93824996487248}}, {events = 1540458240, data = {ptr = 0x558fa410b1818a64, fd = -1316910492, u32 = 2978056804, u64 = 6165326806497987172}}, {events = 21845, data = {ptr = 0x555555962460, fd = 1435903072, u32 = 1435903072, u64 = 93824996484192}}}
        rc = <optimized out>
        __FUNCTION__ = "Dispatch"
        numEvents = 0
#2  0x00007ffff7836b2b in wxConsoleEventLoop::DispatchTimeout(unsigned long) (this=0x555556057510, timeout=18446744073709551615) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/evtloopunix.cpp:192
        nextTimer = {m_ll = 0}
        hadEvent = <optimized out>
#3  0x00007ffff78368a5 in wxConsoleEventLoop::Dispatch() (this=<optimized out>) at /usr/src/debug/wxwidgets-light/wxwidgets/src/unix/evtloopunix.cpp:173
#4  0x00007ffff7714df5 in wxEventLoopManual::ProcessEvents() (this=this@entry=0x555556057510) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/evtloopcmn.cpp:234
--Type <RET> for more, q to quit, c to continue without paging--
        res = <optimized out>
#5  0x00007ffff7714f31 in wxEventLoopManual::DoRun() (this=0x555556057510) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/evtloopcmn.cpp:288
#6  0x00007ffff7714b82 in wxEventLoopBase::Run() (this=0x555556057510) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/evtloopcmn.cpp:87
        __FUNCTION__ = "Run"
        activate = {m_evtLoopOld = 0x0}
#7  0x00007ffff76d223f in wxAppConsoleBase::MainLoop() (this=0x555555962460) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/appbase.cpp:381
        mainLoop = {<wxEventLoopBasePtr> = {m_ptr = 0x555556057510}, m_pp = 0x5555559625f0, m_pOld = 0x0}
#8  0x00007ffff776b579 in wxEntry(int&, wchar_t**) (argc=@0x7ffff79323e4: 1, argv=<optimized out>) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/init.cpp:497
        initializer = {m_ok = <optimized out>}
#9  0x00007ffff776b617 in wxEntry(int&, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/wxwidgets-light/wxwidgets/src/common/init.cpp:509
#10 0x00005555555ccec7 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/amule-daemon-git/amule/src/amuled.cpp:124

greetings

sc0w added a commit to sc0w/amule that referenced this pull request Sep 26, 2024
 Largely based on patch from Mr Hyde <mrhyde@MM2018.local> in
 amule-project#168

Author: Olly Betts <olly@survex.com>
Bug: amule-project#340
Bug-Debian: https://bugs.debian.org/1019841
Debian patch: https://salsa.debian.org/debian/amule/-/commit/db9fa33d9eecbc2add3914af5fd22b285158db20
sc0w added a commit that referenced this pull request Sep 26, 2024
 Largely based on patch from Mr Hyde <mrhyde@MM2018.local> in
 #168

Author: Olly Betts <olly@survex.com>
Bug-Debian: https://bugs.debian.org/1019841
Debian patch: https://salsa.debian.org/debian/amule/-/commit/db9fa33d9eecbc2add3914af5fd22b285158db20

Closes #340
@sc0w
Copy link
Member

sc0w commented Sep 26, 2024

wxWidgets 3.2 compatibility was added in 9fc3bd0

@sc0w sc0w closed this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants