From owner-freebsd-emulation@freebsd.org Mon Nov 21 12:59:37 2016 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA030C47FF5 for ; Mon, 21 Nov 2016 12:59:37 +0000 (UTC) (envelope-from michael.thayer@oracle.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id C584E8D1 for ; Mon, 21 Nov 2016 12:59:37 +0000 (UTC) (envelope-from michael.thayer@oracle.com) Received: by mailman.ysv.freebsd.org (Postfix) id C1D4CC47FF4; Mon, 21 Nov 2016 12:59:37 +0000 (UTC) Delivered-To: emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C176FC47FF3 for ; Mon, 21 Nov 2016 12:59:37 +0000 (UTC) (envelope-from michael.thayer@oracle.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2E4C8D0 for ; Mon, 21 Nov 2016 12:59:37 +0000 (UTC) (envelope-from michael.thayer@oracle.com) Received: by freefall.freebsd.org (Postfix) id 97A5D1D13; Mon, 21 Nov 2016 12:59:37 +0000 (UTC) Delivered-To: vbox@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 970301D12 for ; Mon, 21 Nov 2016 12:59:37 +0000 (UTC) (envelope-from michael.thayer@oracle.com) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "aserp1040.oracle.com", Issuer "Oracle SSL CA - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62A438CF for ; Mon, 21 Nov 2016 12:59:37 +0000 (UTC) (envelope-from michael.thayer@oracle.com) Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uALCxS8V006531 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Nov 2016 12:59:28 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uALCxRMX014660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Nov 2016 12:59:28 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uALCxRrw005968; Mon, 21 Nov 2016 12:59:27 GMT Received: from [192.168.178.32] (/79.214.105.237) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 Nov 2016 04:59:27 -0800 Subject: Re: [vbox-dev] Minimalist OpenGL program crashing To: =?UTF-8?B?T3RhY8OtbGlv?= , vbox@FreeBSD.org, vbox-dev@virtualbox.org References: <47706e97-9f29-7a7d-bd31-3a773a7a94b0@bsd.com.br> <7be0cd95-46e2-90b4-15ed-dedc08523867@oracle.com> <78c58693-9b0e-0fd7-b231-5faf7ddc7ab2@bsd.com.br> From: Michael Thayer Organization: ORACLE Deutschland B.V. und Co. KG Message-ID: <8cf4e43a-e940-497f-9a9c-e60f30904a47@oracle.com> Date: Mon, 21 Nov 2016 13:59:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <78c58693-9b0e-0fd7-b231-5faf7ddc7ab2@bsd.com.br> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Mailman-Approved-At: Mon, 21 Nov 2016 13:41:43 +0000 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 12:59:38 -0000 Hello Otacílio, 21.11.2016 12:57, Otacílio wrote: > Yes, I located the exactly line where the seg fault is raised. I did a > full report with a description and a stacktrace. Is reported here: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214396 I'm afraid that you must have misunderstood me. I said that it was quite likely that this would get fixed if you were able to understand (and by implication explain) the problem. By understanding though I specifically did not mean just pointing out the line in the code where the segmentation fault occurs (I saw that too when I ran the programme in the debugger). I meant finding the logical flaw in the reasoning behind the code of which this crash is a symptom. Feel free to open a bug in our bugtracker for this of course, but someone will still have to do that analysis. As I said in my previous reply, it is extremely unlikely that we will have resources for this in the near future. Regards, Michael > After debugging gdb says that the exception is raised on line 679 of file /usr/ports/emulators/virtualbox-ose-additions/work/VirtualBox-5.1.8/src/VBox/GuestHost/OpenGL/util/hash.c > > void *crHashtableSearch( const CRHashTable *h, unsigned long key ) > { > unsigned int index = crHash( key ); > CRHashNode *temp; > #ifdef CHROMIUM_THREADSAFE > BUG IS HERE =======> crLockMutex((CRmutex *)&h->mutex); > #endif > for ( temp = h->buckets[index]; temp; temp = temp->next ) > { > if ( temp->key == key ) > break; > } > #ifdef CHROMIUM_THREADSAFE > crUnlockMutex((CRmutex *)&h->mutex); > #endif > if ( !temp ) > { > return NULL; > } > return temp->data; > } > > > (gdb) backtrace > #0 check_and_init_mutex (mutex=0x20c8, m=0x7fffffffe650) at /usr/src/lib/libthr/thread/thr_mutex.c:588 > #1 0x0000000802923506 in __pthread_mutex_lock (mutex=0x20c8) at /usr/src/lib/libthr/thread/thr_mutex.c:743 > #2 0x0000000801e531f1 in crHashtableSearch (h=0x0, key=56623106) at /usr/ports/emulators/virtualbox-ose-additions/work/VirtualBox-5.1.8/src/VBox/GuestHost/OpenGL/util/hash.c:679 > #3 0x000000080088f1cb in glXMakeCurrent (dpy=0x80481f000, drawable=56623106, ctx=0x1f4) at /usr/ports/emulators/virtualbox-ose-additions/work/VirtualBox-5.1.8/src/VBox/Additions/common/crOpenGL/glx.c:694 > #4 0x00000008010ce5be in fgSetWindow () from /usr/local/lib/libglut.so.3 > #5 0x00000008010cc44c in fgDestroyWindow () from /usr/local/lib/libglut.so.3 > #6 0x00000008010cc895 in fgDestroyStructure () from /usr/local/lib/libglut.so.3 > #7 0x00000008010c9841 in fgDeinitialize () from /usr/local/lib/libglut.so.3 > #8 0x0000000801b9add6 in __cxa_finalize (dso=) at /usr/src/lib/libc/stdlib/atexit.c:237 > #9 0x0000000801b2a141 in exit (status=0) at /usr/src/lib/libc/stdlib/exit.c:72 > #10 0x0000000000400976 in _start () > #11 0x0000000800622000 in ?? () > #12 0x0000000000000000 in ?? () > > > > But, if you prefer I can report in a vbox bugtracking also. > > Cheers > -Otacílio > > Em 21/11/2016 08:25, Michael Thayer escreveu: >> Hello Otacílio, >> >> 10.11.2016 13:07, Otacílio wrote: >>> I'm using this minimalist program to test OpenGL. When running on a true >>> machine (FreeBSD 11, clang 3.8.0) this program runs fine. But, when >>> compiling and running in a Virtualbox guest with >>> virtualbox-ose-additions-5.1.8 installed (FreeBSD 11, clang 3.8.0, >>> OpenGL enabled) I'm getting a core dump when the program exits. So its >>> not clear to me if this is a FreeBSD port problem or not. So, please, I >>> wold like ask you to compile and running in your's guest machine running >>> Linux or FreeBSD and report to me the results. >> >> I can confirm that this affects Linux guests too. Unfortunately we do >> not have time to investigate X11 guest 3D issues for the foreseeable >> future, so your best bet is probably to debug it yourself. If you can >> clearly locate the problem (as in understanding it) chances are good >> that we will fix it. >> >> Regards, >> >> Michael >> >>> >>> Program: >>> >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> >>> int main(int argc, char **argv) { >>> >>> glutInit(&argc, argv); >>> glutCreateWindow("GLUT"); >>> glewInit(); >>> >>> printf("OpenGL version supported by this platform (%s): \n", >>> glGetString(GL_VERSION)); >>> >>> fprintf(stdout, "Exiting...\n"); >>> fflush(stdout); >>> >>> return 0; >>> } >>> >>> >>> Compiler command: >>> >>> cc -I/usr/local/include -L/usr/local/lib -o testegl testegl.c -lGL >>> -lGLEW -lGLU -lglut >>> >>> >>> My results in a guest machine: >>> >>> [ota@nostromo /usr/home/ota/Desktop]$ ./testegl >>> OpenGL version supported by this platform (2.1 Chromium 1.9): >>> Exiting... >>> Segmentation fault (imagem do núcleo gravada) >>> >>> >>> Thanks a lot! >>> >>> []'s >>> >>> -Otacilio >>> >>> _______________________________________________ >>> vbox-dev mailing list >>> vbox-dev@virtualbox.org >>> https://www.virtualbox.org/mailman/listinfo/vbox-dev >> > -- Michael Thayer | VirtualBox engineer ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt ORACLE Deutschland B.V. & Co. KG Hauptverwaltung: Riesstraße 25, D-80992 München Registergericht: Amtsgericht München, HRA 95603 Komplementärin: ORACLE Deutschland Verwaltung B.V. Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697 Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher