Re: [LAU] jack2 turned verbose

classic Classic list List threaded Threaded
41 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Robin Gareus
On 05/31/2012 01:58 AM, David Adler wrote:
> On Thu, May 31, 2012 at 1:00 AM, mark hadman wrote:
>
>> I have the same verbose behaviour problem with jack2 on Arch Linux 64 bit.
>
> Thanks Mark, good to know I'm not the only one.
> I have it on both, 64 and 32 bit.
>
> best,
> d

It might have to do with Arch's compiler[-flags] and how jack2 uses
unions .. or scoping: JackGlobals vs Engine-Parameters.. although I
don't have an explanation.. all seems good.

A hunch: it could be caused by using 'server_ptr->verbose.b' (a union)
as boolean. The sever only checks "if (server_ptr->verbose.b)". The
union itself comprises other uninitialized values that could make it
evaluate to true (though it shouldn't, but maybe some compiler
optimization casts it to (int) instead of (bool) )


I know this is the '-users' list (I'm ccing jack-devel), but could
someone who experiences the problem try to track it down?

Basically just add a few printf()'s. Start at: common/JackControlAPI.cpp
- line 926 - before the call to  "new JackServer(..)" add

  printf("DEBUG verbose: %s\n",(server_ptr->verbose.b)?"on":"off");

recompile, launch jackd. If it prints "verbose: on", sth is wrong with
parameter initialization in main() or with using unions. If it's "off"
the problem sits deeper:

add a line just after common/JackServer.cpp line 66
  printf("DEBUG verbose2: %s\n",(JackGlobals::fVerbose)?"on":"off");
...

A crude test for the union() hunch would be to change
common/JackControlAPI.h line 53:
 replace
  "union jackctl_parameter_value"
with
  "struct jackctl_parameter_value"

and compile with '-fpermissive' like this:

  CXXFLAGS="-fpermissive" ./waf  configure
  ./waf

..not sure if that'll work though..

HTH,
robin
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

David Adler-4
On Fri, Jun 1, 2012 at 2:52 PM, Robin Gareus wrote:
>
> It might have to do with Arch's compiler[-flags] and how jack2 uses
> unions .. or scoping: JackGlobals vs Engine-Parameters.. although I
> don't have an explanation.. all seems good.

Compiler flags (for 32bit) are, (from unaltered /etc/makepkg.conf):
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"

> A hunch: it could be caused by using 'server_ptr->verbose.b' (a union)
> as boolean. The sever only checks "if (server_ptr->verbose.b)". The
> union itself comprises other uninitialized values that could make it
> evaluate to true (though it shouldn't, but maybe some compiler
> optimization casts it to (int) instead of (bool) )
>
>
> I know this is the '-users' list (I'm ccing jack-devel), but could
> someone who experiences the problem try to track it down?
>
> Basically just add a few printf()'s. Start at: common/JackControlAPI.cpp
> - line 926 - before the call to  "new JackServer(..)" add
>
>  printf("DEBUG verbose: %s\n",(server_ptr->verbose.b)?"on":"off");
>
> recompile, launch jackd. If it prints "verbose: on", sth is wrong with
> parameter initialization in main() or with using unions. If it's "off"
> the problem sits deeper:

DEBUG verbose: on

> add a line just after common/JackServer.cpp line 66
>  printf("DEBUG verbose2: %s\n",(JackGlobals::fVerbose)?"on":"off");
> ...

above, your line number didn't match exactly, so we seem to have
different versions (1.9.7 here). Thus, I wasn't exactly sure where to
add the prinf() and did the following:

...
    JackServerGlobals::fUserCount = 1;     // One user
    printf("DEBUG verbose2: %s\n",(JackGlobals::fVerbose)?"on":"off");
    JackGlobals::fVerbose = verbose;
    printf("DEBUG verbose3: %s\n",(JackGlobals::fVerbose)?"on":"off");
}

which prints:
DEBUG verbose2: off
DEBUG verbose3: on

> A crude test for the union() hunch would be to change
> common/JackControlAPI.h line 53:
>  replace
>  "union jackctl_parameter_value"
> with
>  "struct jackctl_parameter_value"
> and compile with '-fpermissive' like this:
>
>  CXXFLAGS="-fpermissive" ./waf  configure
>  ./waf
>

Again, mismatching line numbers. I assume you meant the line:
union jackctl_parameter_value verbose;

Changing that to struct fixes both issues I reported,
the verbose output and exit on last client close.

So we seem to be getting somewhere. Nice.


thanks Robin,
d
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

David Adler-4
On Fri, Jun 1, 2012 at 3:48 PM, David Adler wrote:
> On Fri, Jun 1, 2012 at 2:52 PM, Robin Gareus wrote:
>>
>> It might have to do with Arch's compiler[-flags] and how jack2 uses
>> unions .. or scoping: JackGlobals vs Engine-Parameters.. although I
>> don't have an explanation.. all seems good.
>
> Compiler flags (for 32bit) are, (from unaltered /etc/makepkg.conf):
> CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
> --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"

(It was a little too late that I saw the square brackets around -flags.)

Compiler is gcc 4.7.0
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Robin Gareus
In reply to this post by David Adler-4
Hi David,

On 06/01/2012 03:48 PM, David Adler wrote:

> On Fri, Jun 1, 2012 at 2:52 PM, Robin Gareus wrote:
>>
>> It might have to do with Arch's compiler[-flags] and how jack2 uses
>> unions .. or scoping: JackGlobals vs Engine-Parameters.. although I
>> don't have an explanation.. all seems good.
>
> Compiler flags (for 32bit) are, (from unaltered /etc/makepkg.conf):
> CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
> --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
>
>> A hunch: it could be caused by using 'server_ptr->verbose.b' (a union)
>> as boolean. The sever only checks "if (server_ptr->verbose.b)". The
>> union itself comprises other uninitialized values that could make it
>> evaluate to true (though it shouldn't, but maybe some compiler
>> optimization casts it to (int) instead of (bool) )
>>
>>
>> I know this is the '-users' list (I'm ccing jack-devel), but could
>> someone who experiences the problem try to track it down?
>>
>> Basically just add a few printf()'s. Start at: common/JackControlAPI.cpp
>> - line 926 - before the call to  "new JackServer(..)" add
>>
>>  printf("DEBUG verbose: %s\n",(server_ptr->verbose.b)?"on":"off");
>>
>> recompile, launch jackd. If it prints "verbose: on", sth is wrong with
>> parameter initialization in main() or with using unions. If it's "off"
>> the problem sits deeper:
>
> DEBUG verbose: on
>
>> add a line just after common/JackServer.cpp line 66
>>  printf("DEBUG verbose2: %s\n",(JackGlobals::fVerbose)?"on":"off");
>> ...
>
> above, your line number didn't match exactly, so we seem to have
> different versions (1.9.7 here). Thus, I wasn't exactly sure where to
> add the prinf() and did the following:
>
> ...
>     JackServerGlobals::fUserCount = 1;     // One user
>     printf("DEBUG verbose2: %s\n",(JackGlobals::fVerbose)?"on":"off");
>     JackGlobals::fVerbose = verbose;
>     printf("DEBUG verbose3: %s\n",(JackGlobals::fVerbose)?"on":"off");
> }
>
> which prints:
> DEBUG verbose2: off
> DEBUG verbose3: on
>
>> A crude test for the union() hunch would be to change
>> common/JackControlAPI.h line 53:
>>  replace
>>  "union jackctl_parameter_value"
>> with
>>  "struct jackctl_parameter_value"
>> and compile with '-fpermissive' like this:
>>
>>  CXXFLAGS="-fpermissive" ./waf  configure
>>  ./waf
>>
>
> Again, mismatching line numbers. I assume you meant the line:
> union jackctl_parameter_value verbose;
>
> Changing that to struct fixes both issues I reported,
> the verbose output and exit on last client close.
>
> So we seem to be getting somewhere. Nice.
>
>
> thanks Robin,
> d

just a quick re: the line-numbers refered to git-head
  https://github.com/jackaudio/jack2/
currently 007cdc37142a

It looks like it is indeed caused by using unions to check for /true/.
  "if ([bool/int/..]union) -> always true"

But I'm at a loss what'd cause those issues and how to best fix it.
Maybe someone else can take it from here. It should be sufficient info
to file a bug report at  https://github.com/jackaudio/jack2/issues

best,
robin
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Nedko Arnaudov
In reply to this post by David Adler-4
David Adler <[hidden email]> writes:

> On Fri, Jun 1, 2012 at 2:52 PM, Robin Gareus wrote:
>>
>> It might have to do with Arch's compiler[-flags] and how jack2 uses
>> unions .. or scoping: JackGlobals vs Engine-Parameters.. although I
>> don't have an explanation.. all seems good.
>
> Compiler flags (for 32bit) are, (from unaltered /etc/makepkg.conf):
> CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
> --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"

Don't use -O2 nor -O1, use -O0

I'm aware of at least one *compiler* bug that causes jackdbus to
misbehave. Yes, i analyzed the generated assembly. Affected are both
i32 and amd64 targets. Atm the only reports are from Arch users. The bad
machine code is created for th control api implementation, in parts that
use unions (jack parameter values).

--
Nedko Arnaudov <GnuPG KeyID: 5D1B58ED>

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

David Adler-4
In reply to this post by David Adler-4
On Fri, Jun 1, 2012 at 3:48 PM, David Adler wrote:
> On Fri, Jun 1, 2012 at 2:52 PM, Robin Gareus wrote:
>>

> DEBUG verbose: on
>
>> add a line just after common/JackServer.cpp line 66
>>  printf("DEBUG verbose2: %s\n",(JackGlobals::fVerbose)?"on":"off");
>> ...
>
> above, your line number didn't match exactly, so we seem to have
> different versions (1.9.7 here). Thus, I wasn't exactly sure where to
> add the prinf() and did the following:
>
> ...
>    JackServerGlobals::fUserCount = 1;     // One user
>    printf("DEBUG verbose2: %s\n",(JackGlobals::fVerbose)?"on":"off");
>    JackGlobals::fVerbose = verbose;
>    printf("DEBUG verbose3: %s\n",(JackGlobals::fVerbose)?"on":"off");
> }
>
> which prints:
> DEBUG verbose2: off
> DEBUG verbose3: on
>
>> A crude test for the union() hunch would be to change
>> common/JackControlAPI.h line 53:
>>  replace
>>  "union jackctl_parameter_value"
>> with
>>  "struct jackctl_parameter_value"
>> and compile with '-fpermissive' like this:
>>
>>  CXXFLAGS="-fpermissive" ./waf  configure
>>  ./waf
>>
>
> Again, mismatching line numbers. I assume you meant the line:
> union jackctl_parameter_value verbose;
>
> Changing that to struct fixes both issues I reported,
> the verbose output and exit on last client close.

