On Sat, Feb 28, 2009 at 12:11 PM, Nicolai Hähnle <nhaeh...@gmail.com> wrote:
>> - Optimized memory handling. -- Calling twice malloc for each message
>> can't be correct. :)
>
> Actually, there are significantly worse problems in the code. Using vsprintf
> is absolutely incorrect and will cause additional bugs down the line. Also,
> the writen < 0 check is incorrect. Please read the manpage for vsnprintf for
> details on how to do this kind of code correctly.
>

Thanks for pointing that :) In fact I knew that I was doing the wrong
thing there. (I saw the stack overflow danger.)

>> - Better error handling. -- There is still some error handling missing
>> - Make assert also call unlock_hardware before abort
>
> I'm wondering - shouldn't the DRM automatically release the lock if a client
> exits? I was under the impression that this was already done, but if not, it
> is definitely a kernel bug that needs fixing.
>
> Sprinkling unlock_hardwares in the userspace code is the wrong approach,
> because it won't help e.g. in the case of segfaults.
>
I would hve writen that code if it had worked in first place. It works
if driver calls exist() but in case of segfault or abort() call drm
lock isn't freed and my X is frozen.

It is possible to handle abort and segfault signals and free the lock
there. But of course if everything would be handled in kernel side
correctly in case of program crash it would be a lot of better.

But unless that is fixed I think silent exist is worse than doing
manual unlock and calling abort. Abort call would add least make it
easier for distros to collect crash information for bug hunting. Also
abort makes it a lot easier for newbie like me.  :)

But now it is time to do some coding :)

Pauli

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to