On Sun, Apr 19 2020, Steve Williams <[email protected]> wrote:
> On 19/04/2020 12:20 a.m., Landry Breuil wrote:
>> On Sun, Apr 19, 2020 at 07:59:04AM +0200, Landry Breuil wrote:
>>> On Sat, Apr 18, 2020 at 11:29:11PM -0600, Steve Williams wrote:
>>>> Hi,
>>>>
>>>> OpenBSD 6.6 (GENERIC.MP) #7: Thu Mar 12 11:55:22 MDT 2020
>>>>
>>>> I am working on trying to get Apache Guacamole working (I've got it
>>>> compiling) to provide RDP and SSH access to my home network.  I have the 
>>>> ssh
>>>> access working, but Guacamole (guacd) is dumping a core in freerdp
>>>> (freerdp-2.0.0rc1p4).   Based on the stack trace, I am assuming an issue
>>>> with the more strict malloc that OpenBSD uses.  I checked and see that a
>>>> final release of FreeRDP (2.0.0) was made available April 9, 2020.
>>>>
>>>> Is anyone working on porting the new version of FreeRDP?  I could not see a
>>>> "MAINTAINER" in the Makefile.
>>> Newer versions of freerdp needs some methods not available on OpenBSD,
>>> check
>>> http://openbsd-archive.7691.n7.nabble.com/x11-freerdp-update-to-2-0-0-rc4-td360502.html#a360567
>>> and https://marc.info/?t=152482492600005&r=1&w=2 and
>>> https://github.com/FreeRDP/FreeRDP/issues/4592.
>> there's a comment about it in the port Makefile:
>>
>>
>> # XXX This version has known security issues.
>>
>> # XXX Can't be updated without either timer_create() and friends or
>> #     an alternative timer implementation (as was done for OSX)
>>
>>
>>>> I've been using OpenBSD since version 2.7 and am a C programmer of 30+
>>>> years.
>>> glad if you can help on this then ! build a debug package for the port
>>> to have proper symbols for the backtrace..
>> more details on this after i've actually looked - its a cmake port which
>> doesnt always cope well yet with our DEBUG_PACKAGES framework, you can try 
>> with
>> DEBUG_PACKAGES=${BUILD_PACKAGES} which will give you this:
>>
>> Writing /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/debug-pkg/Makefile.new
>> Writing /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/debug-pkg/PLIST
>> Renaming /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/debug-pkg/Makefile.new 
>> to Makefile
>>> Extracting debug info from 
>>> /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/usr/local/bin/winpr-hash
>>> Extracting debug info from 
>>> /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/usr/local/bin/winpr-makecert
>>> Extracting debug info from 
>>> /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/usr/local/bin/xfreerdp
>>> Extracting debug info from 
>>> /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/usr/local/lib/libfreerdp-client2.so.0.0
>>> Extracting debug info from 
>>> /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/usr/local/lib/libfreerdp2.so.0.0
>>> Extracting debug info from 
>>> /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/usr/local/lib/libwinpr-tools2.so.0.0
>>> Extracting debug info from 
>>> /usr/obj/ports/freerdp-2.0.0rc1/fake-amd64/usr/local/lib/libwinpr2.so.0.0
>> Create /usr/ports/packages/amd64/all/freerdp-2.0.0rc1p4.tgz
>> Creating package freerdp-2.0.0rc1p4
>> Creating package debug-freerdp-2.0.0rc1p4
>> Link to /usr/ports/packages/amd64/ftp/freerdp-2.0.0rc1p4.tgz
>> Link to /usr/ports/packages/amd64/ftp/debug-freerdp-2.0.0rc1p4.tgz
>>
>> and then install the debug-freerdp package & check if gdb find syms.
>>
>> Tried it here and it doesnt seem to help (blame cmake that forcefully strips 
>> syms when CMAKE_BUILD_TYPE=Release...):
>>
>> nikki:~/ $egdb /usr/local/bin/xfreerdp
>> Reading symbols from /usr/local/bin/xfreerdp...(no debugging symbols 
>> found)...done.
>>
>> Another option worth a try, you can locally add
>> -DCMAKE_BUILD_TYPE=RelWithDebInfo to CONFIGURE_ARGS to build a local package
>> with debug symbols enabled via cmake. Might work.
>>
>> Landry
>
>
> Hi,
>
> Thanks for the fast replies :)
>
> TL;DR
>
> I am missing something on building the Debug packages.  I modified the
> Makefile per your other email thread but there must be more magic as
> I don't see any of the output pertaining to "Extracting debug info..."

DEBUG_PACKAGES is supported on -current which will become the 6.7
release.  Setting this variable does nothing on 6.6.

> Details:
>
> It is a bit disappointing that the newer version of freerdp needs
> significant work to have it functional in OpenBSD.  I had a look at the
> Apple code for the timers... the whole timers file.  Not very pleasant
> with all the #ifdef's all over the place.  I am sure greater minds than
> mine have looked at what it would take to have it working in OpenBSD.
>
> I guess that leaves debugging the existing code.  I started by comparing
> the 2.0rc1 /winpr/libwinpr/crt/alignment.c with the version in 2.0 and
> there have been quite a few changes.  It seems most of them are for
> clarity of code,  but hidden in the changes must be some alignment
> challenges.  Lots of math going on... and a few confusing comments.
>
> For example:
>     /* alignment must be a power of 2 */
>     if (alignment % 2 == 1)
>         return NULL;
>
> That's not a "power" of two, that's a "multiple" of 2.  What did they
> really mean??  I assume they meant multiple... but that's not what the
> code is doing.
>
> Regardless...
>
> What magic do I need to build freerdp-2.0.0rc1 with debugging symbols?
>
> Also, in your response, it shows you using "egdb".  Is this something
> different than gdb?  I couldn't find it anywhere...

egdb is the gdb executable from the gdb package (ports/deve/gdb).  gdb
from base is older and does not cope well with executables and libraries
produced by clang.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Attachment: signature.asc
Description: PGP signature

Reply via email to