Oops, I read caressly and did a change to .cpp, not the header file.

So what I did before (which somehow fixed the issues/suppressed
symptoms), was changing
"union" to "struct" in line 75 in JackControlAPI.cpp

Reverted that and did the change Robin suggested, the result is the
same, issues disappeared.


best,
d
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

David Adler-4
In reply to this post by Nedko Arnaudov
On Fri, Jun 1, 2012 at 4:21 PM, Nedko Arnaudov wrote:

> David Adler writes:
>> On Fri, Jun 1, 2012 at 2:52 PM, Robin Gareus wrote:
>>>
>>> It might have to do with Arch's compiler[-flags] and how jack2 uses
>>> unions .. or scoping: JackGlobals vs Engine-Parameters.. although I
>>> don't have an explanation.. all seems good.
>>
>> Compiler flags (for 32bit) are, (from unaltered /etc/makepkg.conf):
>> CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
>> --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
>
> Don't use -O2 nor -O1, use -O0
>
> I'm aware of at least one *compiler* bug that causes jackdbus to
> misbehave. Yes, i analyzed the generated assembly. Affected are both
> i32 and amd64 targets. Atm the only reports are from Arch users. The bad
> machine code is created for th control api implementation, in parts that
> use unions (jack parameter values).

Symptoms disappear when using -fpermissive and/or -O0 (instead of -O2),
with no changes in the source files.

So is this then an upstream or a downstream issue?

Nedko, does your advice to use -O0 only concern Jack or everything?
I'm compiling lots of software here, usually -O2 usually doesn't seem
to cause problems.


best,
david
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Nedko Arnaudov
David Adler <[hidden email]> writes:

> On Fri, Jun 1, 2012 at 4:21 PM, Nedko Arnaudov wrote:
>> David Adler writes:
>>> On Fri, Jun 1, 2012 at 2:52 PM, Robin Gareus wrote:
>>>>
>>>> It might have to do with Arch's compiler[-flags] and how jack2 uses
>>>> unions .. or scoping: JackGlobals vs Engine-Parameters.. although I
>>>> don't have an explanation.. all seems good.
>>>
>>> Compiler flags (for 32bit) are, (from unaltered /etc/makepkg.conf):
>>> CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
>>> --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
>>
>> Don't use -O2 nor -O1, use -O0
>>
>> I'm aware of at least one *compiler* bug that causes jackdbus to
>> misbehave. Yes, i analyzed the generated assembly. Affected are both
>> i32 and amd64 targets. Atm the only reports are from Arch users. The bad
>> machine code is created for th control api implementation, in parts that
>> use unions (jack parameter values).
>
> Symptoms disappear when using -fpermissive and/or -O0 (instead of -O2),
> with no changes in the source files.
>
> So is this then an upstream or a downstream issue?
both. arch (downstream) is pushing recently released (upstream)
compiler. jack control api implementaiton triggers the bug. its not
issue in jack itself but its still problem for jack users.

> Nedko, does your advice to use -O0 only concern Jack or everything?
> I'm compiling lots of software here, usually -O2 usually doesn't seem
> to cause problems.

YMMV. Default compiler in my distro (Gentoo) works properly. jack also
"works", until you find that it misbehaves. You can only be sure if you
have tests that cover 100% of the code. Neither jack1 nor jack2 have
such.

--
Nedko Arnaudov <GnuPG KeyID: 5D1B58ED>

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Nedko Arnaudov
In reply to this post by Nedko Arnaudov
Nedko Arnaudov <[hidden email]> writes:

> David Adler <[hidden email]> writes:
>
>> On Fri, Jun 1, 2012 at 2:52 PM, Robin Gareus wrote:
>>>
>>> It might have to do with Arch's compiler[-flags] and how jack2 uses
>>> unions .. or scoping: JackGlobals vs Engine-Parameters.. although I
>>> don't have an explanation.. all seems good.
>>
>> Compiler flags (for 32bit) are, (from unaltered /etc/makepkg.conf):
>> CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
>> --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
>
> Don't use -O2 nor -O1, use -O0
>
> I'm aware of at least one *compiler* bug that causes jackdbus to
> misbehave. Yes, i analyzed the generated assembly. Affected are both
> i32 and amd64 targets. Atm the only reports are from Arch users. The bad
> machine code is created for th control api implementation, in parts that
> use unions (jack parameter values).
The jackdbus assert caused by the gcc bug looks like this:

arguments to dbus_message_iter_append_basic() were incorrect, assertion "*bool_p == 0 || *bool_p == 1" failed in file dbus-message.c

The default value of "verbose" is set to 10, the default value of
"realtime-priority". libdbus has checks for boolean values that gets
triggered because 10 is neither true (1) not false (0).

--
Nedko Arnaudov <GnuPG KeyID: 5D1B58ED>

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Paul Davis
in general, this using bitfields to store values is just so .... 1998. we should all stop it.


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Fons Adriaensen-3
In reply to this post by Nedko Arnaudov
On Sat, Jun 02, 2012 at 12:04:52AM +0300, Nedko Arnaudov wrote:
 
> The default value of "verbose" is set to 10, the default value of
> "realtime-priority". libdbus has checks for boolean values that gets
> triggered because 10 is neither true (1) not false (0).

How are these checks done ?

I tried this:


int main (int ac, char *av [])
{
    int i;

    union
    {
        bool b;
        int  i;
    } X;

    puts ("");
    for (i = 0; i < 5; i++)
    {
        X.i = i;
        if (X.b) puts ("true");
        else     puts ("false");
    }

    puts ("");
    for (i = 0; i < 5; i++)
    {
        X.i = i;
        if      (X.b == true)   puts ("true");
        else if (X.b == false)  puts ("false");
        else                    puts ("Neither true or false");
    }

    return 0;
}

which prints:

false
true
true
true
true

false
true
true
true
true

And this makes me think that if libdbus tests for 0 or 1 it
is doing the wrong thing (TM).

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Robin Gareus
On 06/01/2012 11:33 PM, Fons Adriaensen wrote:
> On Sat, Jun 02, 2012 at 12:04:52AM +0300, Nedko Arnaudov wrote:
>  
>> The default value of "verbose" is set to 10, the default value of
>> "realtime-priority". libdbus has checks for boolean values that gets
>> triggered because 10 is neither true (1) not false (0).

I was under the impression that true is usually defined as -1 (not +1).
Using two's complement -1 would set all bits to on.
and "if (false)" := "branch if zero"

> How are these checks done ?
>
> I tried this:
>
>
> int main (int ac, char *av [])
> {
>     int i;
>
>     union
>     {
>         bool b;
>         int  i;
>     } X;
>
>     puts ("");
>     for (i = 0; i < 5; i++)
>     {
>         X.i = i;
>         if (X.b) puts ("true");
>         else     puts ("false");
>     }
>
>     puts ("");
>     for (i = 0; i < 5; i++)
>     {
>         X.i = i;
>         if      (X.b == true)   puts ("true");
>         else if (X.b == false)  puts ("false");
>         else                    puts ("Neither true or false");
>     }
>
>     return 0;
> }

nice. That's indeed what the problem boils down to.

Well, depending what the compiler does, maybe add some explicit
type-casts:  X.b == false  vs.  ((bool) X.b) == false.
In POSIX-C 'false' is #define'd as 0

> which prints:
>
> false
> true
> true
> true
> true
>
> false
> true
> true
> true
> true

Is this Arch-Linux, gcc/g++-4.7.0, with "-O2" ?
The flags to produce the problem with: g++ 4.7.0 are
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Nedko Arnaudov
Robin Gareus <[hidden email]> writes:

>> On Sat, Jun 02, 2012 at 12:04:52AM +0300, Nedko Arnaudov wrote:
>>  
>>> The default value of "verbose" is set to 10, the default value of
>>> "realtime-priority". libdbus has checks for boolean values that gets
>>> triggered because 10 is neither true (1) not false (0).
>
> I was under the impression that true is usually defined as -1 (not +1).
> Using two's complement -1 would set all bits to on.
> and "if (false)" := "branch if zero"

C99 states that true and false are 0 and 1. C++11 states that when bool
is converted to integer the values are 0 and 1. dbus_bool_t also uses
0 and 1. jackdbus code uses conversion from C++ bool to integer type
dbus_bool_t (defined as 32bit integer). check in the libdbus code is
correct as well, it checks dbus_bool_t values..

--
Nedko Arnaudov <GnuPG KeyID: 5D1B58ED>

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Fons Adriaensen-3
In reply to this post by Robin Gareus
On Sat, Jun 02, 2012 at 09:16:57AM +0200, Robin Gareus wrote:
 
> Well, depending what the compiler does, maybe add some explicit
> type-casts:  X.b == false  vs.  ((bool) X.b) == false.

That doesn't make much sense, X.b  *is*  already a bool.

Here is a third version:

    for (i = 0; i < 5; i++)
    {
        X.i = i;
        if      ((int) X.b == 1)  puts ("true");
        else if ((int) X.b == 0)  puts ("false");
        else                      puts ("Neither true or false");
    }

which produces the same output as the two others.

So  (int) X.b  is *not* the same as  X.i.

What this tells me is that one should test booleans against
boolean constants, and ints against int constants, and *not*
mix them up. Which I guess the libdbus code is doing.

 
> Is this Arch-Linux, gcc/g++-4.7.0, with "-O2" ?

4.7.0 with -O3.

> The flags to produce the problem with: g++ 4.7.0 are
> CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
> --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"

Tried this, same result for all three tests.

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Robin Gareus
On 06/02/2012 01:54 PM, Fons Adriaensen wrote:
[..]

>> Is this Arch-Linux, gcc/g++-4.7.0, with "-O2" ?
> 4.7.0 with -O3.  
>
>> The flags to produce the problem with: g++ 4.7.0 are
>> CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector
>> --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
> Tried this, same result for all three tests.

Thanks.

That result contradicts the hypothesis that verbose jack2 is caused by
union + compiler optimizations on ArchLinux's g++-4.7.0.
..or maybe it was a problem in gcc that has been fixed since..

Can you reproduce the "jackd2 turned verbose" issue ?

robin
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Nedko Arnaudov
In reply to this post by Fons Adriaensen-3
Fons Adriaensen <[hidden email]> writes:

> What this tells me is that one should test booleans against
> boolean constants, and ints against int constants, and *not*
> mix them up. Which I guess the libdbus code is doing.

This guesswork fails. libdbus doesnt do this if only because it uses
dbus_bool_t and not C99 nor C++ bool. OTOH this is quickly becomming
offtopic and dbus-fud-y. The problem is the incorrect machine code
generated by gcc-4.7.0. That code is not in libdbus, its produced from
JackControlAPI.cpp in the jack2 source tree. You can prove the bug by
disassemling the jackctl_server_create function. The call for adding the
verbose parameter doesnt update the stack variable called "value" which
is set just before the call, line 667. If someone can explain why this
is invalid C code, please do it. If someone cares to produce an isolated
test case please do it and then report upstream (gcc). In the latter
case we can at least expect some gcc guru to decide if its a gcc bug or
invalid C code.

--
Nedko Arnaudov <GnuPG KeyID: 5D1B58ED>

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Fons Adriaensen-3
On Sat, Jun 02, 2012 at 07:09:24PM +0300, Nedko Arnaudov wrote:

> Fons Adriaensen <[hidden email]> writes:
>
> > What this tells me is that one should test booleans against
> > boolean constants, and ints against int constants, and *not*
> > mix them up. Which I guess the libdbus code is doing.
 
> This guesswork fails. libdbus doesnt do this if only because it uses
> dbus_bool_t and not C99 nor C++ bool.

It some software implements its own boolean type, and then in
some cases decides that a given value of that type is neither
true nor false - as you wrote in a previous post - then that
is a bug. The essence of a boolean is that it always either
true or false. My suspicion is based on what you wrote, nothing
else.

> OTOH this is quickly becomming offtopic and dbus-fud-y.

Showing that the compiler does the right thing with booleans
(which is what my simple example code does) is not offtopic
in this context. And formulating a working hypothesis based
on that and previous evidence (see above) is not FUD.

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Nedko Arnaudov
Fons Adriaensen <[hidden email]> writes:

> On Sat, Jun 02, 2012 at 07:09:24PM +0300, Nedko Arnaudov wrote:
>
>> Fons Adriaensen <[hidden email]> writes:
>>
>> > What this tells me is that one should test booleans against
>> > boolean constants, and ints against int constants, and *not*
>> > mix them up. Which I guess the libdbus code is doing.
>  
>> This guesswork fails. libdbus doesnt do this if only because it uses
>> dbus_bool_t and not C99 nor C++ bool.
>
> It some software implements its own boolean type, and then in
> some cases decides that a given value of that type is neither
> true nor false - as you wrote in a previous post - then that
> is a bug. The essence of a boolean is that it always either
> true or false. My suspicion is based on what you wrote, nothing
> else.
This is false. Any ABI needs to define types of fixed size. Neither C99
nor C++ fix the size of booleans. And still, this is irrelevant to the
compiler issue itself.

--
Nedko Arnaudov <GnuPG KeyID: 5D1B58ED>

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Fons Adriaensen-3
On Sat, Jun 02, 2012 at 08:28:03PM +0300, Nedko Arnaudov wrote:
 
> This is false. Any ABI needs to define types of fixed size. Neither C99
> nor C++ fix the size of booleans.

Size and representation is irrelevant. What matters for
a boolean is that *any* value it can ever take must be
interpreted as either 'true' or 'false'. If there is a
third possibility, then the type is by definition not
a boolean.

Ciao,

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: [LAU] jack2 turned verbose

Robin Gareus
In reply to this post by Nedko Arnaudov
On 06/02/2012 06:09 PM, Nedko Arnaudov wrote:
> Fons Adriaensen <[hidden email]> writes:
>
>> What this tells me is that one should test booleans against
>> boolean constants, and ints against int constants, and *not*
>> mix them up. Which I guess the libdbus code is doing.
>
> This guesswork fails. libdbus doesnt do this if only because it uses
> dbus_bool_t and not C99 nor C++ bool. OTOH this is quickly becomming
> offtopic and dbus-fud-y.

David reported that the problem exists even if jack is compiled without
dbus, no libdbus is required to trigger the problem, so just take it out
of the equation.
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
123